feat: support postgresql protocol in database URI (#7757)
This commit is contained in:
@@ -555,7 +555,7 @@ describe_only_db('postgres')('PostgresStorageAdapter', () => {
|
||||
},
|
||||
classLevelPermissions: undefined,
|
||||
});
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
expect(adapter._onchange).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -567,4 +567,13 @@ describe_only_db('postgres')('PostgresStorageAdapter shutdown', () => {
|
||||
adapter.handleShutdown();
|
||||
expect(adapter._client.$pool.ending).toEqual(true);
|
||||
});
|
||||
|
||||
it('handleShutdown, close connection of postgresql uri', () => {
|
||||
const databaseURI2 = new URL(databaseURI);
|
||||
databaseURI2.protocol = 'postgresql:';
|
||||
const adapter = new PostgresStorageAdapter({ uri: databaseURI2.toString() });
|
||||
expect(adapter._client.$pool.ending).toEqual(false);
|
||||
adapter.handleShutdown();
|
||||
expect(adapter._client.$pool.ending).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user