File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { Module , OnModuleDestroy } from '@nestjs/common' ;
2
2
import { APP_INTERCEPTOR } from '@nestjs/core' ;
3
3
import { createClient , Duration } from 'edgedb' ;
4
+ import type { ConfigService } from '~/core' ;
4
5
import { codecs , registerCustomScalarCodecs } from './codecs' ;
5
6
import { EdgeDBTransactionalMutationsInterceptor } from './edgedb-transactional-mutations.interceptor' ;
6
7
import { EdgeDB } from './edgedb.service' ;
@@ -26,16 +27,18 @@ import { TransactionContext } from './transaction.context';
26
27
OptionsContext ,
27
28
{
28
29
provide : Client ,
29
- inject : [ OptionsContext ] ,
30
- useFactory : async ( options : OptionsContext ) => {
30
+ inject : [ OptionsContext , 'CONFIG' ] ,
31
+ useFactory : async ( options : OptionsContext , config : ConfigService ) => {
31
32
const client = createClient ( {
32
33
// Only for connection retry warnings. Skip.
33
34
logging : false ,
34
35
} ) ;
35
36
36
37
Object . assign ( client , { options : options . current } ) ;
37
38
38
- await registerCustomScalarCodecs ( client , codecs ) ;
39
+ if ( config . databaseEngine === 'edgedb' ) {
40
+ await registerCustomScalarCodecs ( client , codecs ) ;
41
+ }
39
42
40
43
return client ;
41
44
} ,
You can’t perform that action at this time.
0 commit comments