PhilWaldmann / openrecord

Make ORMs great again!
https://openrecord.js.org
MIT License
486 stars 38 forks source link

Support for custom port number #78

Closed rottenoats closed 6 years ago

rottenoats commented 6 years ago

After reviewing the source code and documentation, I didn't find anything regarding custom ports. MySQL that I use runs on 5432 port. Are there any future updates that will add support for custom ports? (Unless I read the documentation too quickly)

This is non blocking for me at the moment, but could be useful.

Also shouldn't the host property be hostname ? it specifies:

host: Hostname or IP of the server running your database (postgres, mysql and oracle only)

According to Node.js URL documentation the host should correspond to the hostname + port number (even if the description says hostname)

PhilWaldmann commented 6 years ago

HI @rottenoats

openrecord uses knex.js under the hood. So config variables will be given to knex in order to connect to your database. And knex will give your config variables to the driver (mysql, pg, oracle, sqlite3, ...). Knex decided to name it host, so I did the same.
The node URL module has nothing to do with this!

I'll add the documentation for port and an alias hostname to have the same naming schema as node.

Thanks, Philipp

PhilWaldmann commented 6 years ago

available in v2.7.3