-
Notifications
You must be signed in to change notification settings - Fork 327
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
Move Generic JDBC driver support to its own non-NI library #12472
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Few comments inline.
- overall this is a good approach
- I'd like to see use-cases how this shall behave in IDE and CLI
- in JVM and NI modes
- can you please enumerate the use-cases, describe how to simulate them and what shall be the outcome?
build.sbt
Outdated
@@ -4642,6 +4645,8 @@ val `base-polyglot-root` = stdLibComponentRoot("Base") / "polyglot" / "java" | |||
val `table-polyglot-root` = stdLibComponentRoot("Table") / "polyglot" / "java" | |||
val `image-polyglot-root` = stdLibComponentRoot("Image") / "polyglot" / "java" | |||
val `image-native-libs` = stdLibComponentRoot("Image") / "polyglot" / "lib" | |||
val `generic-jdbc-polyglot-root` = stdLibComponentRoot("Generic_JDBC") / "polyglot" / "java" | |||
val `generic-jdbc-native-libs` = stdLibComponentRoot("Generic_JDBC") / "polyglot" / "lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there going to be any native libs for Generic_JDBC
? Isn't JDBC API (all that is needed) already part of the JDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No native libs are needed now, other than a driver that the user will provide. Possibly ODBC libs in the far future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the generic-jdbc-native-libs
variable and its usages then?
import project.SQL_Query.SQL_Query | ||
from project.Internal.Result_Set import read_column, result_set_to_table | ||
import Standard.Database.Connection.Connection_Options.Connection_Options | ||
import Standard.Database.Internal.Column_Fetcher as Column_Fetcher_Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing "internal" stuff will bite us in the future. Such an cross-library import turns such "internal" stuff into API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be moved to a separate SQL_Utils or Database_Utils library.
@@ -12,6 +12,8 @@ from Standard.Test import all | |||
import project.Database.Helpers.Name_Generator | |||
from project.Database.Postgres_Spec import create_connection_builder | |||
|
|||
import Standard.Generic_JDBC.Generic_JDBC_Connection.Generic_JDBC_Connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make Table_Tests
independent of Standard.Generic_JDBC
library? There are test/Generic_JDBC_Tests
- why not to move these "posgress" and "sqlite" tests there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests have to be run in the context of the Postgres / SQLite testing infrastructure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency of Table_Tests
on "everything" including Generic_JDBC
is unfortunate. Shall Table_Tests
be split to core Table_Tests
and various database extension _Tests
running such tests in different configurations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think we should put in a ticket to make this split. I'd like to see the tests closer to the code which would make this division more natural (but that is probably a bigger discussion than we need here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refactoring would be to move the test instance setup out of Table_Tests so it could be used for other tests, which would be a very large refactoring.
The Postgres and SQLite generic JDBC tests are there just to test the generic JDBC support -- they are not important for our direct Postgres and SQLite support, so a major refactoring is not warranted here. The SQLite dependency is much smaller, since it doesn't require spinning up an instance.
(Not) Packaging in Native
|
CLI / Native ImageUser imports
IDE / Native ImageUser imports
CLI and IDE / JVM Mode
To simulate these in CLI, any Enso program importing from In my opinion |
This is sufficient for the current release, but later we will need this error to be shown in the IDE. |
Since it is not a warning attached to a value but rather an internal warn log message it won't be shown in IDE. We need to find a way to attach it to the value. I would also agree that this can go in as-is for now, and we can do incremental improvements. |
This moves generic JDBC support into its own library. This library will not be included in the native image, since dynamic loading of JDBC drivers requires JVM mode.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.