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

Cloud native database compatibility #181

Open
corporatepiyush opened this issue Oct 21, 2017 · 9 comments
Open

Cloud native database compatibility #181

corporatepiyush opened this issue Oct 21, 2017 · 9 comments

Comments

@corporatepiyush
Copy link

Is it compatible with Google Cloud Spanner and CockroachDB ?

@Tapac
Copy link
Contributor

Tapac commented Oct 23, 2017

No. Noone asked for that, so there are no such dialects in Exposed. I mark this issue as a feature request, but can't give you any estimates.

@dmcg
Copy link

dmcg commented Apr 15, 2021

We are running against Cockroach using PostgreSQL drivers and things are fine. You may need to write code to automagically retry, as Cockroach bails out of many more transactions than Postgres

@Jerbell
Copy link
Contributor

Jerbell commented Oct 5, 2021

I'm trying to run our Postgres app against Cockroach. Not much success at the moment. Currently having problems with altering columns, altering columns with an index and collation. EDIT: Collation not precisly an exposed issue.

@matheusfrancisco
Copy link

matheusfrancisco commented Apr 3, 2022

Is there any progress in adding google cloud spanner support? I would like to help if it is possible.

@Tapac
Copy link
Contributor

Tapac commented Apr 10, 2022

@matheusfrancisco feel free to publish a PR with the GC Spanner support. Please use https://github.com/GoogleCloudPlatform/cloud-spanner-emulator for tests.

@lfgcampos
Copy link

Is there any progress in adding google cloud spanner support? I would like to help if it is possible.

Hi @matheusfrancisco, any news on this? I am also interested in exposed and Google cloud spanner support and could potentially help if there is an on going effort, if needed!

@marcosb
Copy link

marcosb commented Mar 2, 2023

+1 - would be great to see VendorDialect for com.google.cloud.spanner.jdbc.JdbcDriver

@marcosb
Copy link

marcosb commented Mar 2, 2023

FWIW, Database.registerJdbcDriver("jdbc:cloudspanner", "com.google.cloud.spanner.jdbc.JdbcDriver", PostgreSQLDialect.dialectName) probably gets something which is mostly functional for Cloud Spanner in the interim

@alex-shinn
Copy link

alex-shinn commented Jun 22, 2023

Attempting that workaround gives:

com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlFeatureNotSupportedException: Only isolation level TRANSACTION_SERIALIZABLE is supported

We can specify the transaction level but then get

Caused by: com.google.cloud.spanner.SpannerException: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Unsupported concurrency mode in query using INFORMATION_SCHEMA. - Statement: 'SELECT TABLE_CATALOG AS "TABLE_CAT", ...

Googling suggests setting auto-commit mode will help, but then my final attempt:

fun <T> dbTransaction(statement: Transaction.() -> T): T {
    return transaction(transactionIsolation = Connection.TRANSACTION_SERIALIZABLE, repetitionAttempts = 1, db = db) {
        connection.autoCommit = true
        statement()
    }
}

fails with

01:27:41.195 [main] WARN Exposed - Transaction rollback failed: database in auto-commit mode. See previous log line for statement                                                                                                   
java.sql.SQLException: database in auto-commit mode                                                               

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

8 participants