Skip to content

Commit 1877630

Browse files
committed
fix: restore connection string validation to allow apikey, token, or username/password
1 parent 71d9f54 commit 1877630

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/drivers/utilities.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ export function parseconnectionstring(connectionstring: string): SQLiteCloudConf
269269
verbose: options.verbose ? parseBoolean(options.verbose) : undefined
270270
}
271271

272-
// either you use an apikey or a token
273-
if (Number(!!config.apikey) + Number(!!config.token) > 1) {
274-
console.error('SQLiteCloudConnection.parseconnectionstring - choose between apikey or token')
275-
throw new SQLiteCloudError('Choose between apikey or token')
272+
// either you use an apikey, token or username and password
273+
if (Number(!!config.apikey) + Number(!!config.token) + Number(!!(config.username || config.password)) > 1) {
274+
console.error('SQLiteCloudConnection.parseconnectionstring - choose between apikey, token or username/password')
275+
throw new SQLiteCloudError('Choose between apikey, token or username/password')
276276
}
277277

278278
const database = url.pathname.replace('/', '') // pathname is database name, remove the leading slash

0 commit comments

Comments
 (0)