Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port definition in dbTypes is inconsistent #109

Closed
npetzall opened this issue Jun 13, 2017 · 2 comments
Closed

Port definition in dbTypes is inconsistent #109

npetzall opened this issue Jun 13, 2017 · 2 comments

Comments

@npetzall
Copy link
Member

Some have and some expects PORT to be included in

description=MariaDB

connectionSpec=jdbc:mariadb://<host>:<port>/<db>
host=hostname host where database resides with optional port
db=database name
description=MySQL

connectionSpec=jdbc:mysql://<host>/<db>
host=hostname[:port] host where database resides with optional port
db=database name
@npetzall
Copy link
Member Author

@rafalkasa
Looking over the dbTypes.
Some have the split some doesn't in most cases where they don't it's
<host>:<port> except for Teradata which is just plain weird.

# Example of connectionSpec: jdbc:teradata://TD.DB.ROOT1.NET/DATABASE=DB1,DBS_PORT=1025
connectionSpec=jdbc:teradata://<db>/DATABASE=<s>,DBS_PORT=<port>
db=database name
s=?????
port=?????

db is mapped to host and s is mapped to database. I'm guessing this might be related to schema, catalog but I'm unsure. @ClintEstwood might have input.

So to not screw everything up we could replace <host>(where host[:port]) and <host>:<port> with <hostAndPort>, we compute the value. Using a default separator of ":". If port is empty no separator will be used and <hostAndPort> == <host>. You'll still able to use <host> and <port>.
Separator can be overridden in dbType with hostPortSeparator.

I'm just assuming not all jdbc drivers would like jdbc:mariadb://localhost:/test when port is left for default of jdbc-driver.

@npetzall
Copy link
Member Author

@rafalkasa is a viable solution? Should I go ahead.

@npetzall npetzall mentioned this issue Jul 29, 2017
npetzall added a commit to npetzall/schemaspy that referenced this issue Aug 7, 2017
* If host contains port uses it.
* If host is missing port but -port is used it's by default separated by `:`.
* If port is missing only host is used.
* Host Port Separator can be customized with property in dbType `hostPortSeparator`.
npetzall added a commit to npetzall/schemaspy that referenced this issue Aug 7, 2017
* If host contains port uses it.
* If host is missing port but -port is used it's by default separated by `:`.
* If port is missing only host is used.
* Host Port Separator can be customized with property in dbType `hostPortSeparator`.
npetzall added a commit to npetzall/schemaspy that referenced this issue Aug 7, 2017
* If host contains port uses it.
* If host is missing port but -port is used it's by default separated by `:`.
* If port is missing only host is used.
* Host Port Separator can be customized with property in dbType `hostPortSeparator`.
@rafalkasa rafalkasa modified the milestones: 6.1.0, 6.0.0-rc2 Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants