3 ms·
Also check out https://jawj.github.io/zapatos/ https://jawj.github.io/zapatos/ which has a similar non-ORM yet fully typesafe approach.
by skrebbel 4y ago
Also check out https://jawj.github.io/zapatos/ https://jawj.github.io/zapatos/ which has a similar non-ORM yet fully typesafe approach.
- CuriouslyC 4y agoNotably, in Zapatos you write SQL, whereas with this you use a query builder. Personally I think staying close to SQL is a feature, but YMMV.
- gmac 4y agoYes — though there are also shortcut functions for basic CRUD (and also for lateral joins) which give you automatic typing.
- lf-non 4y agoI started using zapatos in a project but eventually moved away from it. Their shortcuts and lateral join support is nice, but you very often need to write raw sql and manually provide types and ensure they are correct for all these cases. It is also possible but awkward to use interpolations to construct very dynamic queries where based on filter conditions you need different joins or unions etc. I looked at some of the solutions that infer ts types from sql queries but eventually felt it was more maintenable to keep the dynamic query generation on the ts ide I found ts-sql-query [1] to be much better suited for my use cases. It is very feature rich and has very good support for various dialect specific features in all mainstream databases. Also Juan (the author) is very helpful with queries and suggestions. [1] https://ts-sql-query.readthedocs.io/en/stable/ https://ts-sql-query.readthedocs.io/en/stable/