db-json-schema

Generates JSON Schema from from existing databases.

Usage no npm install needed!

<script type="module">
  import dbJsonSchema from 'https://cdn.skypack.dev/db-json-schema';
</script>

README

db-json-schema

A tool to generate JSON Schema from existing databases, current support Mysql、MSSQL、PostgresSQL、MariaDB、ORACLE、SQLite.

start

import { Engine } from 'db-json-schema'

const driver = Engine.createDriver('mysql')
Engine.createModelFromDatabase(driver, {
  host: 'localhost',
  port: 3306,
  databaseName: 'test',
  user: 'root',
  password: 'root',
  databaseType: 'mysql',
  skipTables: [],
})

Acknowledgements

The core code are ported from typeorm-model-generator, thanks for https://github.com/Kononnable's great work.