mirror of
https://github.com/immich-app/immich.git
synced 2025-12-28 09:14:59 +03:00
* wip auto-detect available extensions auto-recovery, fix reindexing check use original image for ml * set probes * update image for sql checker update images for gha * cascade * fix new instance * accurate dummy vector * simplify dummy * preexisiting pg docs * handle different db name * maybe fix sql generation * revert refreshfaces sql change * redundant switch * outdated message * update docker compose files * Update docs/docs/administration/postgres-standalone.md Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> * tighten range * avoid always printing "vector reindexing complete" * remove nesting * use new images * add vchord to unit tests * debug e2e image * mention 1.107.2 in startup error * support new vchord versions --------- Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { DatabaseRepository } from 'src/repositories/database.repository';
|
|
import { RepositoryInterface } from 'src/types';
|
|
import { Mocked, vitest } from 'vitest';
|
|
|
|
export const newDatabaseRepositoryMock = (): Mocked<RepositoryInterface<DatabaseRepository>> => {
|
|
return {
|
|
shutdown: vitest.fn(),
|
|
getExtensionVersion: vitest.fn(),
|
|
getVectorExtension: vitest.fn(),
|
|
getExtensionVersionRange: vitest.fn(),
|
|
getPostgresVersion: vitest.fn().mockResolvedValue('14.10 (Debian 14.10-1.pgdg120+1)'),
|
|
getPostgresVersionRange: vitest.fn().mockReturnValue('>=14.0.0'),
|
|
createExtension: vitest.fn().mockResolvedValue(void 0),
|
|
updateVectorExtension: vitest.fn(),
|
|
reindexVectorsIfNeeded: vitest.fn(),
|
|
getDimensionSize: vitest.fn(),
|
|
setDimensionSize: vitest.fn(),
|
|
deleteAllSearchEmbeddings: vitest.fn(),
|
|
prewarm: vitest.fn(),
|
|
runMigrations: vitest.fn(),
|
|
withLock: vitest.fn().mockImplementation((_, function_: <R>() => Promise<R>) => function_()),
|
|
tryLock: vitest.fn(),
|
|
isBusy: vitest.fn(),
|
|
wait: vitest.fn(),
|
|
};
|
|
};
|