Registry / database / bass-sql

bass-sql

JSON →
library0.0.29jsnpmunverified

SQL adapter for Bass.js, a JavaScript ODM (Object Document Mapper). Version 0.0.29 is the latest, with irregular releases. It provides a familiar ODM interface for SQL databases, supporting SQLite, PostgreSQL, MySQL, and MSSQL via a pluggable client. Unlike full ORMs like Sequelize or TypeORM, bass-sql keeps the ODM pattern minimal and schema-less, delegating query building to Bass.js and database connectivity to external npm packages such as sql.js, pg, mysql2, and tedious.

database
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.

The default export is the adapter factory function.

import adapter from 'bass-sql'

bass is a separate package.

import bass from 'bass'

Model class is from bass, not bass-sql.

import { Model } from 'bass'

Sets up a Bass.js ODM with an SQLite backend using bass-sql, defines a model, creates a record, and queries all records.

import bass from 'bass'; import adapter from 'bass-sql'; import sqlite from 'sql.js'; // Initialize Bass.js with SQL adapter const orm = bass({ local: adapter(sqlite) }); // Define a model const User = orm.model('users', { name: String, age: Number }); async function main() { await User.create({ name: 'John', age: 30 }); const users = await User.find(); console.log(users); } main().catch(console.error);
Debug
Known footguns
gotchabass-sql does not perform migrations; schema must be created manually or via other tools.
deprecatedSome older API patterns may be deprecated; check Bass.js changelog for compatibility.
gotchaSQLite driver (sql.js) is included by default; if using another database, you must install the corresponding driver package.
gotchabass-sql may have issues with complex joins or raw SQL; it is designed for simple ODM patterns.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
7 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources