mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(server): sql versioning (#5346)
* chore(server): sql versioning * chore: always add newline to end of file * refactor: generator * chore: pr feedback * chore: pr feedback
This commit is contained in:
parent
ffecfbe075
commit
5e55a17b2a
34 changed files with 3012 additions and 9 deletions
20
server/src/infra/infra.util.ts
Normal file
20
server/src/infra/infra.util.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { SetMetadata } from '@nestjs/common';
|
||||
|
||||
export const GENERATE_SQL_KEY = 'generate-sql-key';
|
||||
|
||||
export interface GenerateSqlQueries {
|
||||
name?: string;
|
||||
params?: any[];
|
||||
}
|
||||
|
||||
/** Decorator to enable versioning/tracking of generated Sql */
|
||||
export const GenerateSql = (...options: GenerateSqlQueries[]) => SetMetadata(GENERATE_SQL_KEY, options);
|
||||
|
||||
export const DummyValue = {
|
||||
UUID: '00000000-0000-4000-a000-000000000000',
|
||||
PAGINATION: { take: 10, skip: 0 },
|
||||
EMAIL: 'user@immich.app',
|
||||
STRING: 'abcdefghi',
|
||||
BUFFER: Buffer.from('abcdefghi'),
|
||||
DATE: new Date(),
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue