K
Kysely3w ago
mike

Type safety in checkExpression in addCheckConstraint

Hi, is it possible somehow utilise kysely to create type-safe checkExpression and avoid writing stuff like this:
.addCheckConstraint(
'constraint-name',
sql`((((type = 'VALUE1'::schema_name."enum_specific_type") AND (name = 'NAME1'::citext)) OR (name <> 'NAME1'::citext)))`,
)
.addCheckConstraint(
'constraint-name',
sql`((((type = 'VALUE1'::schema_name."enum_specific_type") AND (name = 'NAME1'::citext)) OR (name <> 'NAME1'::citext)))`,
)
Dialect: psql
1 Reply
mike
mikeOP3w ago
If only raw is available for the time being, how to add checkExpressionBuilder on my own? I am ready to try to write the builder by myself but need a hint how/where to start not to spent useless time on investigation.
Want results from more Discord servers?
Add your server