{"id":43980,"library":"sqldb-orm","title":"sqldb-orm","description":"A minimal SQL ORM supporting MySQL and SQLite3. Current stable version is 1.1.0. Provides simple CRUD operations, pagination, and table introspection. Designed for lightweight use cases where full-featured ORMs like Sequelize or TypeORM are overkill. Release cadence is unknown; the package appears to be in maintenance mode with no recent updates. Key differentiator: minimal API with automatic table discovery.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","mysql","sqlite3","dal","mysql-orm","ORM"],"install":[{"cmd":"npm install sqldb-orm","lang":"bash","label":"npm"},{"cmd":"yarn add sqldb-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add sqldb-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL database driver for MySQL connections","package":"mysql","optional":true},{"reason":"SQLite3 database driver for SQLite connections","package":"sqlite3","optional":true}],"imports":[{"note":"Package uses CommonJS exports, not ESM. Use require() instead of import.","wrong":"import orm from 'sqldb-orm';","symbol":"default","correct":"const orm = require('sqldb-orm');"},{"note":"getClass is an async factory method, not a constructor. Must be called with await.","wrong":"let sqlDal = new orm.getClass('mysql', config, 'tb_user', true);","symbol":"getClass","correct":"let sqlDal = await orm.getClass('mysql', config, 'tb_user', true);"},{"note":"All data access methods return Promises. Must be awaited or used with .then().","wrong":"let list = sqlDal.findAll();","symbol":"findAll","correct":"let list = await sqlDal.findAll();"}],"quickstart":{"code":"const orm = require('sqldb-orm');\nconst config = require('./mysql-config.js');\n\nasync function main() {\n  const sqlDal = await orm.getClass('mysql', config, 'tb_user', true);\n  const users = await sqlDal.findAll();\n  console.log(users);\n}\nmain().catch(console.error);","lang":"javascript","description":"Connect to MySQL, get ORM class for table 'tb_user', and fetch all records."},"warnings":[{"fix":"Set the fourth argument to false if you only want to use existing tables.","message":"The fourth argument to getClass (autoCreateTable) is a boolean that may cause table creation if true, which could overwrite existing tables.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For SQLite, pass the database file path as a string: orm.getClass('sqlite3', './test.db3', 'tb_user', true)","message":"SQLite config must be a file path string, not an object. Passing an object for SQLite will cause runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always treat results from findOne as an array and take the first element if needed.","message":"Version 1.1.0 may have changed the behavior of findOne: it might return an array instead of a single object. Not documented clearly.","severity":"breaking","affected_versions":"1.1.0"}],"env_vars":null,"search_vec":"'1.1.0':16 'api':60 'appear':47 'automat':62 'cadenc':42 'case':29 'crud':19 'current':12 'dal':68 'design':25 'differenti':58 'discoveri':64 'featur':33 'full':32 'full-featur':31 'introspect':24 'javascript':65 'key':57 'lightweight':27 'like':35 'mainten':51 'minim':5,59 'mode':52 'mysql':9,66,70 'mysql-orm':69 'oper':20 'orm':3,7,34,71,72 'overkil':40 'packag':46 'pagin':21 'provid':17 'recent':55 'releas':41 'sequel':36 'simpl':18 'sql':6 'sqldb':2 'sqldb-orm':1 'sqlite3':11,67 'stabl':13 'support':8 'tabl':23,63 'typeorm':38 'unknown':44 'updat':56 'use':28 'version':14","created_at":"2026-06-05T17:02:24.104514+00:00","updated_at":"2026-06-05T17:02:24.104514+00:00","problems":[{"fix":"Install sqlite3: npm install sqlite3 --save","cause":"The sqlite3 driver is not installed as a dependency, or the SQLite config path is wrong.","error":"Error: Cannot find module 'sqlite3'"},{"fix":"Run: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; or use mysql2 package instead of mysql.","cause":"MySQL server uses caching_sha2_password (MySQL 8+ default), but the mysql npm package may not support it.","error":"Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server"},{"fix":"Use require('sqldb-orm') and ensure package is installed: npm install sqldb-orm","cause":"Using import instead of require, or the package is not installed correctly.","error":"TypeError: orm.getClass 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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"sqldb-orm","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}}