This package has been deprecated

Author message:

WARNING: This project has been renamed to @shotero/gen-api. Install using @shotero/gen-api instead.

@shotero/gen-model

0.1.1 • Public • Published

Gen Model

Generate ObjectionJS models automatically from postgresql database

Install

npm install @shotero/gen-model

Usage

  • Create configuration(checkout sample config)
  • Create a generator script in your project repository with the following content
import { generateModel } from '@shotero/gen-model';

generateModel(config);

Run the script

Example project:

https://github.com/shotero/starter-backend

Configuration

module.exports = {
  baseUrl: 'https://myproject.com',
  schemaVersion: 'http://json-schema.org/draft-07/schema#',
  paths: {
    import: '#api',
    write: process.cwd()
  },
  db: {
    database: 'mydb',
    user: 'me'
  },
  schemas: [
    {
      name: 'public',
      renames: {},
      ignores: ['hello']
    }
  ]
};

Package Sidebar

Install

npm i @shotero/gen-model

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

14 kB

Total Files

15

Last publish

Collaborators

  • lemonchiffon