Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mysql-table-types

rhapsodyn16MIT1.0.2

Export mysql table schema to TypeScript declaration.

mysql, mysqljs, table schema, jsdoc, typing.d.ts, typescript

readme

mysql-table-types

Export mysql tables schema to TypeScript declaration.

Why

  1. I'm using nodejs
  2. I'm using mysqljs
  3. I'm in love with TypeScript or the *.d.ts
  4. I'm looking for some MAGIC writing TypeScript declaration of my HUNDREDS-of-mysql-tables for me

How

Cli

npm i -g mysql-table-types
mysql-table-types -i db.json

or

npx mysql-table-types -i db.json

or

npx mysql-table-types -i db.json -o db.d.ts

Manual

const mtt = require('mysql-table-types');
const listOfTableSchemaStrings = mtt(yourMysqlConnSomewhere.config);