OpenRecord is an ActiveRecord-inspired ORM for Node.js that supports SQLite3, MySQL, PostgreSQL, Oracle, REST APIs, LDAP, and ActiveDirectory. The current stable version is 2.11.1, released infrequently with no fixed cadence. Key differentiators: automatic model definition from database schema, built-in GraphQL support, and a plugin system for extensibility. It uses a store-based architecture and supports async/await natively. Ships TypeScript definitions.
npm install openrecordNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows SQLite3 store initialization, finding a record by primary key, querying with a where clause, creating and saving a record, and deleting a record.
Ensure `autoLoad: true` is set in Store options if you want automatic schema reflection.
Wrap all model interactions inside `store.ready()` callback or after awaiting `store.ready()`.
Use `require('openrecord/store/sqlite3')` or equivalent store adapter.Ensure the database table has a primary key column, or use `.where()` to filter.
Use default import syntax.
Install the corresponding database driver: npm install better-sqlite3 (or mysql, pg, etc.).
Move store.Model calls inside store.ready() callback or after await store.ready().
Ensure the database has the expected table, or set autoLoad: true and ensure the table name matches the model name (case-sensitive).
Check if the record exists before accessing properties, e.g., if (post) { console.log(post.id); }.Use import syntax: import Store from 'openrecord/store/sqlite3';