Registry / database / schemaless-sqlite

schemaless-sqlite

JSON →
library0.0.1jsnpmunverified

A TypeScript ORM for SQLite that eliminates schema definitions by automatically creating tables and columns on-the-fly. v0.0.1 is the current stable release. Key differentiators: zero-configuration dynamic schema, automatic UUID primary keys, managed timestamps (createdAt, updatedAt, deletedAt), soft delete, native boolean/Date/JSON type support, and runtime column management. Suitable for rapid prototyping and dynamic data shapes where traditional ORM migrations are overhead.

npm install schemaless-sqlite
INSTALL
IMPORT
SIG · SCHEMALESS-SQLITE
S
schemaless-sqlite
databasejavascriptv0.0.1
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.

SqliteOrm
✓ import { SqliteOrm } from 'schemaless-sqlite'
✗ import SqliteOrm from 'schemaless-sqlite'
Named export only; default export does not exist.

Demonstrates basic CRUD operations: create, find with filters, and database close.

import { SqliteOrm } from 'schemaless-sqlite'; const db = new SqliteOrm('test.db'); async function main() { // Create a record (table auto-created) const result = await db.create('users', { name: 'Alice', email: 'alice@example.com', age: 30, isActive: true, }); if (result.success && result.data) { console.log('Created user with ID:', result.data.id); console.log('Created at:', result.data.createdAt); } // Find active users const users = await db.find('users', { filter: { isActive: { eq: true } }, orderBy: { age: 'desc' }, limit: 10, }); console.log('Active users:', users.data); db.close(); } main().catch(console.error);
Debug
Known issues
gotchaThe ORM uses soft delete by default. The `delete()` method sets `deletedAt` instead of removing the row. Use `hardDelete()` for permanent removal if available.
fix
Call `db.hardDelete('table', id)` if you need to permanently remove a record. Check API documentation for method availability.
affects: >=0.0.0
gotchaFilter operators case sensitivity: operators are lowercase (eq, ne, gt, gte, lt, lte). Using uppercase may silently fail or throw an error.
fix
Use lowercase filter operators: `{ age: { gte: 18 } }` not `{ age: { GTE: 18 } }`.
affects: >=0.0.0
deprecatedThe `findOne` method returns `null` if no record found, but the return type may be `{ success: boolean; data?: Record }` in some versions – check your version.
fix
Always check `result.data` existence after calling `findOne`.
affects: >=0.0.0
gotchaColumn management methods like `renameColumn` or `deleteColumn` may not be documented in the README but exist in the TypeScript types. Using them incorrectly can corrupt schema.
fix
Review the full TypeScript definition file or source code for correct method signatures before using column management.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: db.create is not a function
Import error: using default import instead of named import.
fix
Change import to: `import { SqliteOrm } from 'schemaless-sqlite'`
Cannot find name 'SqliteOrm'
Missing or incorrect TypeScript configuration or module resolution.
fix
Ensure `npm install schemaless-sqlite` and TypeScript is configured with `"esModuleInterop": true` if needed. Check that package type declarations are properly resolved.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
better-sqlite3requiredRequired for synchronous SQLite database access
uuidrequiredUsed for generating UUID v4 primary keys
Agent activity
10 hits · last 30 days
node
6
Resources
schemaless-sqlite — npm install schemaless-sqlite · libregistry