SQL Super is a JavaScript library (v3.0.1) that provides a simplified API for performing basic SQL CRUD operations on MySQL and PostgreSQL databases without writing raw SQL queries. It offers promise- and callback-based methods for connecting, disconnecting, listing/creating/dropping databases and tables, and inserting, reading, updating, and deleting rows. The package abstracts away SQL syntax for common tasks but lacks TypeScript support, advanced querying features, or connection pooling (for MySQL). It is intended for beginners or small projects needing quick database interactions.
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.
Package uses CommonJS; no named exports. ESM import will fail without a wrapper.
const sqlsuper = require('sql-super');
Demonstrates MySQL connection, table creation, CRUD operations, and disconnection using async/await.
const sqlsuper = require('sql-super');
async function example() {
// MySQL connection
await sqlsuper.connectMySQL('localhost', 'root', 'password', 'testdb');
console.log('Connected to MySQL');
// Create a table
const createResult = await sqlsuper.createTable('users', 'id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), email VARCHAR(100)');
console.log('Table created:', createResult);
// Insert a row
const insertResult = await sqlsuper.insertOne('users', { name: 'John', email: 'john@example.com' });
console.log('Inserted id:', insertResult);
// Read data
const rows = await sqlsuper.read('users', ['id', 'name', 'email']);
console.log('Rows:', rows);
// Update a row
await sqlsuper.update('users', { name: 'Jane' }, 'id = 1');
console.log('Updated');
// Delete a row
await sqlsuper.delete('users', 'id = 1');
console.log('Deleted');
// Disconnect
await sqlsuper.disconnectMySQL();
console.log('Disconnected');
}
example().catch(console.error);
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.