@deanc/kysely-schema-generator

0.1.2 • Public • Published

Kysely schema generator

A very quickly hacked-together schema generator for Kysely which (currently) only supports MySQL.

Installation

With your package manager of choice install:

npm install --save @deanc/kysely-schema-generator
yarn add @deanc/kysely-schema-generator
pnpm add @deanc/kysely-schema-generator

Configuration

Either in your project root or somewhere else create a .env file with a DATABASE_URL environmental variable:

DATABASE_URL='mysql://user:password@host:3306/databaseName'

Usage

Option 1 (.env in project root and run)

kysely-schema-generator

Option 2 (.env somewhere else)

kysely-schema-generator -p /path/to/.env

Note if command can't be found you might need to use your package manager to run it (e.g. pnpm exec kysely-schema-generator)

Todo

(Contributions very welcome)

  • Ensure all MySQL field types are mapped correctly
  • Add support for other database engines (Postgres, SQLite at least)
  • Add test coverage
  • (Maybe) offer option to write to disk instead of relying on user to capture

Readme

Keywords

none

Package Sidebar

Install

npm i @deanc/kysely-schema-generator

Weekly Downloads

2

Version

0.1.2

License

AGPL-3.0-or-later

Unpacked Size

140 kB

Total Files

20

Last publish

Collaborators

  • deanc