{"id":43854,"library":"snake-orm","title":"snake-orm","description":"A minimal ORM for Node.js supporting MySQL and SQLite. Current stable version: 0.0.25. Release cadence is irregular; API and documentation are sparse. Key differentiator: light weight with chainable query builder (`.where().limit().offset()`) similar to Knex. Lacks migration, model validation, and eager loading. Primarily targets small projects or prototypes. Note: package name is 'snake-orm', but import uses 'SnackeOrm' (typo in code).","status":"active","version":"0.0.25","language":"javascript","source_language":"en","source_url":"https://github.com/wuyuedefeng/snake-orm","tags":["javascript"],"install":[{"cmd":"npm install snake-orm","lang":"bash","label":"npm"},{"cmd":"yarn add snake-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add snake-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL driver required when using MySQL dialect.","package":"mysql2","optional":true},{"reason":"SQLite driver required when using SQLite dialect.","package":"sqlite3","optional":true}],"imports":[{"note":"This package does not provide ESM exports. Use CommonJS require. Note the typo 'SnakeOrm' (vs 'SnakeOrm' in code).","wrong":"import SnakeOrm from 'snake-orm'; // ESM not supported","symbol":"default export","correct":"const SnakeOrm = require('snake-orm');"},{"note":"Destructure from the CommonJS require. The class name is 'SnakeModel' (capital S, capital M).","wrong":"import { SnakeModel } from 'snake-orm'; // ESM not supported","symbol":"SnakeModel","correct":"const { SnakeModel } = require('snake-orm');"},{"note":"First three arguments are required: database, username, password. Config object comes fourth.","wrong":"SnakeOrm.getOrCreateSnakeOrmProxy(config); // missing database, username, password","symbol":"getOrCreateSnakeOrmProxy","correct":"SnakeOrm.getOrCreateSnakeOrmProxy(database, username, password, config);"}],"quickstart":{"code":"const SnakeOrm = require('snake-orm');\n\nSnakeOrm.getOrCreateSnakeOrmProxy('test_db', 'root', 'password', {\n  dialect: 'mysql',\n  host: 'localhost',\n  logger: false\n});\n\nconst { SnakeModel } = SnakeOrm;\n\nclass User extends SnakeModel {\n  constructor() {\n    super(...arguments);\n  }\n}\n\n// Find user with primary key 1\nUser.find(1).then(user => console.log(user)).catch(err => console.error(err));\n\n// Chainable query\nUser.where('age > ?', 18).limit(10).offset(0).then(users => console.log(users));","lang":"javascript","description":"Initializes a connection, defines a model, and performs basic find and chainable query operations."},"warnings":[{"fix":"Use 'SnakeOrm' as the variable name (matching the package name), but destructure correctly.","message":"Typo in code: 'SnackeOrm' vs 'SnakeOrm' – the required module is named 'snake-orm', but the returned object is often referred to as 'SnakeOrm' (with 'k'). However, in the README examples, they use 'SnackeOrm' (with 'c'). This inconsistency may cause confusion.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CommonJS require() instead.","message":"Package does not support ES modules (ESM). Attempting to use 'import' will throw an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to source code or experiment with small tests.","message":"Documentation is minimal; methods like 'Bomb Method' (find) are not clearly explained. Expected behavior may differ from other ORMs.","severity":"gotcha","affected_versions":"all"},{"fix":"Install the required driver: npm install mysql2 or npm install sqlite3.","message":"Database drivers (mysql2 or sqlite3) must be installed separately; they are not included as dependencies.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.0.25':16 'api':21 'builder':33 'cadenc':18 'chainabl':31 'code':66 'current':13 'differenti':27 'document':23 'eager':45 'import':61 'irregular':20 'javascript':67 'key':26 'knex':39 'lack':40 'light':28 'limit':35 'load':46 'migrat':41 'minim':5 'model':42 'mysql':10 'name':55 'node.js':8 'note':53 'offset':36 'orm':3,6,59 'packag':54 'primarili':47 'project':50 'prototyp':52 'queri':32 'releas':17 'similar':37 'small':49 'snackeorm':63 'snake':2,58 'snake-orm':1,57 'spars':25 'sqlite':12 'stabl':14 'support':9 'target':48 'typo':64 'use':62 'valid':43 'version':15 'weight':29","created_at":"2026-06-05T17:01:47.735715+00:00","updated_at":"2026-06-05T17:01:47.735715+00:00","problems":[{"fix":"Ensure snake-orm is installed: npm install snake-orm. Check that the path is correct and no typos.","cause":"The require('snake-orm') returned undefined, possibly because the package is not installed or there is a typo in the require path.","error":"TypeError: Cannot destructure property 'SnakeModel' of '(intermediate value)' as it is undefined."},{"fix":"Install the required driver: npm install mysql2 (or sqlite3).","cause":"Missing database driver dependency.","error":"Error: Cannot find module 'mysql2' (or 'sqlite3')"},{"fix":"Change to const SnakeOrm = require('snake-orm');.","cause":"Using import instead of require. The package does not support ESM.","error":"TypeError: SnakeOrm.getOrCreateSnakeOrmProxy 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/wuyuedefeng/snake-orm#readme","github":"https://github.com/wuyuedefeng/snake-orm","docs":null,"changelog":null,"pypi":null,"npm":"snake-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}}