allow numbers as the right hand side of a join equality (#14823)

This commit is contained in:
Chet Husk
2017-03-10 15:17:36 -08:00
committed by Mohamed Hegazy
parent 75ffb8e47d
commit a43da75444
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ declare namespace Knex {
interface Join {
(raw: Raw): QueryBuilder;
(tableName: string, columns: { [key: string]: string | Raw }): QueryBuilder;
(tableName: string, columns: { [key: string]: string | number | Raw }): QueryBuilder;
(tableName: string, callback: Function): QueryBuilder;
(tableName: TableName, raw: Raw): QueryBuilder;
(tableName: TableName, column1: string, column2: string): QueryBuilder;
+4
View File
@@ -188,6 +188,10 @@ knex('users')
.join('contacts', 'users.id', '=', 'contacts.user_id')
.select('users.id', 'contacts.phone');
knex('users')
.join('contacts', { 'users.id': 12355 })
.select('users.id', 'contacts.phone');
knex('users')
.join('contacts', 'users.id', 'contacts.user_id')
.select('users.id', 'contacts.phone');