database-to-typescript-lib
v1.0.26
Published
create a ts interfaces from a db schema
Maintainers
Readme
Mysql to Typescript interfaces | Lib

Lib to help convert a database schema to typescript interfaces
Databases Support
- Mysql
Installation
$ npm i database-to-typescript-libExample in code
import {
connectionSettings,
createInterfaceFile,
getTablesRegisters,
} from "database-to-typescript-lib";
//create the config connection settings
const connectionSetting: connectionSettings = {
database: "Database",
user: "your_username", // Please enter your username
password: "your_password", // Please enter your password
host: "localhost",
port: 3306,
options: {
path: "./database.d.ts",
prefix: "db",
},
};
const tables = await getTablesRegisters(connectionSetting);
console.log(tables);
const createInterfaceFilenew = await createInterfaceFile(
tables,
connectionSetting.options
); // this create the fileIf it helps you, you can give me a star on GitHub 😀
