Comparing version 0.20.2 to 0.20.3
@@ -356,2 +356,3 @@ #!/usr/bin/env node | ||
v8flags: require('v8flags'), | ||
moduleName: require('../package.json').name, | ||
}); | ||
@@ -358,0 +359,0 @@ |
# Master (Unreleased) | ||
# 0.20.3 - 27 November, 2019 | ||
### New features: | ||
- MSSQL, MySQL: Add connection string qs to connection params #3547 | ||
### Bug fixes: | ||
- Oracle: Fix issue retrieving BLOB from database #3545 | ||
- PostgreSQL: Timeout for postgresql use cancel instead of terminate #3518 | ||
- Make sure CLI works for namespaced knex packages #2539 | ||
### Typings: | ||
- Lift up dialect specific methods in the CreateTableBuilder #3532 | ||
- Add client property to QueryBuilder type #3541 | ||
- Support 'only' option #3551 | ||
# 0.20.2 - 14 November, 2019 | ||
@@ -4,0 +22,0 @@ |
@@ -344,3 +344,3 @@ // Oracledb Client | ||
return new Promise((resolve, reject) => { | ||
let data = ''; | ||
let data = type === 'string' ? '' : Buffer(0); | ||
@@ -347,0 +347,0 @@ stream.on('error', function(err) { |
@@ -280,3 +280,3 @@ // PostgreSQL | ||
// Error out if we can't acquire connection in time. | ||
// Purposely not putting timeout on `pg_terminate_backend` execution because erroring | ||
// Purposely not putting timeout on `pg_cancel_backend` execution because erroring | ||
// early there would release the `connectionToKill` back to the pool with | ||
@@ -297,3 +297,3 @@ // a `KILL QUERY` command yet to finish. | ||
method: 'raw', | ||
sql: 'SELECT pg_terminate_backend(?);', | ||
sql: 'SELECT pg_cancel_backend(?);', | ||
bindings: [connectionToKill.processID], | ||
@@ -300,0 +300,0 @@ options: {}, |
@@ -80,10 +80,8 @@ // TableBuilder | ||
if (this.client.dialect !== dialect) { | ||
this.client.logger.warn( | ||
`Knex only supports ${method} statement with ${dialect}.` | ||
); | ||
throw new Error(`Knex only supports ${method} statement with ${dialect}.`); | ||
} | ||
if (this._method === 'alter') { | ||
this.client.logger.warn( | ||
throw new Error( | ||
`Knex does not support altering the ${method} outside of create ` + | ||
`table, please use knex.raw statement.` | ||
`table, please use knex.raw statement.` | ||
); | ||
@@ -90,0 +88,0 @@ } |
@@ -6,3 +6,3 @@ const url = require('url'); | ||
module.exports = function parseConnectionString(str) { | ||
const parsed = url.parse(str); | ||
const parsed = url.parse(str, true); | ||
let { protocol } = parsed; | ||
@@ -59,3 +59,8 @@ if (protocol === null) { | ||
} | ||
if (parsed.query) { | ||
for (const key in parsed.query) { | ||
connection[key] = parsed.query[key]; | ||
} | ||
} | ||
return connection; | ||
} |
{ | ||
"name": "knex", | ||
"version": "0.20.2", | ||
"version": "0.20.3", | ||
"description": "A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser", | ||
@@ -5,0 +5,0 @@ "main": "knex.js", |
@@ -316,6 +316,13 @@ // Originally based on contributions to DefinitelyTyped: | ||
type TableOptions = PgTableOptions; | ||
interface PgTableOptions { | ||
only?: boolean; | ||
} | ||
interface Knex<TRecord extends {} = any, TResult = any[]> | ||
extends Knex.QueryInterface<TRecord, TResult>, events.EventEmitter { | ||
<TRecord2 = TRecord, TResult2 = DeferredKeySelection<TRecord2, never>[]>( | ||
tableName?: Knex.TableDescriptor | Knex.AliasDict | ||
tableName?: Knex.TableDescriptor | Knex.AliasDict, | ||
options?: TableOptions | ||
): Knex.QueryBuilder<TRecord2, TResult2>; | ||
@@ -867,3 +874,4 @@ VERSION: string; | ||
>( | ||
tableName: TableDescriptor | AliasDict | ||
tableName: TableDescriptor | AliasDict, | ||
options?: TableOptions | ||
): QueryBuilder<TRecord2, TResult2>; | ||
@@ -874,3 +882,4 @@ < | ||
>( | ||
callback: Function | ||
callback: Function, | ||
options?: TableOptions | ||
): QueryBuilder<TRecord2, TResult2>; | ||
@@ -881,3 +890,4 @@ < | ||
>( | ||
raw: Raw | ||
raw: Raw, | ||
options?: TableOptions | ||
): QueryBuilder<TRecord2, TResult2>; | ||
@@ -1365,2 +1375,3 @@ } | ||
ChainableInterface<ResolveResult<TResult>> { | ||
client: Client; | ||
or: QueryBuilder<TRecord, TResult>; | ||
@@ -1562,11 +1573,6 @@ not: QueryBuilder<TRecord, TResult>; | ||
interface CreateTableBuilder extends TableBuilder {} | ||
interface MySqlTableBuilder extends CreateTableBuilder { | ||
interface CreateTableBuilder extends TableBuilder { | ||
engine(val: string): CreateTableBuilder; | ||
charset(val: string): CreateTableBuilder; | ||
collate(val: string): CreateTableBuilder; | ||
} | ||
interface PostgreSqlTableBuilder extends CreateTableBuilder { | ||
inherits(val: string): CreateTableBuilder; | ||
@@ -1577,6 +1583,2 @@ } | ||
interface MySqlAlterTableBuilder extends AlterTableBuilder {} | ||
interface PostgreSqlAlterTableBuilder extends AlterTableBuilder {} | ||
interface ColumnBuilder { | ||
@@ -1583,0 +1585,0 @@ index(indexName?: string): ColumnBuilder; |
567116
15264