Registry / database / sql-soar

sql-soar

JSON →
library1.3.7jsnpmunverified

SQL-SOAR (Simple Object Adapter for Relational database) is a lightweight Node.js module that simplifies SQL query construction and database access. It provides a reusable SQL expression system and allows developers to dynamically build WHERE clauses using JavaScript objects. Version 1.3.7 is the latest stable release, maintained on GitHub. Unlike full ORMs like Sequelize or TypeORM, SOAR gives developers full control over SQL generation while removing boilerplate. It supports MySQL, connection pooling, and multiple database access. The library is ESM-incompatible (CommonJS only) and requires mysql driver as a peer dependency. Release cadence is irregular, with minor updates since 2018.

npm install sql-soar
INSTALL
IMPORT
SIG · SQL-SOAR
S
sql-soar
databasejavascriptv1.3.7
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.

default
const soar = require('sql-soar')
import soar from 'sql-soar'
Package uses CommonJS; ESM import will fail. Use require() in Node.js.
soar.config
soar.config(options)
soar.configure(options) or soar.setup(options)
Method is exactly 'config', not 'configure'.
soar.list
soar.list('table', {field: value}, callback)
soar.list('table', {field: value}).then(callback)
Uses callbacks, not promises. No promisified version available.

Configures SOAR with MySQL connection, performs list, query, and update operations with callback handling.

const soar = require('sql-soar'); const options = { dbConfig: { host: '127.0.0.1', database: 'soar', user: 'your_db_acc_name', password: 'your_db_passwd', connectionLimit: 32 } }; soar.config(options); soar.list('Person', { age: 25 }, function(err, list) { if (err) { console.error(err.stack); } else { console.log('People with age 25:', JSON.stringify(list)); } }); soar.query('Person', { name: 'David Lynch' }, function(err, data) { if (err) { console.error(err.stack); } else { console.log('About David:', JSON.stringify(data)); } }); soar.update('Person', { weight: 160 }, { id: 28 }, function(err, result) { if (err) { console.error(err.stack); } else { console.log('Update result:', result); } });
Debug
Known issues
breakingPackage is CommonJS-only; ESM imports will throw an error.
fix
Use require('sql-soar') instead of import.
affects: >=1.0.0
deprecatedCallbacks are used throughout; no promise or async/await support.
fix
Wrap in a promise or use util.promisify manually.
affects: >=1.0.0
gotchaConfig must be called before any query; otherwise runtime error occurs.
fix
Always call soar.config(options) at application startup.
affects: >=1.0.0
gotchaTable names and column names are case-sensitive depending on the MySQL server setting.
fix
Use consistent casing matching your database schema.
affects: >=1.0.0
gotchaConnection pool is created once; reconfiguring options later may not affect existing pool.
fix
Configure once at startup; avoid reconfiguring.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'sql-soar'
Package not installed or missing dependency.
fix
Run npm install sql-soar mysql --save
soar.config is not a function
Using ESM import instead of require.
fix
Replace 'import soar from "sql-soar"' with 'const soar = require("sql-soar")'
ER_ACCESS_DENIED_ERROR: Access denied for user
Invalid database credentials or missing user privileges.
fix
Verify dbConfig.host, user, password, and database; grant necessary privileges.
Upgrade
Version history
1.3.7latest on npm
Audit
Dependencies
mysqlrequiredRequired peer dependency for database connectivity
Agent activity
11 hits · last 30 days
node
8
Meta
1
OpenAI (training)
1
Resources
sql-soar — npm install sql-soar · libregistry