-
Notifications
You must be signed in to change notification settings - Fork 12
implement java.sql.DatabaseMetaData #22
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
implement java.sql.DatabaseMetaData #22
Conversation
15c948c to
aa09c03
Compare
515e261 to
5d3a0dd
Compare
5d3a0dd to
a36efb9
Compare
…rnal `admin` database access is required to get metadata
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 last reviewed commit is c5f397f. I did not review ResultSetAdapter, as I am not yet sure if it's actually needed in this PR.
src/test/java/com/mongodb/hibernate/jdbc/MongoConnectionTests.java
Outdated
Show resolved
Hide resolved
…ngoStatement and MongoDatabaseMetaData
…R and update Javadoc consistently
…irrelevant to our need
…val won't trigger integration testing failure)
….java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
…` logger from test to integrationTest
…ticket (which will enlarge scope to provide the Driver versions)
src/main/java/com/mongodb/hibernate/jdbc/MongoDatabaseMetaData.java
Outdated
Show resolved
Hide resolved
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 last reviewed commit is d3cc51d.
src/main/java/com/mongodb/hibernate/jdbc/MongoDatabaseMetaData.java
Outdated
Show resolved
Hide resolved
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.
I don't plan to review this further so LGTM-ing to allow merge when Valentin approves.
# Conflicts: # src/test/java/com/mongodb/hibernate/jdbc/MongoClientCustomizerTests.java
Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
# Conflicts: # src/main/java/com/mongodb/hibernate/jdbc/MongoConnection.java # src/main/java/com/mongodb/hibernate/jdbc/MongoStatement.java # src/test/java/com/mongodb/hibernate/jdbc/MongoConnectionTests.java
…RNATE-37-metadata
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 last reviewed commit is a3ae083.
| jakarta.persistence.jdbc.url=mongodb://localhost/mongo-hibernate-test?directConnection=false | ||
| hibernate.dialect=com.mongodb.hibernate.dialect.MongoDialect | ||
| hibernate.connection.provider_class=com.mongodb.hibernate.jdbc.MongoConnectionProvider | ||
| hibernate.boot.allow_jdbc_metadata_access=false |
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.
Nice! This way all unit tests will avoid trying to load the metadata. This is better than having to specify JdbcSettings.ALLOW_METADATA_ON_BOOT for each of them.
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.
yeah, separating unit and integration testings make lots of sense for they have different requirements and specialities. In the future we might introduce Hibernate's integration testing library (hibernate-testing) which only makes sense in integration testing context.
src/main/java/com/mongodb/hibernate/jdbc/MongoDatabaseMetaData.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mongodb/hibernate/jdbc/MongoDatabaseMetaData.java
Outdated
Show resolved
Hide resolved
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 last reviewed commit is b229a4d.
src/main/java/com/mongodb/hibernate/jdbc/MongoDatabaseMetaData.java
Outdated
Show resolved
Hide resolved
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 last reviewed commit is e74ee15.
https://jira.mongodb.org/browse/HIBERNATE-37
Most of the
java.sql.DatabaseMetaDataused by Hibernate is irrelevant to Mongo Dialect (vast majority is for DDL processing, which has no counterpart in Mongo Dialect; the only DDL in Mongo Dialect is for index and unique constraint creation in the last milestone), except for the following items:The mongoDB version might be used for future version-specific feature exploitation (e.g. new bulk write feature introduced since v8).
The current implementation is based on running
buildinfocommand toadmindatabase.Finally we could get rid of the deprecated default constructor of
MongoDialect.