@@ -796,7 +796,7 @@ const buildWhereClause = ({ schema, query, index, caseInsensitive }): WhereClaus
796796
797797export class PostgresStorageAdapter implements StorageAdapter {
798798 canSortOnJoinTables : boolean ;
799- horizontalScaling : boolean ;
799+ enableHooks : boolean ;
800800
801801 // Private
802802 _collectionPrefix : string ;
@@ -806,10 +806,10 @@ export class PostgresStorageAdapter implements StorageAdapter {
806806 _stream : any ;
807807 _uuid : any ;
808808
809- constructor ( { uri, collectionPrefix = '' , databaseOptions = { } } : any ) {
809+ constructor ( { uri, collectionPrefix = '' , databaseOptions = { } , enableHooks = false } : any ) {
810810 this . _collectionPrefix = collectionPrefix ;
811- this . horizontalScaling = ! ! databaseOptions . horizontalScaling ;
812- delete databaseOptions . horizontalScaling ;
811+ this . enableHooks = enableHooks ;
812+
813813 const { client, pgp } = createClient ( uri , databaseOptions ) ;
814814 this . _client = client ;
815815 this . _onchange = ( ) => { } ;
@@ -843,7 +843,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
843843 }
844844
845845 async _listenToSchema ( ) {
846- if ( ! this . _stream && this . horizontalScaling ) {
846+ if ( ! this . _stream && this . enableHooks ) {
847847 this . _stream = await this . _client . connect ( { direct : true } ) ;
848848 this . _stream . client . on ( 'notification' , data => {
849849 const payload = JSON . parse ( data . payload ) ;
0 commit comments