Registry / database / sql-to-ts

sql-to-ts

JSON →
library1.0.14jsnpmunverified

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.

npm install sql-to-ts
INSTALL
IMPORT
SIG · SQL-TO-TS
S
sql-to-ts
databasejavascriptv1.0.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli tool
sql-to-ts -o out/ schema.sql
npx sql-to-ts schema.sql (without -o defaults to 'out' directory)
This is a CLI tool, not a library. Use via command line or npx.

Installs the CLI globally, then generates TypeScript interfaces from a SQL schema file.

npm i -g sql-to-ts sql-to-ts -o ./generated ./schema.sql # Or using npx: npx sql-to-ts -o ./generated ./schema.sql
Debug
Known issues
gotchaInput SQL must be CREATE TABLE scripts generated by phpMyAdmin; other formats may fail.
fix
Use phpMyAdmin export or manually format SQL CREATE TABLE statements as expected.
affects: all
deprecatedPackage is in maintenance mode; no updates expected. Consider alternatives like @databases/mysql or sequelize-auto.
fix
Migrate to actively maintained tools for SQL-to-TypeScript generation.
affects: all
gotchaOutput directory is created automatically; files may be overwritten if not using --clean.
fix
Use --clean flag to clear output directory before generating new files.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'sql-to-ts'
Global install may not be in PATH or package not installed globally.
fix
Install with -g: npm install -g sql-to-ts, or use npx: npx sql-to-ts ...
SyntaxError: Unexpected token
Input SQL not in phpMyAdmin export format; contains unsupported syntax.
fix
Ensure SQL uses CREATE TABLE statements without MySQL-specific extensions not supported by parser.
Upgrade
Version history
1.0.14latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
14
Meta
1
Amazon
1
OpenAI (training)
1
Resources
sql-to-ts — npm install sql-to-ts · libregistry