0.5.0 • Published 8 months ago

pg-graphql-typeorm v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

pg-graphql-typeorm

The sole purpose of this code as of inception, is to generate typeorm + typegraphql models from a postgres database.

I followed creating a cli with nodejs, creating a cli with typescript, and unit testing node cli apps to help create this so shout out to those authors.

Usage

yarn ftl -d my_database -s schema_1,schema_2,schema_n -o ./where/toput/entities

Usage with prettier (optional)

yarn ftl -d my_database -s schema_1,schema_2,schema_n -o ./where/toput/entities && yarn typeorm:format

Note: typeorm:format is just package.json script with prettier --write ./src/generated/entities/*.ts

I like to add a script to my package.json:

"scripts": {
...
  "build:entities": "yarn ftl -d my_database -s schema_1,schema_2,schema_n -o ./src/generated/entities && yarn typeorm:format"
}

Todo

  • Allow configs. Loading configs works but haven't decided on to do with the configuration. E.g., exclude some tables from generation, or specific columns in a table or even some pattern type stuff.

Update in version 0.5.0 load config (.ftlrc.js in root project) to decide whether to create relationships for a certain field of a model.

Compatibility

TypeORM: 0.2.32 TypeGraphql: 1.1.1

Notes on development

This was originally called superluminal, but upon trying to publish i noticed that cool name was taken so i renamed. The ftl command will stay though ;)

0.5.0

8 months ago

0.4.2

10 months ago

0.4.1

1 year ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.2

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago