mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 17:51:16 +10:00
Kysely - WIP
* create database migration files * kysely codegen * kysely migrate
This commit is contained in:
@ -8,6 +8,10 @@ import { DatabaseModule } from './database/database.module';
|
||||
import { WsModule } from './ws/ws.module';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { join } from 'path';
|
||||
import { KyselyModule } from 'nestjs-kysely';
|
||||
import { EnvironmentService } from './integrations/environment/environment.service';
|
||||
import { PostgresDialect } from 'kysely';
|
||||
import { Pool } from 'pg';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@ -19,6 +23,19 @@ import { join } from 'path';
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(__dirname, '..', '..', '..', 'client/dist'),
|
||||
}),
|
||||
KyselyModule.forRootAsync({
|
||||
imports: [],
|
||||
inject: [EnvironmentService],
|
||||
useFactory: (envService: EnvironmentService) => {
|
||||
return {
|
||||
dialect: new PostgresDialect({
|
||||
pool: new Pool({
|
||||
connectionString: envService.getDatabaseURL(),
|
||||
}) as any,
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
||||
Reference in New Issue
Block a user