Registry / database / sutando

sutando

JSON →
library1.7.4jsnpmunverified

Sutando is a modern Node.js ORM (v1.7.4, stable) supporting MySQL, MariaDB, SQLite, PostgreSQL, and MSSQL. It follows an Active Record pattern similar to Laravel's Eloquent, making database interactions intuitive. Active development with frequent releases. Key differentiators: fluent query builder, migrations, seeders, model relationships, and full TypeScript support. Designed for Node.js 14+ and pnpm.

npm install sutando
INSTALL
IMPORT
SIG · SUTANDO
S
sutando
databasejavascriptv1.7.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sutando
import { Sutando } from 'sutando'
const sutando = require('sutando')
ESM-only since v1.0. Sutando is a named export (capital S).
Model
import { Model } from 'sutando'
import Model from 'sutando'
Model is a named export, not default.
sutando
import sutando from 'sutando'
import { sutando } from 'sutando'
The default export is the Sutando instance (lowercase s). But most users prefer named imports.

Shows basic setup with SQLite: configure knex connection, define a model, create and query records.

import { Sutando, Model } from 'sutando'; import knex from 'knex'; const db = knex({ client: 'sqlite3', connection: { filename: ':memory:' }, useNullAsDefault: true, }); Sutando.instance.useKnex(db); class User extends Model { get table() { return 'users'; } } await User.create({ name: 'Test', email: 'test@example.com' }); const users = await User.query().where('name', 'Test').get(); console.log(users); await db.destroy();
Debug
Known issues
breakingSutando v1.0 switched from CommonJS to ESM. require() will not work.
fix
Use ES import syntax and set "type": "module" in package.json, or use dynamic import() if needed.
affects: >=1.0
gotchaModel properties (table, timestamps, etc.) must be getters, not simple class properties.
fix
Use `get table() { return 'users'; }` instead of `table = 'users'`.
affects: >=1.0
gotchaKnex must be installed separately and passed to Sutando via useKnex(). Not automatically included.
fix
npm install knex and then import knex from 'knex' and use Sutando.instance.useKnex(knex({...})).
affects: >=1.0
deprecatedSome query builder methods from earlier betas were renamed in v1.0 (e.g., 'fetch' to 'get').
fix
Check the v1.0 migration guide and use current API (e.g., .get() instead of .fetch()).
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'sutando'
Using require() in an ESM context or missing package install.
fix
Ensure sutando is installed (npm install sutando) and use import syntax. If required, use dynamic import.
ReferenceError: sutando is not defined
Trying to access the default export as 'sutando' without importing it correctly.
fix
Use `import sutando from 'sutando'` for the default instance, or use named exports like `import { Sutando } from 'sutando'`.
TypeError: User.create is not a function
Model class defined with standard class property instead of getter for table.
fix
Define `get table() { return 'users'; }` inside the User class.
Upgrade
Version history
1.7.4latest on npm
Audit
Dependencies
knexrequiredSQL query builder and database connection pool
Agent activity
16 hits · last 30 days
node
12
Meta
2
OpenAI (training)
1
Resources
sutando — npm install sutando · libregistry