mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[knex] Enable named bindings in *Raw methods (#25028)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
c78f4617d8
commit
9f0ef7e76e
Vendored
+3
-2
@@ -18,6 +18,7 @@ import Bluebird = require("bluebird");
|
||||
type Callback = Function;
|
||||
type Client = Function;
|
||||
type Value = string | number | boolean | Date | Array<string> | Array<number> | Array<Date> | Array<boolean> | Buffer | Knex.Raw;
|
||||
type ValueMap = { [key: string]: Value };
|
||||
type ColumnName = string | Knex.Raw | Knex.QueryBuilder | {[key: string]: string };
|
||||
type TableName = string | Knex.Raw | Knex.QueryBuilder;
|
||||
|
||||
@@ -338,7 +339,7 @@ declare namespace Knex {
|
||||
|
||||
interface RawQueryBuilder {
|
||||
(sql: string, ...bindings: Value[]): QueryBuilder;
|
||||
(sql: string, bindings: Value[]): QueryBuilder;
|
||||
(sql: string, bindings: Value[] | ValueMap): QueryBuilder;
|
||||
(raw: Raw): QueryBuilder;
|
||||
}
|
||||
|
||||
@@ -352,7 +353,7 @@ declare namespace Knex {
|
||||
(value: Value): Raw;
|
||||
(sql: string, ...bindings: Value[]): Raw;
|
||||
(sql: string, bindings: Value[]): Raw;
|
||||
(sql: string, bindings: Object): Raw;
|
||||
(sql: string, bindings: ValueMap): Raw;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -246,6 +246,7 @@ knex('users').whereBetween('votes', [1, 100]);
|
||||
knex('users').whereNotBetween('votes', [1, 100]);
|
||||
|
||||
knex('users').whereRaw('id = ?', [1]);
|
||||
knex('users').whereRaw('id = :id', { id: 1 });
|
||||
|
||||
// Join methods
|
||||
knex('users')
|
||||
|
||||
Reference in New Issue
Block a user