mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 23:26:58 -08:00
* add unicorn to eslint * fix lint errors for cli * fix merge * fix album name extraction * Update cli/src/commands/upload.command.ts Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> * es2k23 * use lowercase os * return undefined album name * fix bug in asset response dto * auto fix issues * fix server code style * es2022 and formatting * fix compilation error * fix test * fix config load * fix last lint errors * set string type * bump ts * start work on web * web formatting * Fix UUIDParamDto as UUIDParamDto * fix library service lint * fix web errors * fix errors * formatting * wip * lints fixed * web can now start * alphabetical package json * rename error * chore: clean up --------- Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { SetMetadata } from '@nestjs/common';
|
|
|
|
export const GENERATE_SQL_KEY = 'generate-sql-key';
|
|
|
|
export interface GenerateSqlQueries {
|
|
name?: string;
|
|
params: unknown[];
|
|
}
|
|
|
|
/** Decorator to enable versioning/tracking of generated Sql */
|
|
export const GenerateSql = (...options: GenerateSqlQueries[]) => SetMetadata(GENERATE_SQL_KEY, options);
|
|
|
|
const UUID = '00000000-0000-4000-a000-000000000000';
|
|
|
|
export const DummyValue = {
|
|
UUID,
|
|
UUID_SET: new Set([UUID]),
|
|
PAGINATION: { take: 10, skip: 0 },
|
|
EMAIL: 'user@immich.app',
|
|
STRING: 'abcdefghi',
|
|
BUFFER: Buffer.from('abcdefghi'),
|
|
DATE: new Date(),
|
|
TIME_BUCKET: '2024-01-01T00:00:00.000Z',
|
|
};
|
|
|
|
// PostgreSQL uses a 16-bit integer to indicate the number of bound parameters. This means that the
|
|
// maximum number of parameters is 65535. Any query that tries to bind more than that (e.g. searching
|
|
// by a list of IDs) requires splitting the query into multiple chunks.
|
|
// We are rounding down this limit, as queries commonly include other filters and parameters.
|
|
export const DATABASE_PARAMETER_CHUNK_SIZE = 65_500;
|