{"id":43430,"library":"node-fast-sql","title":"node-fast-sql","description":"A MySQL query builder for Node.js that automatically introspects database schema on connection, providing chainable table, column, and row operations for SELECT, INSERT, UPDATE, DELETE. Version 1.0.16 is stable but rarely updated. Unlike knex or Sequelize, it requires an active MySQL connection and relies on schema reflection, making it lightweight but tightly coupled to a single database. Suitable for quick scripts but lacks migration, pooling, or type safety. Use with caution in production.","status":"active","version":"1.0.16","language":"javascript","source_language":"en","source_url":"https://github.com/85785-EGM/fast-sql","tags":["javascript","node","mysql","js"],"install":[{"cmd":"npm install node-fast-sql","lang":"bash","label":"npm"},{"cmd":"yarn add node-fast-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-fast-sql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL driver used internally; must be installed separately","package":"mysql","optional":false}],"imports":[{"note":"Package uses CommonJS; no default export for ESM.","wrong":"import Mysql from 'node-fast-sql' // not ESM, use require","symbol":"default","correct":"const Mysql = require('node-fast-sql')"},{"note":"Import the constructor directly from require.","wrong":"const { Mysql } = require('node-fast-sql') // incorrect, default is a constructor","symbol":"Mysql","correct":"const Mysql = require('node-fast-sql')"},{"note":"Requires MySQL config object; constructor does not accept a callback.","wrong":"new Mysql(config, callback) // no callback; use async/await","symbol":"new Mysql(config)","correct":"new Mysql({ host, user, password, database, port })"}],"quickstart":{"code":"const Mysql = require('node-fast-sql');\nconst config = {\n  host: 'localhost',\n  user: 'root',\n  password: process.env.MYSQL_PASSWORD ?? '',\n  database: 'workbench',\n  port: 3306\n};\nconst mysql = new Mysql(config);\n\nasync function run() {\n  await mysql.waitConnect();\n  const table = mysql.getTable('order');\n  const col = table.getColumn('id');\n  table.row.filter(col.equal(504));\n  table.showColumns('id', 'number');\n  const sql = table.select();\n  console.log(sql);\n  const conn = await mysql.getConnect();\n  const result = await conn.queryOnce(sql);\n  console.log(result);\n  conn.release();\n  mysql.closeConnect();\n}\nrun().catch(console.error);","lang":"javascript","description":"Shows connecting to MySQL, building a SELECT query with filter, executing it, and releasing the connection."},"warnings":[{"fix":"Await mysql.waitConnect() before any other calls.","message":"Must call waitConnect() before using any table methods; otherwise getTable() may return undefined or incomplete schema.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use conn.queryOnce(sql) or conn.query(sql) as provided by node-fast-sql.","message":"conn.queryOnce() and conn.query() are custom methods on the connection object, not standard mysql driver methods. Using standard mysql connection.query() will fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure table exists and waitConnect() completes before accessing it.","message":"getTable() uses schema introspection; if the table doesn't exist or has no columns, subsequent calls fail silently.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use JSDoc or hand-roll types if needed.","message":"No TypeScript definitions; only plain JS usage is supported.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.16':31 'activ':44 'automat':12 'builder':8 'caution':75 'chainabl':19 'column':21 'connect':17,46 'coupl':57 'databas':14,61 'delet':29 'fast':3 'insert':27 'introspect':13 'javascript':78 'js':81 'knex':38 'lack':67 'lightweight':54 'make':52 'migrat':68 'mysql':6,45,80 'node':2,79 'node-fast-sql':1 'node.js':10 'oper':24 'pool':69 'product':77 'provid':18 'queri':7 'quick':64 'rare':35 'reflect':51 'reli':48 'requir':42 'row':23 'safeti':72 'schema':15,50 'script':65 'select':26 'sequel':40 'singl':60 'sql':4 'stabl':33 'suitabl':62 'tabl':20 'tight':56 'type':71 'unlik':37 'updat':28,36 'use':73 'version':30","created_at":"2026-06-05T16:59:45.661180+00:00","updated_at":"2026-06-05T16:59:45.661180+00:00","problems":[{"fix":"Add await mysql.waitConnect() before accessing table methods.","cause":"table.row is undefined because waitConnect() not called or failed.","error":"TypeError: Cannot read property 'filter' of undefined"},{"fix":"Check table name and ensure waitConnect() completed; database may need migration.","cause":"getTable() called with a table name that doesn't exist in the database.","error":"Error: ER_NO_SUCH_TABLE: Table 'database.table' doesn't exist"},{"fix":"Run: npm install mysql","cause":"The mysql driver is not installed as a dependency; node-fast-sql lists it as a peer dependency but does not install it automatically.","error":"Error: Cannot find module 'mysql'"}],"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/85785-EGM/fast-sql#readme","github":"https://github.com/85785-EGM/fast-sql","docs":null,"changelog":null,"pypi":null,"npm":"node-fast-sql","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}}