@@ -19,8 +19,11 @@ import { WalStreamReplicator } from '../replication/WalStreamReplicator.js';
1919import * as types from '../types/types.js' ;
2020import { PostgresConnectionConfig } from '../types/types.js' ;
2121import { getApplicationName } from '../utils/application-name.js' ;
22+ import { CustomTypeRegistry } from '../types/registry.js' ;
2223
2324export class PostgresModule extends replication . ReplicationModule < types . PostgresConnectionConfig > {
25+ private customTypes : CustomTypeRegistry = new CustomTypeRegistry ( ) ;
26+
2427 constructor ( ) {
2528 super ( {
2629 name : 'Postgres' ,
@@ -48,7 +51,7 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
4851 protected createReplicator ( context : system . ServiceContext ) : replication . AbstractReplicator {
4952 const normalisedConfig = this . resolveConfig ( this . decodedConfig ! ) ;
5053 const syncRuleProvider = new ConfigurationFileSyncRulesProvider ( context . configuration . sync_rules ) ;
51- const connectionFactory = new ConnectionManagerFactory ( normalisedConfig ) ;
54+ const connectionFactory = new ConnectionManagerFactory ( normalisedConfig , this . customTypes ) ;
5255
5356 return new WalStreamReplicator ( {
5457 id : this . getDefaultId ( normalisedConfig . database ) ,
@@ -75,7 +78,8 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
7578 const connectionManager = new PgManager ( normalisedConfig , {
7679 idleTimeout : 30_000 ,
7780 maxSize : 1 ,
78- applicationName : getApplicationName ( )
81+ applicationName : getApplicationName ( ) ,
82+ registry : this . customTypes
7983 } ) ;
8084
8185 try {
@@ -106,7 +110,8 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
106110 const connectionManager = new PgManager ( normalizedConfig , {
107111 idleTimeout : 30_000 ,
108112 maxSize : 1 ,
109- applicationName : getApplicationName ( )
113+ applicationName : getApplicationName ( ) ,
114+ registry : new CustomTypeRegistry ( )
110115 } ) ;
111116 const connection = await connectionManager . snapshotConnection ( ) ;
112117 try {
0 commit comments