UQL v0.8.0+: Define Entities without Decorators!
just dropped v0.8.0 of UQL, with one of the most requested features: Decorator-Free Entity Definitions. So not everyone wants (or can) use experimentalDecorators in their tsconfig.json. This is common in certain edge runtimes, specific build pipelines, or simply for developers who prefer a more functional or imperative style.
With the new defineEntity API, you can now register your database entities entirely through code. This new approach is 100% compatible with envs where decorators are disabled or unsupported.
Check out the new syntax:
import { defineEntity } from 'uql-orm';
// No decorators, no tsconfig magic required!
class User {}
defineEntity(User, {
name: 'users',
fields: {
id: { type: 'uuid', isId: true },
name: { type: String },
email: { type: String },
},
indexes: [
{ columns: ['name'] },
{ columns: ['email'], unique: true },
],
});
