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

[FLINK-33800][JDBC/Connector] Allow passing parameters to database via jdbc url #83

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

snuyanzin
Copy link
Contributor

@snuyanzin snuyanzin commented Dec 11, 2023

The idea is pretty straightforward: from one side there is a jdbc url which is normally is provided by most of the dbs providers to connect to.
From the other side for some, probably historical reasons, there a separate property for default database which is used for default url.

To not break former behaviour it is possible to specify either database in jdbcurl or database with extra parameters only if database is same as ifor a dedicated property for default database.
In fact I tend to think to mark it as a deprecated since all the info could be extracted from jdbc url

so after this PR it is possible to have something like

CREATE CATALOG postgres WITH (
     'type'='jdbc',
     'property-version'='1',
     'base-url'='jdbc:postgresql://my_postgres:12691/defaultdb?sslmode=require',
     'default-database'='defaultdb', 
    ...
 );

or similar thing for create table/view

@eskabetxe
Copy link
Member

eskabetxe commented Dec 15, 2023

Hi @snuyanzin,
I can imagine that the intention would be to have all the db's with a single catalog, but being mandatory the default-database my assumption can be wrong..

Saying that and being one catalog for db, won't be better to add a new option like url (as table have), and deprecate this two.
It becomes a little strange to have the database name on the two option, and base-url being a full url..

@eskabetxe
Copy link
Member

this is also related with this: #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants