A very quickly hacked-together schema generator for Kysely which (currently) only supports MySQL.
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-generatorEither 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'Option 1 (.env in project root and run)
kysely-schema-generatorOption 2 (.env somewhere else)
kysely-schema-generator -p /path/to/.envNote if command can't be found you might need to use your package manager to run it (e.g. pnpm exec kysely-schema-generator)
(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