{"id":18196,"library":"cbt-sequelize-auto","title":"Sequelize-Auto","description":"Sequelize-Auto (v0.8.7) automatically generates bare Sequelize models from an existing database. Supports MySQL, MariaDB, PostgreSQL, SQLite, and MSSQL with their respective dialect packages. It runs via CLI, reads database schemas, and outputs model files (JavaScript or TypeScript with bundled types). Last release stable but low activity; no longer installs sequelize as a dependency, requiring users to manually add both sequelize and dialect packages. Key features: customizable case conventions for models, properties, and filenames; support for excluding/including specific tables; additional model options via JSON config files.","status":"maintenance","version":"0.8.7","language":"javascript","source_language":"en","source_url":"https://github.com/sequelize/sequelize-auto","tags":["javascript","mysql","mssql","sqlite","postgres","sequelize","sequelizejs","generator","mapper","typescript"],"install":[{"cmd":"npm install cbt-sequelize-auto","lang":"bash","label":"npm"},{"cmd":"yarn add cbt-sequelize-auto","lang":"bash","label":"yarn"},{"cmd":"pnpm add cbt-sequelize-auto","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; sequelize-auto generates models for Sequelize and requires it to be installed separately.","package":"sequelize","optional":false}],"imports":[{"note":"Use npx to run without global install, or install globally with npm i -g sequelize-auto.","wrong":"sequelize-auto -h <host> ...","symbol":"default (CLI command)","correct":"npx sequelize-auto -h <host> -d <database> -u <user> -x <password> --dialect <dialect> -o ./models"},{"note":"Generated models use CommonJS exports by default. If TypeScript output is enabled (via --ts), switch to ES import syntax.","wrong":"import User from './models/User';","symbol":"Models (generated output)","correct":"const { User } = require('./models');"},{"note":"Tables must be space-separated within a single argument string when using -t. Each table name is a separate value in the array.","wrong":"sequelize-auto -t users orders","symbol":"Tables option","correct":"sequelize-auto -t \"users orders\""}],"quickstart":{"code":"npx sequelize-auto -h localhost -d my_db -u root -x mypassword --dialect mysql -o ./models -t users","lang":"typescript","description":"Generates Sequelize models for the 'users' table from a MySQL database into ./models folder."},"warnings":[{"fix":"npm install sequelize mysql2 (or your dialect) before running sequelize-auto.","message":"sequelize-auto no longer installs sequelize as a dependency since version 0.7.0. You must manually install sequelize and the appropriate dialect package.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Use -t \"table1 table2\" instead of -t table1 -t table2.","message":"The --tables (-t) and --skipTables (-T) options expect table names to be provided as space-separated arguments within a single string, but passing multiple --t values is also accepted. The single-arg style is the documented and recommended approach.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Ensure the path is correct: --additional ./config/options.json","message":"When using --additional (-a) to provide model options, the JSON file path must be relative to the current working directory. Absolute paths also work, but relative paths are error-prone.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Update models manually or use a newer version of sequelize-auto that targets Sequelize v6.","message":"Generated models use Sequelize v5+ syntax (sequelize.define) but may not be fully compatible with Sequelize v6 if using legacy options. Always check your Sequelize version.","severity":"gotcha","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install sequelize","cause":"sequelize-auto requires sequelize to be installed as a peer dependency, but it's not present.","error":"Error: Cannot find module 'sequelize'"},{"fix":"npm install mysql2 (or your dialect: pg, sqlite3, tedious)","cause":"The required dialect package (e.g., mysql2) is not installed.","error":"Error: No dialect binding found for 'mysql'"},{"fix":"Verify your database host address and ensure it's accessible.","cause":"The hostname provided via -h is unreachable or incorrect.","error":"Error: getaddrinfo ENOTFOUND localhost"},{"fix":"Check that the JSON file exists and is correctly formatted.","cause":"The --config or --additional option points to an invalid or empty JSON file.","error":"SyntaxError: Unexpected token '.' in JSON at position 0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}