Show HN: Kysely, a type-safe SQL query builder for TypeScript
11–20 of 65 posts
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#12Earlier quoted context omitted.
If you use it with kysely-codegen, it generates the types from your DB schema, guaranteeing they match. And the strings are verified at compile time - you can’t typo a table name, field name, etc., it won’t compile. Plus, from an ergonomics POV, it integrates very well with auto-complete. It’s very typesafe IMO, more so than most libs that interact with the the DB, where you hand-define the schemas and can more easil…
I didn't go deep into the docs, but the 'movie' on the homepage clearly shows string-based field name mappings so I instantly saw that as a red flag... Nice to know it's implemented better though.
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#13Earlier quoted context omitted.
If you use it with kysely-codegen, it generates the types from your DB schema, guaranteeing they match. And the strings are verified at compile time - you can’t typo a table name, field name, etc., it won’t compile. Plus, from an ergonomics POV, it integrates very well with auto-complete. It’s very typesafe IMO, more so than most libs that interact with the the DB, where you hand-define the schemas and can more easil…
I didn't go deep into the docs, but the 'movie' on the homepage clearly shows string-based field name mappings so I instantly saw that as a red flag... Nice to know it's implemented better though.
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#14Earlier quoted context omitted.
If you use it with kysely-codegen, it generates the types from your DB schema, guaranteeing they match. And the strings are verified at compile time - you can’t typo a table name, field name, etc., it won’t compile. Plus, from an ergonomics POV, it integrates very well with auto-complete. It’s very typesafe IMO, more so than most libs that interact with the the DB, where you hand-define the schemas and can more easil…
I didn't go deep into the docs, but the 'movie' on the homepage clearly shows string-based field name mappings so I instantly saw that as a red flag... Nice to know it's implemented better though.
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#15This is only partially type-safe. Having a few SQL keywords abstracted into methods doesn't deliver a lot of value. I've found some value in type-safe mappings between database fields and language fields, at least you can directly see the problems in your code if some entity class has been changed. String-based field references will only fail at runtime so you need 100% unit tests to refactor with confidence.
If you use it with kysely-codegen, it generates the types from your DB schema, guaranteeing they match. And the strings are verified at compile time - you can’t typo a table name, field name, etc., it won’t compile. Plus, from an ergonomics POV, it integrates very well with auto-complete. It’s very typesafe IMO, more so than most libs that interact with the the DB, where you hand-define the schemas and can more easil…
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#16Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#17Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#18Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#19See now this is what I thought that "Selectric Typeballs" post [1] was going to be. I think it would make for a better name than "Kysely" if I'm being honest. [1] https://news.ycombinator.com/item?id=36406352
Re: Show HN: Kysely, a type-safe SQL query builder for TypeScript
#20I guess I still prefer that to a full on ORM, but that's really the one missing feature I want from these SQL query builder libraries