From 61838737258e9ef4c35bc7635a572deb7012ffcb Mon Sep 17 00:00:00 2001 From: Patrick Godwin Date: Sat, 19 Jan 2019 12:29:27 -0800 Subject: [PATCH 1/4] Add 'any' type signature to params on Database.query to allow named SQL parameters --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index dd9cd76640..831e683848 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -442,7 +442,7 @@ declare namespace massive { /** Execute a query. */ query( query: Select | Insert | Update | Delete | string, - params?: string[], + params?: string[] | any, options?: ResultProcessingOptions ): Promise; From 255fe80db8f675c74f0884879b1255a2952c649c Mon Sep 17 00:00:00 2001 From: Patrick Godwin Date: Sat, 19 Jan 2019 12:47:59 -0800 Subject: [PATCH 2/4] Switch to object instead of any, per best practices --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 831e683848..3ff87cc46b 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -442,7 +442,7 @@ declare namespace massive { /** Execute a query. */ query( query: Select | Insert | Update | Delete | string, - params?: string[] | any, + params?: string[] | object, options?: ResultProcessingOptions ): Promise; From 713f8e4351f91d8f0cadeb360296bcf02e553c9b Mon Sep 17 00:00:00 2001 From: Patrick Godwin Date: Sat, 19 Jan 2019 21:44:50 -0800 Subject: [PATCH 3/4] address pr feedback around query param types --- types/massive/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 3ff87cc46b..ca06d46490 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -105,6 +105,9 @@ declare namespace massive { term: string; } + type QueryParamTypes = string | number | object; + type QueryParams = Array | QueryParamTypes; + interface EntitySpecification { /** A Database. */ db: Database; @@ -442,7 +445,7 @@ declare namespace massive { /** Execute a query. */ query( query: Select | Insert | Update | Delete | string, - params?: string[] | object, + params?: QueryParams, options?: ResultProcessingOptions ): Promise; From 8ba92daabb3030f98babb1a2829bf6b4696c70b9 Mon Sep 17 00:00:00 2001 From: Patrick Godwin Date: Sat, 19 Jan 2019 23:05:46 -0800 Subject: [PATCH 4/4] Fix definition to use best practices for array --- types/massive/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index ca06d46490..772f418df3 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -106,7 +106,7 @@ declare namespace massive { } type QueryParamTypes = string | number | object; - type QueryParams = Array | QueryParamTypes; + type QueryParams = QueryParamTypes[] | QueryParamTypes; interface EntitySpecification { /** A Database. */