joneldiablo / objection-model-generator

automagically generate all ObjectionJS models from Mysql
12 stars 13 forks source link

Error executing model generate #3

Open lrlineroa opened 3 years ago

lrlineroa commented 3 years ago

$ node generator_model.js ======== on query ========== select KEY_COLUMN_USAGE. from KEY_COLUMN_USAGE where REFERENCED_COLUMN_NAME is not null and table_schema = "cuploo" ======== on query ========== select TABLES. from TABLES where table_schema = "cuploo" ======== on query ========== select COLUMNS. from COLUMNS where COLUMNS.TABLE_NAME in ("knex_migrations", "knex_migrations_lock", "users") and TABLE_SCHEMA = "cuploo" node:internal/process/promises:218 triggerUncaughtException(err, true / fromPromise */); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined at new NodeError (node:internal/errors:258:15) at maybeCallback (node:fs:160:9) at Object.writeFile (node:fs:1435:14) at main (C:\projects\CG\next_projects\cuploo_back\database\generator_model.js:13:12) { code: 'ERR_INVALID_CALLBACK' }

Hi, when I try generate the models from the database, i get this error, any help, thanks

lrlineroa commented 3 years ago

I just did a fork of the project and then clone, in development work perfectly, I just changed a few things, but in production, i'm still getting the error above. I suggest see what happen

sulthonuladib commented 3 years ago

@lrlineroa you can see at my pull request on this repo for not working examples

joneldiablo commented 3 years ago

sorry, I have not see your comments, I'm going to rebuild and make better documentation soon