Does using template strings not compromise with type-safety? The drizzle example will be a compile time error for example if id wasn't a numeric column.
Seems a strange design choice for a library that claims to offer a type-safe sql builder.
Seems a strange design choice for a library that claims to offer a type-safe sql builder.
SELECT * from Contact where id = '1'
With that said you can achieve something similar in litdb with a custom expression: const eq = <T,V>(ref:(x:T)=>V, value:V) => (x:T) => $`${ref(x)} = ${value}`
Which will type check that the value matches the column type: .where(eq(c => c.id, 2))
and fail type check when they don't: .where(eq(c => c.id, '2'))
Examples of other custom expressions: https://litdb.dev/#composable