From Mongoose to SQL: migrating MongoDB to PostgreSQL


Moving a Mongoose app to PostgreSQL usually means rewriting every query at once. With UQL you port them one at a time while still on MongoDB, and the switch leaves them as they are.


Moving a Mongoose app to PostgreSQL usually means rewriting every query at once. With UQL you port them one at a time while still on MongoDB, and the switch leaves them as they are.
Declare an entity as data, write columns as builders, and let the types follow. What changed in UQL 0.105, with an example for each.
In UQL 0.100.0, all and run are tags. The missing parentheses are what keep your values out of the SQL.


A lifecycle hook only runs on the ORM's own writes. A trigger runs on every write, and in UQL its body is checked by the compiler and rendered for each SQL engine.
I renamed a field, a foreign key and a relation with each ORM's own language server. Four of the six left stale names behind that still compile.
I resisted narrowing find results, because a narrowed row is no longer the entity. Then I upgraded every project I maintain and none of them needed the entity back.


UQL 0.3 ships native semantic search across PostgreSQL, MariaDB, SQLite, and MongoDB Atlas, with automatic index migration.


The annotation is now checked against the property it describes, which legacy decorators could never do. It cost three decorators, parameter injection, and NestJS compatibility.
Three ways I measured per-request allocation wrong before I got one I trusted, and why the result isn't the leak table it looks like.


Six ORMs, one full PostgreSQL lifecycle, timed per step. Prisma comes fifth of six, and one step is responsible for most of it.


npm i uql-orm installs one package and nothing else. Getting there meant deleting a 1.8 MB transpiler, a 264 KB metadata polyfill, and the sourcemaps nobody read.


Pure SQL generation speed across 6 TypeScript ORMs and query builders, measured with an open, reproducible benchmark.


What makes a perfect ORM? I evaluated the top 5 features every TypeScript ORM should have, and why the existing ones fall short.