Litdb – type safe SQL for JavaScript/TS
1–10 of 70 posts
Re: Litdb – type safe SQL for JavaScript/TS
#2I was expecting something more like sqlx, which I believe provides compile-time checking for SQL queries without a DSL, but for Rust
Re: Litdb – type safe SQL for JavaScript/TS
#3Re: Litdb – type safe SQL for JavaScript/TS
#4Re: Litdb – type safe SQL for JavaScript/TS
#5If the problem is seen as an editor or build-time problem, rather than a library one, you don't have to learn anything new, and you can save the weight in your dependencies.
A fusion of ts-safeql [0] and postgres_lsp [1] is the closest I've seen to solving this as an editor/build problem.
Re: Litdb – type safe SQL for JavaScript/TS
#6Re: Litdb – type safe SQL for JavaScript/TS
#7I'm really curious to see new DX for the problem of "type-safe queries with intellisense". Litdb provides SQL-like syntax, but it feels like knowing actual SQL should be enough. If the problem is seen as an editor or build-time problem, rather than a library one, you don't have to learn anything new, and you can save the weight in your dependencies. A fusion of ts-safeql [0] and postgres_lsp [1] is the closest I've s…
You can find it here: https://github.com/nikeee/sequelts
Re: Litdb – type safe SQL for JavaScript/TS
#8Seems very similar to [drizzle]( https://orm.drizzle.team/ ) - although drizzle is a more mature product.
Drizzle also uses its own custom query language e.g.
.where(eq(countries.id, 10))
Whereas litdb lets you use the full expressiveness of SQL but ensures all references are typed: .where(c => $`${c.id} = 10`)
[1] https://orm.drizzle.team/docs/overviewRe: Litdb – type safe SQL for JavaScript/TS
#9I don't really know enough about Kysely yet to make an informed opinion between those two. If you know more than me, can you give me your take??
Edit: Hmmm perhaps based on the primary author's other repos (https://github.com/mythz) it looks like they're a fan of C#. Perhaps it's the LINQ-like syntax that separates them the most.
Re: Litdb – type safe SQL for JavaScript/TS
#10I'm sure a lot of effort went into this, but I would rather raw dog my database layer with node-postgres/postgres.js and zod. The decorator heavy implementation is visually very busy. Also, I would not consider any SQL toolkit for serious use unless it comes with a sufficiently competent code generation accompaniment.