-
Notifications
You must be signed in to change notification settings - Fork 57
Allow query syntax customization in TCK TestKit #138
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
Comments
We could extend the We've seen already folks asking for R2DBC store support that don't use SQL but rather a different query language. To verify their functionality, we would be required to abstract the statements anyway, so that sounds a decent proposal. |
+1 Since the query syntax is not part of the spec, it should be customizable for the purposes of the TestKit. Otherwise, we're forced to copy the tests and modify just the SQL line, and then worry about the test method body getting out of date with the upstream. |
TestKit now obtains statements to execute through TestStatement that allows overriding customization hooks. Driver-specific TCK adapters can customize doGetSql(…) for all types of statements. getInsertIntoWithAutogeneratedKey(…) and getCreateTableWithAutogeneratedKey(…) are now deprecated in favor of using expand(…) that expands potentially parametrized SQL statements. [closes #138]
This helps a lot, thank you! You can see the simplification to the Cloud Spanner TCK tests in GoogleCloudPlatform/cloud-spanner-r2dbc#270. We have to keep a few test overrides for two different reasons:
|
Thanks for having a look. I'm going to prepare the merge. I'm not sure about 2., whether we're on the same side. The verification about duplicate column names should verify that the resulting collection of column names |
Hmm. You think that Spanner driver should honor R2DBC contract (case insensitive retrieval by columns, first column definition wins in case |
Yes. JDBC's |
TestKit now obtains statements to execute through TestStatement that allows overriding customization hooks. Driver-specific TCK adapters can customize doGetSql(…) for all types of statements. getInsertIntoWithAutogeneratedKey(…) and getCreateTableWithAutogeneratedKey(…) are now deprecated in favor of using expand(…) that expands potentially parametrized SQL statements. [closes #138][#180]
The TestKit relies on a few common queries, such as
INSERT INTO test VALUES(200)
to exercise functionality.These queries could be extracted into templated/default methods, so that drivers implementing the TestKit could override just the querie , avoiding having to duplicate whole test cases that use these queries.
For context, Cloud Spanner requires that columns be enumerated, so we have to use
INSERT INTO test (value) VALUES(200)
instead ofINSERT INTO test VALUES(200)
.Not urgent; you can ignore this until after the 0.8 release. I'd just like to clean up our TestKit implementation at some point.
If you think this is a good idea, I can send a PR.
The text was updated successfully, but these errors were encountered: