kysely
kysely copied to clipboard
A type-safe typescript SQL query builder
It seems there is currently no way to create a constraint on an expression instead of a column name. ```ts await db.schema .createTable("foo") .addColumn("name", "text") .addUniqueConstraint("name_unique", ["lower(name)"]) .execute() ``` I...
I'm curious how feasible it is to have the typescript response types accurately reflect the correct types based on the order of `.selectAll('table')` statements. For example: ```typescript const rows =...
Hey 👋 Currently, if we use a plugin that transforms the query's results with `.withPlugin(plugin)`, the type system is unaware of the transformations and the output type is left unchanged....
Hi. I'm just wondering whether example 2 (playground link below) is expected behavior (known edge case, won't fix, etc) or if it's a bug. I skimmed through the codebase/issues but...
SQLite has `STRICT` as a table option : https://www.sqlite.org/stricttables.html Without `STRICT`: ```sql CREATE TABLE t1(a ANY); INSERT INTO t1 VALUES('000123'); SELECT typeof(a), quote(a) FROM t1; -- result: integer 123 ```...
add outer apply and cross apply. these are the rough mssql equivalent of left and inner lateral join [Using Apply](https://learn.microsoft.com/en-us/sql/t-sql/queries/from-transact-sql?view=sql-server-ver16#using-apply)
Greetings! I think this can be useful for the following reasons: 1. I speculate this is probably not too difficult to implement. 2. A similar helper for `$nonNull` already exists,...
Hey 👋 closes #1169. As of PostgreSQL 17, `MERGE` queries now have `returning` clause support. - [x] add `returning`/`returningAll` to `MERGE`. - [x] add `MultiTableReturningInterface`, enforce it across `DeleteQueryBuilder`, `UpdateQueryBuilder`...
Hey :wave: This PR revisits `ParseJSONResultsPlugin` and attempts to provide more fine-grained control to consumers. - `skipKeys` allows you to specify columns to not parse in a result object. -...
`CREATE TABLE newTableName LIKE templateTableName` allows creating the table with the same structure as an already existing one, and is especially useful when creating temporary tables. It is supported by...