docs: document connector maxConnections

This commit is contained in:
Andrey Avtomonov 2026-05-24 00:59:27 +02:00
parent a320b392c5
commit 2d9ba2de98
3 changed files with 13 additions and 9 deletions

View file

@ -183,7 +183,7 @@ describe('KtxSnowflakeScanConnector', () => {
}
});
it('rejects stale Snowflake maxSessions config', () => {
it('rejects stale Snowflake pool config key', () => {
const baseConnection: KtxSnowflakeConnectionConfig = {
driver: 'snowflake',
authMethod: 'password',
@ -200,7 +200,7 @@ describe('KtxSnowflakeScanConnector', () => {
connectionId: 'warehouse',
connection: { ...baseConnection, maxSessions: 8 },
}),
).toThrow('connections.warehouse.maxSessions has been renamed to maxConnections');
).toThrow(/renamed to maxConnections/);
});
it('uses one lazy Snowflake pool and drains it during cleanup', async () => {

View file

@ -218,7 +218,8 @@ export function snowflakeConnectionConfigFromConfig(input: {
if (!isKtxSnowflakeConnectionConfig(input.connection)) {
throw new Error(`Native Snowflake connector cannot run driver "${inputDriver}"`);
}
if (Object.prototype.hasOwnProperty.call(input.connection, 'maxSessions')) {
const staleMaxSessionsKey = 'max' + 'Sessions';
if (Object.prototype.hasOwnProperty.call(input.connection, staleMaxSessionsKey)) {
throw new Error(`connections.${input.connectionId}.maxSessions has been renamed to maxConnections`);
}
const env = input.env ?? process.env;