{"id":43964,"library":"sql-to-ts","title":"sql-to-ts","description":"Generates TypeScript interfaces, type aliases, and enums from SQL CREATE TABLE scripts (e.g., from phpMyAdmin). Version 1.0.14. Low maintenance; last release in 2020. Differentiator: simple CLI tool that converts SQL schema to TypeScript definitions automatically.","status":"maintenance","version":"1.0.14","language":"javascript","source_language":"en","source_url":"https://github.com/beenotung/sql-to-ts","tags":["javascript"],"install":[{"cmd":"npm install sql-to-ts","lang":"bash","label":"npm"},{"cmd":"yarn add sql-to-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add sql-to-ts","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a CLI tool, not a library. Use via command line or npx.","wrong":"npx sql-to-ts schema.sql (without -o defaults to 'out' directory)","symbol":"cli tool","correct":"sql-to-ts -o out/ schema.sql"}],"quickstart":{"code":"npm i -g sql-to-ts\nsql-to-ts -o ./generated ./schema.sql\n# Or using npx:\nnpx sql-to-ts -o ./generated ./schema.sql","lang":"typescript","description":"Installs the CLI globally, then generates TypeScript interfaces from a SQL schema file."},"warnings":[{"fix":"Use phpMyAdmin export or manually format SQL CREATE TABLE statements as expected.","message":"Input SQL must be CREATE TABLE scripts generated by phpMyAdmin; other formats may fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to actively maintained tools for SQL-to-TypeScript generation.","message":"Package is in maintenance mode; no updates expected. Consider alternatives like @databases/mysql or sequelize-auto.","severity":"deprecated","affected_versions":"all"},{"fix":"Use --clean flag to clear output directory before generating new files.","message":"Output directory is created automatically; files may be overwritten if not using --clean.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.14':21 '2020':27 'alias':9 'automat':39 'cli':30 'convert':33 'creat':14 'definit':38 'differenti':28 'e.g':17 'enum':11 'generat':5 'interfac':7 'javascript':40 'last':24 'low':22 'mainten':23 'phpmyadmin':19 'releas':25 'schema':35 'script':16 'simpl':29 'sql':2,13,34 'sql-to-t':1 'tabl':15 'tool':31 'ts':4 'type':8 'typescript':6,37 'version':20","created_at":"2026-06-05T17:02:19.453263+00:00","updated_at":"2026-06-05T17:02:19.453263+00:00","problems":[{"fix":"Install with -g: npm install -g sql-to-ts, or use npx: npx sql-to-ts ...","cause":"Global install may not be in PATH or package not installed globally.","error":"Error: Cannot find module 'sql-to-ts'"},{"fix":"Ensure SQL uses CREATE TABLE statements without MySQL-specific extensions not supported by parser.","cause":"Input SQL not in phpMyAdmin export format; contains unsupported syntax.","error":"SyntaxError: Unexpected token"}],"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/beenotung/sql-to-ts#readme","github":"https://github.com/beenotung/sql-to-ts","docs":null,"changelog":null,"pypi":null,"npm":"sql-to-ts","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"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}}