{"id":43520,"library":"orm-alpha","title":"Alpha ORM","description":"Alpha ORM is a zero-configuration JavaScript ORM that automatically creates tables and columns, supporting MySQL, SQLite, and PostgreSQL. Version 1.2.18 is the latest stable release. Unlike traditional ORMs that require schema definitions and migrations, Alpha ORM dynamically infers the schema from usage, allowing developers to create, read, update, and delete records without any setup beyond database connection. It is designed for rapid prototyping and simple applications where schema flexibility is paramount, sacrificing type safety and explicit schema control for ease of use. The package is published on npm as 'orm-alpha' with minimal dependencies.","status":"active","version":"1.2.18","language":"javascript","source_language":"en","source_url":"https://github.com/OdenigboGodfrey/node-alpha-orm","tags":["javascript","orm","database","db","alpha-orm","mysql","sqlite","postgresql"],"install":[{"cmd":"npm install orm-alpha","lang":"bash","label":"npm"},{"cmd":"yarn add orm-alpha","lang":"bash","label":"yarn"},{"cmd":"pnpm add orm-alpha","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL database driver when using MySQL","package":"mysql","optional":true},{"reason":"SQLite database driver when using SQLite","package":"sqlite3","optional":true},{"reason":"PostgreSQL database driver when using PostgreSQL","package":"pg","optional":true}],"imports":[{"note":"Package is CommonJS only. No ESM exports. Use require.","wrong":"import { AlphaORM } from 'alpha-orm'","symbol":"AlphaORM","correct":"const { AlphaORM } = require('alpha-orm')"},{"note":"Common pattern is to rename to DB for brevity. No default export.","wrong":"import AlphaORM from 'alpha-orm'","symbol":"AlphaORM (destructured as DB)","correct":"const { AlphaORM: DB } = require('alpha-orm')"},{"note":"Do not assign require result directly; AlphaORM is a named export, not default.","wrong":"const AlphaORM = require('alpha-orm')","symbol":"AlphaORM (as default, incorrect)","correct":"const { AlphaORM } = require('alpha-orm')"}],"quickstart":{"code":"const { AlphaORM: DB } = require('alpha-orm');\n\n// Setup SQLite (no config required)\nDB.setup('sqlite', { database: 'test.db' });\n\n(async () => {\n  // Create a record\n  const product = await DB.create('product');\n  product.name = 'Running shoes';\n  product.price = 5000;\n  await DB.store(product);\n\n  // Read all products\n  const products = await DB.getAll('product');\n  console.log('Products:', products);\n\n  // Find by condition\n  const found = await DB.find('product', 'name = :name', { name: 'Running shoes' });\n  console.log('Found:', found);\n\n  // Update\n  found.price = 4500;\n  await DB.store(found);\n\n  // Delete\n  // await DB.drop(found);\n})();","lang":"javascript","description":"Demonstrates setup with SQLite, creating a record, reading all, finding by condition, and updating."},"warnings":[{"fix":"Always verify field names and ensure consistency across operations.","message":"Table and column schemas are auto-generated on the fly; typos in field names create new columns. This can lead to unexpected database schema drift.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using with a dedicated migration tool or lock your schema with explicit table creation.","message":"No built-in migration or version control; database schema evolves implicitly. Loss of context can break existing queries if field names change.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() instead of import.","message":"The package uses CommonJS only; attempts to import via ES6 import will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install the required driver: npm install mysql or sqlite3 or pg.","message":"The database drivers (mysql, sqlite3, pg) are not included; you must install them separately. Without the driver, DB.setup throws.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.2.18':24 'allow':47 'alpha':1,3,39,96,105 'alpha-orm':104 'applic':70 'automat':13 'beyond':59 'column':17 'configur':9 'connect':61 'control':82 'creat':14,50 'databas':60,102 'db':103 'definit':36 'delet':54 'depend':99 'design':64 'develop':48 'dynam':41 'eas':84 'explicit':80 'flexibl':73 'infer':42 'javascript':10,100 'latest':27 'migrat':38 'minim':98 'mysql':19,107 'npm':92 'orm':2,4,11,32,40,95,101,106 'orm-alpha':94 'packag':88 'paramount':75 'postgresql':22,109 'prototyp':67 'publish':90 'rapid':66 'read':51 'record':55 'releas':29 'requir':34 'sacrif':76 'safeti':78 'schema':35,44,72,81 'setup':58 'simpl':69 'sqlite':20,108 'stabl':28 'support':18 'tabl':15 'tradit':31 'type':77 'unlik':30 'updat':52 'usag':46 'use':86 'version':23 'without':56 'zero':8 'zero-configur':7","created_at":"2026-06-05T17:00:11.705983+00:00","updated_at":"2026-06-05T17:00:11.705983+00:00","problems":[{"fix":"npm install mysql","cause":"MySQL driver not installed locally.","error":"Error: Cannot find module 'mysql'"},{"fix":"Use const { AlphaORM: DB } = require('alpha-orm');","cause":"Importing the package incorrectly; likely using default import instead of named destructuring.","error":"TypeError: DB.setup is not a function"},{"fix":"Ensure database server is running and host is correct.","cause":"Database server not running or hostname incorrect (used with MySQL/PostgreSQL).","error":"Error: getaddrinfo ENOTFOUND 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/OdenigboGodfrey/node-alpha-orm#readme","github":"https://github.com/OdenigboGodfrey/node-alpha-orm","docs":null,"changelog":null,"pypi":null,"npm":"orm-alpha","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}}