is there a way to use custom functions without raw sql?

i'm using functions from a postgres extension. is there a way to use them in queries without baking in raw sql?
2 Replies
lilit
lilitOP4mo ago
db.insert(schema).values({name, structure: sql`custom_func(${structure}::cstring)`});
db.insert(schema).values({name, structure: sql`custom_func(${structure}::cstring)`});
oke
oke4mo ago
I don't think you can. Drizzle ORM does not have knowledge of this function and wouldn't be able to infer types or give you a JavaScript-equivalent function for it. Custom sql is not that bad tbh

Did you find this page helpful?