Robin
Type errors after 0.27.1 upgrade
After upgrading to the lastest verision, I've got a couple of type errors that I'm not sure how to resolve. They are both the same kind of error, I have a custom WHERE IN expression:
Which gives me this error:
I assume I need to pass a type to sql.raw, but I haven't been able to figure out what that type should be.
15 replies
Arbitrary insert statement
I have a bit of an edge case where I want to build a query that is dynamic based on user input (it's part of an interactive tutorial). Is there a way to build an insert statement where the object name is an arbitrary string? Alternatively, is there some way to do this with sql framemgents, but still make the value a parameter? I'm imagining a
sql.parameter
function, but I don't see anything like that in the docs.6 replies
New type error in 0.26.3
I recently upgraded from 0.26.1 to 0.26.3 and I'm getting a type error trying to call a reusable expression builder that used to work.
They query I'm calling it from has a bunch of other tables joined, but it have
MzCatalogMzRoles as r
so I would expect this to work
The type error is pretty unfortunate, I can't make much sense of it. I've attached it to the post in case it is useful. Any suggestions appreciated!42 replies
How to use coalesce in a join
I'm selecting disparate object types, and then looking up details in per-type lookup tables, then I want to join on another table based on an ID in the type tables, so I need to coalesce the ID columns. Currently I'm just doing a cast to make it work:
Is there a better way to express this?
22 replies
Limit with a literal value
Hi folks, thanks for all your work on Kysely, it's great!
I'm wondering how I can add a limit clause with a literal value, rather than a parameter.
I have a strange use case, I'm querying a https://materialize.com/ database, which presents as postgres, but has different features. It also has some limitations, one of which is limit must be a literal value, not an expression or parameter.
I figured out I can do this
Which works, but it's a bit unwieldy. Is there a nice way to add extension methods to the query builder? The docs seem to discourage this, but I'm curious if there are any other ideas to make this nicer.
I would love to have an api like this:
7 replies