{"id":42930,"library":"jssql","title":"JSSQL","description":"A simple JavaScript MySQL library for Node.js that provides an object-oriented API to perform CRUD operations without writing raw SQL. Version 1.5.12 is the latest stable release with low release cadence (last updated years ago). Differentiates by using Scheme/Table classes with structure constants for type safety, pool connection support, and optional read-only replica configuration. Suitable for small projects or prototypes but lacks modern features like promises, TypeScript types, or migration management.","status":"maintenance","version":"1.5.12","language":"javascript","source_language":"en","source_url":"https://github.com/avery246813579/JSSQL","tags":["javascript","sql","mysql"],"install":[{"cmd":"npm install jssql","lang":"bash","label":"npm"},{"cmd":"yarn add jssql","lang":"bash","label":"yarn"},{"cmd":"pnpm add jssql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying MySQL driver","package":"mysql","optional":false}],"imports":[{"note":"Package uses CommonJS; ESM import not supported.","wrong":"import { Database } from 'jssql';","symbol":"Database","correct":"const { Database } = require('jssql');"},{"note":"Destructuring is preferred for clarity.","wrong":"const Scheme = require('jssql').Scheme;","symbol":"Scheme","correct":"const { Scheme } = require('jssql');"},{"note":"Old-style assignment works but destructuring is cleaner.","wrong":"var jssql = require('jssql'); var Table = jssql.Table;","symbol":"Table","correct":"const { Table } = require('jssql');"}],"quickstart":{"code":"const { Database, Scheme, Table, Structure } = require('jssql');\nconst db = new Database({\n  host: process.env.DB_HOST ?? '127.0.0.1',\n  user: process.env.DB_USER ?? 'root',\n  password: process.env.DB_PASS ?? '',\n  database: 'TEST_DATABASE',\n  connectionLimit: 10\n});\nconst scheme = new Scheme({\n  ID: { type: Structure.Type.INT, AI: true, Index: Structure.Index.PRIMARY },\n  NAME: { type: 'VARCHAR', length: 100 }\n});\nconst table = new Table('users', scheme);\ndb.table(table);\ntable.save({ NAME: 'Alice' }, (err) => {\n  if (err) throw err;\n  table.findOne({ NAME: 'Alice' }, (err, row) => {\n    if (err) throw err;\n    console.log(row);\n  });\n});","lang":"javascript","description":"Initializes a MySQL database using JSSQL with connection pooling, creates a table scheme, and performs an insert followed by a findOne query."},"warnings":[{"fix":"Use a callback or setTimeout before calling find after save, or consider using a different library with promise support.","message":"After calling save(), the row may not be immediately available for find queries. A small timing window exists.","severity":"gotcha","affected_versions":"*"},{"fix":"Wrap callbacks in promises manually or migrate to a modern MySQL library like mysql2 or knex.","message":"Package has not been updated in several years; uses callback-style APIs with no Promise support.","severity":"deprecated","affected_versions":"*"},{"fix":"Audit your dependency tree and consider replacing jssql to avoid supply chain risks.","message":"The 'mysql' driver version is pinned and may have known vulnerabilities. No active maintenance for security patches.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'1.5.12':25 'ago':38 'api':15 'cadenc':34 'class':43 'configur':59 'connect':51 'constant':46 'crud':18 'differenti':39 'featur':69 'javascript':4,77 'jssql':1 'lack':67 'last':35 'latest':28 'librari':6 'like':70 'low':32 'manag':76 'migrat':75 'modern':68 'mysql':5,79 'node.js':8 'object':13 'object-ori':12 'oper':19 'option':54 'orient':14 'perform':17 'pool':50 'project':63 'promis':71 'prototyp':65 'provid':10 'raw':22 'read':56 'read-on':55 'releas':30,33 'replica':58 'safeti':49 'scheme/table':42 'simpl':3 'small':62 'sql':23,78 'stabl':29 'structur':45 'suitabl':60 'support':52 'type':48,73 'typescript':72 'updat':36 'use':41 'version':24 'without':20 'write':21 'year':37","created_at":"2026-06-05T16:57:21.155401+00:00","updated_at":"2026-06-05T16:57:21.155401+00:00","problems":[{"fix":"Run 'npm install jssql' in your project directory.","cause":"Package not installed","error":"Cannot find module 'jssql'"},{"fix":"Use 'const { Database } = require('jssql');' instead of 'const Database = require('jssql');'","cause":"Wrong import style: default import vs named import","error":"TypeError: Database is not a constructor"},{"fix":"Check your host, user, password, and database name in the Database constructor.","cause":"Invalid database credentials","error":"Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'"}],"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/avery246813579/JSSQL#readme","github":"https://github.com/avery246813579/JSSQL","docs":null,"changelog":null,"pypi":null,"npm":"jssql","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}}