Minor Changes
-
d215453: Added support for literal inference. SafeQL will now be able to infer string literals from your queries:
// Before: sql<{ col: string }>`SELECT ${"value"} FROM table`; sql<{ col: string }>`SELECT CASE WHEN ${condition} THEN 'a' ELSE 'b' END`; // After: sql<{ col: "value" }>`SELECT ${"value"} FROM table`; sql<{ col: "a" | "b" }>`SELECT CASE WHEN ${condition} THEN 'a' ELSE 'b' END`;
This behavior could be disabled or adjusted in the
connections.inferLiterals
.
Patch Changes
- @ts-safeql/shared@3.6.0
- @ts-safeql/sql-ast@3.6.0
- @ts-safeql/test-utils@0.0.35