A lightweight write-only Node.js ORM supporting MSSQL, PostgreSQL, MySQL, Oracle, SQLite, and Web SQL. Version 3.8.1 is current. Sworm focuses on writing graphs of related entities while querying is done with raw SQL to avoid performance pitfalls like opaque query generation, N+1 queries, and complex relationship management. It provides a simple model API for defining tables and relationships, connects lazily, and supports both callback and promise patterns. It is a niche alternative to full-featured ORMs like Sequelize or TypeORM, emphasizing simplicity and database-agnostic write operations.
npm install swormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a sworm db instance, defining a model for the 'people' table, connecting to PostgreSQL, saving a record, and disconnecting.
Call db.connect() explicitly before performing any database operations to avoid unexpected connection timing.
Use raw SQL for queries: const rows = await db.query('SELECT * FROM people WHERE name = $1', ['Bob']);Ensure the table is created before attempting to insert records, or use migrations/schema scripts.
Run: npm install pg
Start PostgreSQL service or check host/port in config.
Use const db = sworm.db(); then db.model(...) or check if sworm is properly imported.
No dependency data recorded yet.