@@ -19,8 +19,11 @@ import { WalStreamReplicator } from '../replication/WalStreamReplicator.js';
19
19
import * as types from '../types/types.js' ;
20
20
import { PostgresConnectionConfig } from '../types/types.js' ;
21
21
import { getApplicationName } from '../utils/application-name.js' ;
22
+ import { CustomTypeRegistry } from '../types/registry.js' ;
22
23
23
24
export class PostgresModule extends replication . ReplicationModule < types . PostgresConnectionConfig > {
25
+ private customTypes : CustomTypeRegistry = new CustomTypeRegistry ( ) ;
26
+
24
27
constructor ( ) {
25
28
super ( {
26
29
name : 'Postgres' ,
@@ -48,7 +51,7 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
48
51
protected createReplicator ( context : system . ServiceContext ) : replication . AbstractReplicator {
49
52
const normalisedConfig = this . resolveConfig ( this . decodedConfig ! ) ;
50
53
const syncRuleProvider = new ConfigurationFileSyncRulesProvider ( context . configuration . sync_rules ) ;
51
- const connectionFactory = new ConnectionManagerFactory ( normalisedConfig ) ;
54
+ const connectionFactory = new ConnectionManagerFactory ( normalisedConfig , this . customTypes ) ;
52
55
53
56
return new WalStreamReplicator ( {
54
57
id : this . getDefaultId ( normalisedConfig . database ) ,
@@ -75,7 +78,8 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
75
78
const connectionManager = new PgManager ( normalisedConfig , {
76
79
idleTimeout : 30_000 ,
77
80
maxSize : 1 ,
78
- applicationName : getApplicationName ( )
81
+ applicationName : getApplicationName ( ) ,
82
+ registry : this . customTypes
79
83
} ) ;
80
84
81
85
try {
@@ -106,7 +110,8 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
106
110
const connectionManager = new PgManager ( normalizedConfig , {
107
111
idleTimeout : 30_000 ,
108
112
maxSize : 1 ,
109
- applicationName : getApplicationName ( )
113
+ applicationName : getApplicationName ( ) ,
114
+ registry : new CustomTypeRegistry ( )
110
115
} ) ;
111
116
const connection = await connectionManager . snapshotConnection ( ) ;
112
117
try {
0 commit comments