mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): use kysely (#12857)
This commit is contained in:
parent
1489d69f81
commit
2e12c46980
59 changed files with 2891 additions and 3289 deletions
|
|
@ -4,6 +4,7 @@ import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE, ModuleRef } from '@ne
|
|||
import { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ClsModule } from 'nestjs-cls';
|
||||
import { KyselyModule } from 'nestjs-kysely';
|
||||
import { OpenTelemetryModule } from 'nestjs-otel';
|
||||
import { commands } from 'src/commands';
|
||||
import { IWorker } from 'src/constants';
|
||||
|
|
@ -48,7 +49,7 @@ const imports = [
|
|||
inject: [ModuleRef],
|
||||
useFactory: (moduleRef: ModuleRef) => {
|
||||
return {
|
||||
...database.config,
|
||||
...database.config.typeorm,
|
||||
poolErrorHandler: (error) => {
|
||||
moduleRef.get(DatabaseService, { strict: false }).handleConnectionError(error);
|
||||
},
|
||||
|
|
@ -56,6 +57,7 @@ const imports = [
|
|||
},
|
||||
}),
|
||||
TypeOrmModule.forFeature(entities),
|
||||
KyselyModule.forRoot(database.config.kysely),
|
||||
];
|
||||
|
||||
class BaseModule implements OnModuleInit, OnModuleDestroy {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue