Skip to content

Commit

Permalink
improvement: improve database config options
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jun 2, 2021
1 parent 2c72134 commit 398b24a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
20 changes: 18 additions & 2 deletions adonis-typings/database.ts
Expand Up @@ -325,6 +325,8 @@ declare module '@ioc:Adonis/Lucid/Database' {
client: 'sqlite' | 'sqlite3'
connection: {
filename: string
flags?: string[]
debug?: boolean
mode?: any
}
replicas?: never
Expand Down Expand Up @@ -411,7 +413,7 @@ declare module '@ioc:Adonis/Lucid/Database' {

/**
* Please install `oracledb` driver and not the `oracle`. The later is
* depreciated. Config is only allowed for `oracledb`.
* deprecated. Config is only allowed for `oracledb`.
*
* Please refer to the driver configuration docs to learn more about the
* config values.
Expand Down Expand Up @@ -457,10 +459,24 @@ declare module '@ioc:Adonis/Lucid/Database' {
connectionTimeout?: number
requestTimeout?: number
parseJSON?: boolean
// https://github.com/knex/knex/blob/master/lib/dialects/mssql/index.js#L97
options?: {
encrypt?: boolean
useUTC?: boolean
tdsVersion?: string
appName?: string
abortTransactionOnError?: boolean
trustedConnection?: boolean
enableArithAbort?: boolean
isolationLevel?:
| 'READ_UNCOMMITTED'
| 'READ_COMMITTED'
| 'REPEATABLE_READ'
| 'SERIALIZABLE'
| 'SNAPSHOT'
maxRetriesOnTransientErrors?: number
multiSubnetFailover?: boolean
packetSize?: number
trustServerCertificate?: boolean
}
}
export type MssqlConfig = SharedConfigNode & {
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -68,7 +68,6 @@
"@adonisjs/require-ts": "^2.0.4",
"@adonisjs/sink": "^5.1.3",
"@poppinss/dev-utils": "^1.1.4",
"@types/dotenv": "^8.2.0",
"@types/luxon": "^1.26.5",
"@types/node": "^15.6.2",
"@types/pluralize": "0.0.29",
Expand Down
2 changes: 1 addition & 1 deletion templates/database.txt
Expand Up @@ -147,7 +147,7 @@ const databaseConfig: DatabaseConfig = {
| Configuration for MSSQL database. Make sure to install the driver
| from npm when using this connection
|
| npm i mssql
| npm i tedious
|
*/
mssql: {
Expand Down

0 comments on commit 398b24a

Please sign in to comment.