[slonik] memberType in sql.array can be a string or another sql tagged template (#40445)

This commit is contained in:
Jesus Abarca
2019-11-22 08:37:32 -08:00
committed by Sheetal Nandi
parent c86f688b14
commit c842f6ed49
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ export interface SqlTaggedTemplateType {
<T = QueryResultRowType>(template: TemplateStringsArray, ...vals: ValueExpressionType[]): SqlSqlTokenType<T>;
array: (
values: PrimitiveValueExpressionType[],
memberType: string
memberType: TypeNameIdentifierType | SqlTokenType
) => ArraySqlTokenType;
identifier: (
names: string[]
+4
View File
@@ -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 () => {