mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #22303 from baronfel/joins_with_raw
[knex] allow for right hand side fo a join to be a Raw value, per the docs
This commit is contained in:
@@ -7,13 +7,7 @@ const st: KPG.KnexPostgis = KPG(knex);
|
||||
|
||||
const point: GeoJSON.Point = {
|
||||
type: 'Point',
|
||||
coordinates: [23.773206, 61.506005],
|
||||
crs: {
|
||||
type: 'name',
|
||||
properties: {
|
||||
name: 'EPSG:4326'
|
||||
}
|
||||
}
|
||||
coordinates: [23.773206, 61.506005]
|
||||
};
|
||||
|
||||
const wktPoint = 'POINT(23.773206 61.506005)';
|
||||
|
||||
Vendored
+3
-3
@@ -196,19 +196,19 @@ declare namespace Knex {
|
||||
on(columns: { [key: string]: string | Raw }): JoinClause;
|
||||
on(column1: string, column2: string): JoinClause;
|
||||
on(column1: string, raw: Raw): JoinClause;
|
||||
on(column1: string, operator: string, column2: string): JoinClause;
|
||||
on(column1: string, operator: string, column2: string | Raw): JoinClause;
|
||||
andOn(raw: Raw): JoinClause;
|
||||
andOn(callback: Function): JoinClause;
|
||||
andOn(columns: { [key: string]: string | Raw }): JoinClause;
|
||||
andOn(column1: string, column2: string): JoinClause;
|
||||
andOn(column1: string, raw: Raw): JoinClause;
|
||||
andOn(column1: string, operator: string, column2: string): JoinClause;
|
||||
andOn(column1: string, operator: string, column2: string | Raw): JoinClause;
|
||||
orOn(raw: Raw): JoinClause;
|
||||
orOn(callback: Function): JoinClause;
|
||||
orOn(columns: { [key: string]: string | Raw }): JoinClause;
|
||||
orOn(column1: string, column2: string): JoinClause;
|
||||
orOn(column1: string, raw: Raw): JoinClause;
|
||||
orOn(column1: string, operator: string, column2: string): JoinClause;
|
||||
orOn(column1: string, operator: string, column2: string | Raw): JoinClause;
|
||||
onIn(column1: string, values: any[]): JoinClause;
|
||||
andOnIn(column1: string, values: any[]): JoinClause;
|
||||
orOnIn(column1: string, values: any[]): JoinClause;
|
||||
|
||||
@@ -257,6 +257,10 @@ knex.select('*').from('users').join('accounts', function(join: Knex.JoinClause)
|
||||
join.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id');
|
||||
});
|
||||
|
||||
knex.select('*').from('user').join('contacts', () => {
|
||||
this.on('users.id', '=', knex.raw(7));
|
||||
});
|
||||
|
||||
knex.select('*').from('users').join('contacts', function() {
|
||||
this.on('users.id', '=', 'contacts.id').onIn('contacts.id', [7, 15, 23, 41])
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user