mysql-schema-ts icon indicating copy to clipboard operation
mysql-schema-ts copied to clipboard

Bad output when given no args

Open cv opened this issue 5 years ago • 1 comments

Got:

npx mysql-schema-ts
TypeError: Cannot read property 'substr' of null
    at Function.ConnectionConfig.parseUrl (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql/lib/ConnectionConfig.js:177:29)
    at new ConnectionConfig (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql/lib/ConnectionConfig.js:9:32)
    at Object.createConnection (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql/index.js:13:34)
    at new MySQL (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql-schema-ts/dist/src/mysql-client.js:27:35)
    at Object.inferSchema (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql-schema-ts/dist/src/index.js:40:16)
    at main (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql-schema-ts/dist/bin/index.js:12:18)
    at Object.<anonymous> (/Users/carlos.villela/dev/src/github.com/segmentio/sprout/node_modules/mysql-schema-ts/dist/bin/index.js:14:1)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)

Expected a usage message, along the lines of:

mysql-schema-ts v1.6.3 - convert MySQL schemas into TypeScript interfaces
USAGE:
  npx mysql-schema-ts mysql://[USER]:[PASSWORD]@[HOST]:[PORT]/[DATABASE]?[OPTIONS]

cv avatar Jun 04 '20 07:06 cv

Thanks for reporting!

nettofarah avatar Jun 04 '20 16:06 nettofarah