Igal
Igal
Explore posts from servers
KKysely
Created by TheMelonAssassin on 9/10/2024 in #help
Making CTE's reusable
Hey 👋 There isn't a "kysely way" to do this.
4 replies
KKysely
Created by SneakOnYou on 9/8/2024 in #help
Unable to use table name with 3 dots in selectFrom
Hey 👋 Check this issue out - https://github.com/kysely-org/kysely/issues/875
5 replies
KKysely
Created by WhyDoThis on 9/5/2024 in #help
Updateable primary key question & .set() type safety
Updates are always a partial object, by design.
13 replies
KKysely
Created by WhyDoThis on 9/5/2024 in #help
Updateable primary key question & .set() type safety
Non-nullable columns, T or ColumnType<?, T, ?> are always required in inserts.
13 replies
KKysely
Created by WhyDoThis on 9/5/2024 in #help
Updateable primary key question & .set() type safety
Hey 👋 To define a column that's never updated, you can use ColumnType with never in the 3rd generic value.
col: ColumnType<SelectType, InsertType, never>
col: ColumnType<SelectType, InsertType, never>
To define a column that's never inserted nor updated, you can use GeneratedAlways
col: GeneratedAlways<SelectType>
col: GeneratedAlways<SelectType>
To prevent an item from being accepted in .set of an update query, you can use the satisfies keyword with Updateable<MyTable> as follows:
item satisfies Updateable<MyTable>
item satisfies Updateable<MyTable>
This'll compile-time error on any non-updateable columns.
13 replies
KKysely
Created by TheMelonAssassin on 8/13/2024 in #help
Issue with migrating from knex
Hey 👋 Have you tried passing this to an LLM?
5 replies