terra-money / fcd-classic

Terra ETL + RestFul API Server
https://fcd.terra.dev/swagger
MIT License
63 stars 42 forks source link

No connection options were found in any orm configuration files #114

Closed bert2002 closed 3 years ago

bert2002 commented 3 years ago

Hi, we built fcd and only created the .envrc configuration file. Is the ormconfig.js still needed for anything else?

$ npm start

> fcd@0.10.3 start /opt/terra-fcd
> better-npm-run api-prod

running better-npm-run in /opt/terra-fcd
Executing script: api-prod

to be executed: node --stack_size=4096 --max-old-space-size=4096 -r ts-node/register/transpile-only -r tsconfig-paths/register src/server.ts 
05-24 07:56 [ERROR]: No connection options were found in any orm configuration files.
Error: No connection options were found in any orm configuration files.

Thanks, bert

bert2002 commented 3 years ago

yes seems ormconfig.js is still needed. Any reason why two different configuration styles are necessary?

hanjukim commented 3 years ago

@bert2002 We just wanted to leave things for TypeORM as it is. https://github.com/typeorm/typeorm/tree/master/src/connection/options-reader

bert2002 commented 3 years ago

I am not sure if I understand correctly, because it does not work with only the environment file. .envrc - as I understand you - both should work?

hanjukim commented 3 years ago

It does work with only the environment file for me.

export TYPEORM_CONNECTION=postgres
export TYPEORM_HOST=localhost
export TYPEORM_USERNAME=terra
export TYPEORM_PASSWORD=abcd
export TYPEORM_DATABASE=fcd
export TYPEORM_PORT=5432
export TYPEORM_SYNCHRONIZE=false
export TYPEORM_LOGGING=false
export TYPEORM_ENTITIES=src/orm/*Entity.ts
export TYPEORM_MIGRATIONS=src/orm/migration/*.ts