{"id":43953,"library":"sql-super","title":"SQL Super","description":"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.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jaguarsiva/Sql-Super","tags":["javascript","sql","sql-super","sql super","postgres sql","mysql","pgsql"],"install":[{"cmd":"npm install sql-super","lang":"bash","label":"npm"},{"cmd":"yarn add sql-super","lang":"bash","label":"yarn"},{"cmd":"pnpm add sql-super","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL client library used internally for MySQL connections","package":"mysql2","optional":false},{"reason":"PostgreSQL client library used internally for pgSQL connections","package":"pg","optional":false}],"imports":[{"note":"Package uses CommonJS; no named exports. ESM import will fail without a wrapper.","wrong":"import sqlsuper from 'sql-super';","symbol":"default","correct":"const sqlsuper = require('sql-super');"}],"quickstart":{"code":"const sqlsuper = require('sql-super');\n\nasync function example() {\n  // MySQL connection\n  await sqlsuper.connectMySQL('localhost', 'root', 'password', 'testdb');\n  console.log('Connected to MySQL');\n\n  // Create a table\n  const createResult = await sqlsuper.createTable('users', 'id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), email VARCHAR(100)');\n  console.log('Table created:', createResult);\n\n  // Insert a row\n  const insertResult = await sqlsuper.insertOne('users', { name: 'John', email: 'john@example.com' });\n  console.log('Inserted id:', insertResult);\n\n  // Read data\n  const rows = await sqlsuper.read('users', ['id', 'name', 'email']);\n  console.log('Rows:', rows);\n\n  // Update a row\n  await sqlsuper.update('users', { name: 'Jane' }, 'id = 1');\n  console.log('Updated');\n\n  // Delete a row\n  await sqlsuper.delete('users', 'id = 1');\n  console.log('Deleted');\n\n  // Disconnect\n  await sqlsuper.disconnectMySQL();\n  console.log('Disconnected');\n}\n\nexample().catch(console.error);","lang":"javascript","description":"Demonstrates MySQL connection, table creation, CRUD operations, and disconnection using async/await."},"warnings":[{"fix":"Ensure the correct order: host, user, password, database.","message":"The package uses the parameter order (host, user, password, database) for MySQL, which may differ from other libraries like mysql2.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If using TypeScript, create a declaration file or use a different library with TS support.","message":"The package does not support TypeScript. There are no type definitions, so TypeScript projects will need to use @types or declare modules.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Stick to promise-based usage with async/await for consistency.","message":"Connection methods return a promise but the library also supports callbacks. Mixing both patterns may lead to confusion.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always pass condition strings as SQL fragments, e.g., \"column = value\".","message":"The update and delete methods take a condition string without a WHERE keyword; the condition must be properly formatted (e.g., 'id = 1').","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Sanitize all inputs manually or consider using a library with prepared statements for production use.","message":"The package does not support parameterized queries, making it vulnerable to SQL injection if user input is passed directly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'abstract':55 'advanc':66 'api':14 'away':56 'base':37 'basic':17 'beginn':78 'callback':36 'callback-bas':35 'common':60 'connect':40,70 'crud':19 'databas':25,43,84 'delet':51 'disconnect':41 'featur':68 'insert':47 'intend':76 'interact':85 'javascript':7,86 'lack':63 'librari':8 'listing/creating/dropping':42 'method':38 'mysql':22,73,95 'need':82 'offer':32 'oper':20 'packag':54 'perform':16 'pgsql':96 'pool':71 'postgr':93 'postgresql':24 'project':81 'promis':33 'provid':11 'queri':30,67 'quick':83 'raw':28 'read':48 'row':52 'simplifi':13 'small':80 'sql':1,3,18,29,57,87,89,91,94 'sql-super':88 'super':2,4,90,92 'support':65 'syntax':58 'tabl':45 'task':61 'typescript':64 'updat':49 'v3.0.1':9 'without':26 'write':27","created_at":"2026-06-05T17:02:16.781836+00:00","updated_at":"2026-06-05T17:02:16.781836+00:00","problems":[{"fix":"Run 'npm install mysql2' in your project.","cause":"Missing peer dependency 'mysql2' when using MySQL functions.","error":"Error: Cannot find module 'mysql2'"},{"fix":"Run 'npm install pg' in your project.","cause":"Missing peer dependency 'pg' when using pgSQL functions.","error":"Error: Cannot find module 'pg'"},{"fix":"Use 'const sqlsuper = require('sql-super');' instead of 'import sqlsuper from 'sql-super';'.","cause":"Improper import (e.g., using ES6 import instead of require).","error":"TypeError: sqlsuper.connectMySQL is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jaguarsiva/Sql-Super#readme","github":"https://github.com/jaguarsiva/Sql-Super","docs":null,"changelog":null,"pypi":null,"npm":"sql-super","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}