Registry / database / sails-sql

sails-sql

JSON →
library0.1.0-6jsnpmunverified

An experimental SQL database adapter for Sails.js / Waterline ORM that attempts to unify multiple SQL dialects (MySQL, PostgreSQL, Microsoft SQL Server, Oracle, SQLite) under a single adapter interface. Version 0.1.0-6 (pre-1.0) targets Node >=8 and is explicitly marked as 'DO NOT USE IN PRODUCTION' with a planned stable release in 2019. The project appears abandoned as of 2025 with no stable release. Unlike the legacy per-database adapters (sails-mysql, sails-postgresql), this adapter uses knex internally for dialect abstraction. PostgreSQL support was listed as 'under construction' and never completed. Key differentiator: single adapter for multiple SQL databases, but at the cost of instability and incomplete feature parity.

npm install sails-sql
INSTALL
IMPORT
SIG · SAILS-SQL
S
sails-sql
databasejavascriptv0.1.0-6
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 export
const sailsSql = require('sails-sql');
import sailsSql from 'sails-sql';
Package does not ship ESM; requires CommonJS. TypeScript definitions not provided.
adapter object
const { adapter } = require('sails-sql');
const adapter = require('sails-sql').default;
Module exports an object with `adapter` property for use in Sails config.
Waterline adapter registration
// config/datastores.js module.exports = { default: { adapter: require('sails-sql').adapter, url: 'mysql://user:pass@localhost/db' } };
Adapter must be registered as a datastore in Sails config, not imported directly.

Shows basic setup of sails-sql adapter in a Sails.js app with MySQL, defining a model and creating a record.

// 1. Install: npm install sails-sql // 2. In config/datastores.js: module.exports.datastores = { default: { adapter: require('sails-sql').adapter, url: process.env.SQL_URL || 'mysql://root:@localhost/sails_test' } }; // 3. Define a model (api/models/User.js): module.exports = { attributes: { name: { type: 'string', required: true }, email: { type: 'string', unique: true } } }; // 4. Use in controller: module.exports = { create: async function(req, res) { try { const user = await User.create({ name: 'John', email: 'john@example.com' }).fetch(); return res.json(user); } catch (err) { return res.serverError(err); } } };
Debug
Known issues
breakingPackage is pre-1.0 and explicitly warns 'DO NOT USE IN PRODUCTION'. API is unstable.
fix
Use stable legacy adapters (sails-mysql, sails-postgresql) for production.
affects: >=0.1.0-0
deprecatedProject appears abandoned (no commits since 2018, no stable release). PostgreSQL support never finished.
fix
Consider using sails-mysql, sails-postgresql, or migrate to a different ORM like Sequelize or Knex.
affects: >=0.1.0-0
gotchaAdapter requires Sails.js >=1.0 and Waterline >=0.13. Ensure compatible versions.
fix
Check Sails version with `sails --version` and upgrade if needed.
affects: >=0.1.0-0
gotchaThe `url` connection string format may differ per dialect (e.g., MSSQL uses `mssql://`). Incorrect strings cause silent failures.
fix
Consult Sails documentation for proper connection URL format for each database.
affects: >=0.1.0-0
Errors
Common errors & fixes
Error: `require(...).adapter` is undefined
Package not installed or incorrect import path
fix
Run `npm install sails-sql --save` and use `require('sails-sql').adapter`.
Error: registerAdapter failed: ... is not a function
Adapter object missing required Waterline methods
fix
Ensure you are using the correct adapter from this package. If using a newer Sails version, this adapter may be incompatible.
Error: No SQL dialect specified
Connection URL missing or not recognized
fix
Set a valid connection URL in config/datastores.js, e.g., `url: 'mysql://user:pass@localhost/mydb'`.
Upgrade
Version history
0.1.0-6latest on npm
Audit
Dependencies
sailsrequiredSails framework required; this is a Sails/Waterline adapter
waterlinerequiredWaterline ORM dependency for adapter interface
Agent activity
8 hits · last 30 days
node
6
Meta
2
Resources
sails-sql — npm install sails-sql · libregistry