We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sql.raw
1 parent 40d80bd commit 950001fCopy full SHA for 950001f
drizzle-orm/src/sql/sql.ts
@@ -508,11 +508,11 @@ export namespace sql {
508
}
509
510
/**
511
- * Convenience function to create an SQL query from a raw string.
512
- * @param str The raw SQL query string.
+ * Convenience function to create an SQL query from a raw string or a primitive value.
+ * @param input The raw SQL query string or a primitive value.
513
*/
514
- export function raw(str: string): SQL {
515
- return new SQL([new StringChunk(str)]);
+ export function raw<T extends string | number | boolean | null>(input: T): SQL<T extends string ? unknown : T> {
+ return new SQL([new StringChunk(String(input))]);
516
517
518
0 commit comments