-
Notifications
You must be signed in to change notification settings - Fork 29
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
Natively support multiple DML statements #92
Comments
Some more detail from in-person discussions: The place where we identified where we can use this is when for a single Statement the user has bound many sets of params. It is straightforward to use the Batch DML rpc method However, within a transaction we may have multiple Statements, and it is unclear how to group things into batches or know that there are multiple statements that need grouping (or even ordering as we do now). |
Another approach we could consider: If we could add a setting like
If we can ask for this feature to solve the read-only/read-write distinction (r2dbc/r2dbc-spi#98), we might be able to use that to solve this as well. Make a connection only able to run queries depending on what mode is set. |
@dzou Do you mind adding a comment to this effect on r2dbc/r2dbc-spi#98? |
@dzou Your idea is also to avoid parsing the SQL right? So if the setting is DDL we will use UpdateDatabaseDdl to run every single statement? And by "partitioned DML" do you mean batch DML ? |
Done.
EDIT: I was incorrect in the previous statement; batch DML is not the same as partitioned DML, they are 2 separate things. |
related r2dbc/r2dbc-spi#99 |
Cloud Spanner has several APIs for executing different, although somewhat overlapping, types of queries:
However, does NOT support DDL, and requires that DML statements arrive in order specified by
seqno
.In #87, using multiple
ExecuteStreamingSql
calls when executing parameterized DML queries was made possible by explicitly serializing the DML queries to ensure they arrive to Spanner in order. However, waiting for the network roundtrip for each statement is not ideal.Since we will have to detect the nature of each query no matter what implementation we choose (because Spanner has separate APIs for different query types), we should use
ExecuteBatchDml
to execute multiple DML queries.The text was updated successfully, but these errors were encountered: