News for hackers. Stuff that matters.
Re:Flyweight: An ORM for SQLite by unemployable on Thursday September 29, 2022 @08:16AM (#33019501)
Flyweight parses SQL statements to generate a TypeScript API, uses convention to automatically map SQL into hierarchical data structures, and combines this with a simple CRUD API.
Re:Flyweight: An ORM for SQLite by freeqaz on Thursday September 29, 2022 @10:34AM (#33021249)
That's pretty great because getting types with SQL is a massive pain in the rear! I have looked at some other libraries in the past but they all tend to use a build step to generate their types.
Re:Flyweight: An ORM for SQLite by lf-non on Thursday September 29, 2022 @10:54AM (#33021580)
So does this tool. There is a code-generation step for ts types.

When the types are coming from an external source that may or may not be available at compile time, I can't think of any way to prevent codegen and also retain type-safety. Some additional integration with build system will be needed.

Re:Flyweight: An ORM for SQLite by unemployable on Saturday October 01, 2022 @11:57PM (#33052689)
When you want to update the types, you have to run something to update the one file that contains the types (or put it in watch mode to do it automatically). You don't necessarily have to update the types straight away though as I use proxies to make everything dynamic.

The other tools I have seen that try to figure out SQL types do not accurately create types for things like left joins.