{"id":41577,"library":"nexorm","title":"NexORM","description":"A powerful TypeScript ORM that supports SQLite, PostgreSQL, and MySQL via drivers like better-sqlite3, pg, and tedious. Version 2.0.5 is the latest stable release, with active development and monthly releases. Key differentiators include a simple, type-safe API with automatic migration generation, support for eager and lazy loading, and a lightweight footprint compared to heavier ORMs like Sequelize or TypeORM.","status":"active","version":"2.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/Bes-js/nexorm","tags":["javascript","orm","database","db","sql","sqlite","sqlite3","better-sqlite3","postgres","typescript"],"install":[{"cmd":"npm install nexorm","lang":"bash","label":"npm"},{"cmd":"yarn add nexorm","lang":"bash","label":"yarn"},{"cmd":"pnpm add nexorm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Driver for SQLite support","package":"better-sqlite3","optional":true},{"reason":"Driver for PostgreSQL support","package":"pg","optional":true},{"reason":"Driver for MySQL/MSSQL support","package":"tedious","optional":true}],"imports":[{"note":"Named export only; default import will fail.","wrong":"import NexORM from 'nexorm'","symbol":"NexORM","correct":"import { NexORM } from 'nexorm'"},{"note":"Model is exported from the main package, not a subpath.","wrong":"import { Model } from 'nexorm/models'","symbol":"Model","correct":"import { Model } from 'nexorm'"},{"note":"CJS require works but TypeScript prefers ESM import.","wrong":"const QueryBuilder = require('nexorm').QueryBuilder","symbol":"QueryBuilder","correct":"import { QueryBuilder } from 'nexorm'"},{"note":"Schema is available since v2.0.0; deprecated in v1.x as 'Migration'.","symbol":"Schema","correct":"import { Schema } from 'nexorm'"}],"quickstart":{"code":"import { NexORM, Model, Schema } from 'nexorm';\n\nconst db = new NexORM({\n  client: 'sqlite',\n  connection: { filename: './test.db' }\n});\n\nclass User extends Model {\n  static schema = new Schema({\n    id: { type: 'integer', primary: true },\n    name: { type: 'string' },\n    email: { type: 'string', unique: true }\n  });\n}\n\nawait db.connect();\nawait db.migrate();\n\nconst user = await User.create({ name: 'Alice', email: 'alice@example.com' });\nconsole.log(user.name); // 'Alice'\nawait db.close();","lang":"typescript","description":"Shows how to define a model with schema, connect to SQLite, run migrations, and create a record."},"warnings":[{"fix":"Update code that awaited create() with .then() pattern; use await directly.","message":"v2.0.0 changed the API from v1.x: 'Model.create' now returns the created instance instead of a promise resolving to the instance.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Replace 'Migration' with 'Schema' in imports and usage.","message":"The 'Migration' class was renamed to 'Schema' in v2.0.0.","severity":"deprecated","affected_versions":">=1.0.0 <2.0.0"},{"fix":"Ensure build tools are present; or use optional dependency flags.","message":"SQLite driver (better-sqlite3) is required even if using PostgreSQL; NexORM downloads it as a dependency but it may cause native build issues on some platforms.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use PostgreSQL or SQLite for now, or manually patch drivers.","message":"When using MySQL, the driver 'tedious' may not be compatible with newer MySQL versions; prefer 'mysql2' but NexORM does not support it natively.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Replace raw() calls with QueryBuilder.executeRaw().","message":"The 'raw' query method is marked for removal in v3.0.0; use QueryBuilder.executeRaw() instead.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.0.5':22 'activ':29 'api':42 'automat':44 'better':16,73 'better-sqlite3':15,72 'compar':57 'databas':67 'db':68 'develop':30 'differenti':35 'driver':13 'eager':49 'footprint':56 'generat':46 'heavier':59 'includ':36 'javascript':65 'key':34 'latest':25 'lazi':51 'lightweight':55 'like':14,61 'load':52 'migrat':45 'month':32 'mysql':11 'nexorm':1 'orm':5,60,66 'pg':18 'postgr':75 'postgresql':9 'power':3 'releas':27,33 'safe':41 'sequel':62 'simpl':38 'sql':69 'sqlite':8,70 'sqlite3':17,71,74 'stabl':26 'support':7,47 'tedious':20 'type':40 'type-saf':39 'typeorm':64 'typescript':4,76 'version':21 'via':12","created_at":"2026-06-04T18:53:05.036153+00:00","updated_at":"2026-06-04T18:53:05.036153+00:00","problems":[{"fix":"Run 'npm install better-sqlite3' manually, or switch to a different database.","cause":"Optional dependency not installed on the user's system.","error":"Cannot find module 'better-sqlite3'"},{"fix":"Use 'import { NexORM } from 'nexorm'' instead of default import.","cause":"Default import used instead of named import.","error":"TypeError: NexORM is not a constructor"},{"fix":"Check host, port, and credentials; ensure PostgreSQL is running and accessible.","cause":"Connection configuration incorrect or database service not running.","error":"ECONNREFUSED connection to PostgreSQL"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://fivesobes.gitbook.io/nexorm","github":"https://github.com/Bes-js/nexorm","docs":null,"changelog":null,"pypi":null,"npm":"nexorm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}