From a43da75444d2aae17adabcfc6c8809586afcb658 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Fri, 10 Mar 2017 17:17:36 -0600 Subject: [PATCH] allow numbers as the right hand side of a join equality (#14823) --- knex/index.d.ts | 2 +- knex/knex-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/knex/index.d.ts b/knex/index.d.ts index 0627498962..660a8dfcb2 100644 --- a/knex/index.d.ts +++ b/knex/index.d.ts @@ -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; diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index 420aafd724..3d02a7924b 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -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');