diff --git a/types/slonik/index.d.ts b/types/slonik/index.d.ts index 35acc62d50..ac4c95bf7d 100644 --- a/types/slonik/index.d.ts +++ b/types/slonik/index.d.ts @@ -300,7 +300,7 @@ export interface SqlTaggedTemplateType { (template: TemplateStringsArray, ...vals: ValueExpressionType[]): SqlSqlTokenType; array: ( values: PrimitiveValueExpressionType[], - memberType: string + memberType: TypeNameIdentifierType | SqlTokenType ) => ArraySqlTokenType; identifier: ( names: string[] diff --git a/types/slonik/slonik-tests.ts b/types/slonik/slonik-tests.ts index fb22733e35..97f84e5db7 100644 --- a/types/slonik/slonik-tests.ts +++ b/types/slonik/slonik-tests.ts @@ -405,6 +405,10 @@ const samplesFromDocs = async () => { await connection.query(sql` SELECT (${sql.array([1, 2, 3], 'int4')}) `); + + await connection.query(sql` + SELECT (${sql.array([1, 2, 3], sql`int[]`)}) + `); }; const sample3 = async () => {