@technicity/data-service-generator
TypeScript icon, indicating that this package has built-in type declarations

0.15.0 • Public • Published

data-service-generator

Generate a TypeScript SDK from a MySQL or SQL Server database.

Usage

const { generate } = require("@technicity/data-service-generator");

main()
  .then(() => {
    process.exit(0);
  })
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

async function main() {
  await generate({
    outdir: __dirname,
    dialect: "mysql",
    database: "MY_DATABASE",
    user: "MY_USER",
    password: "MY_PASSWORD"
  });
}

API

  • generate

Options

Option Required Default Description
outdir Yes The output directory for the SDK.
dialect Yes "mysql" | "mssql"
database Yes Database name
user Yes Database user
password No Database password
host No "localhost" Database host
port No 3306 | 1433 Database port. Defaults to 3306 for MySQL, 1433 for SQL Server.
tables No An array of database tables to process (allowlist).
excludeTables No An array of database tables to not process (denylist).

Running Tests

  • yarn test

Unit Tests

Comment out globalSetup in jest.config.js, then:

  • yarn test:unit

See comment in ./test/globalSetup.ts for why this is necessary.

Readme

Keywords

none

Package Sidebar

Install

npm i @technicity/data-service-generator

Weekly Downloads

55

Version

0.15.0

License

none

Unpacked Size

229 kB

Total Files

62

Last publish

Collaborators

  • teamtechnicity
  • bjyurkovich