spinlud / sequelize-typescript-generator

70 stars 25 forks source link

Dialect.ts -> await connection.authenticate(); #12

Closed obecny closed 4 years ago

obecny commented 4 years ago

I'm trying to debug few things and for unknown reason it is stopping on this line instead of going further. https://github.com/spinlud/sequelize-typescript-generator/blob/master/src/dialects/Dialect.ts#L144 There is no error, etc. It just doesn't go any further instead the script is finished

    const dialect = new DialectPostgres();
    const builder = new ModelBuilder(config, dialect);

    builder.build().then(()=> {
      console.error('done1');

    }).catch((err: any)=> {
      console.error(err);
    });

The same script with the same config works fine in other repo (when using via package.json) but I cannot make it work within the same repo. I have als tried to run tests and it looks the same

Waiting database to become online...
Database online
(node:3907) [SEQUELIZE0002] DeprecationWarning: The logging-option should be either a function or false. Default: console.log
(Use `node --trace-deprecation ...` to show where the warning was created)
  console.log
    Fetching metadata from source
      at ModelBuilder.<anonymous> (src/builders/ModelBuilder.ts:232:17)
  console.log
    Fetching metadata from source
      at ModelBuilder.<anonymous> (src/builders/ModelBuilder.ts:232:17)
 RUNS  src/tests/integration/postgres/postgres.test.ts

The main reason for all of that is that I want to be able to debug to add more functionality for foreign keys (onDelete, onUpdate, and Defarrability). But I cannot make it through the debug step nor the test are working. What am I missing ?.

obecny commented 4 years ago

ok found it