-
Notifications
You must be signed in to change notification settings - Fork 4
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
validate mutation query results #47
Conversation
String sql = buildSQL(environment); | ||
ctx.setSQL(sql); | ||
LOGGER.info("SQL Executed:" + sql); | ||
|
||
ResultSet rs = null; | ||
Connection c = ctx.getConnection(); | ||
Statement stmt = c.createStatement(); | ||
Statement stmt = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); |
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.
why do you need to set this? this is an expensive operation also not all jdbc drivers support this
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.
Oops realized that now :/
I was trying to get the no. of rows returned after query execution to validate delete operation.
Assertions.assertEquals(create_expected_mutation,create_result.get(1)); | ||
Assertions.assertEquals(create_expected_sql, create_result.get(0)); | ||
|
||
String update_query = "mutation {\n" + |
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.
split into different test cases create, update, delete
d08e4c3
to
6a9ed42
Compare
I overlooked as we haven't used |
|
yes both are same. |
There is no condition in the "insert" SQL command, so it should not apply if you are only using for the "create" |
I thought defining a PK was mandatory.
After an insert, the select query uses the |
It is not mandatory, the implementation can choose to say we only want to support tables with PK, but that would be wrong IMO as we would not able to make them change the DDL for their databases. We just need to change how we are going to support that case.
By not allowing the top-level queries (only customer, not address) this case will be still true, As Customer will have the PK. |
Well in that case i will remove the PK from |
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.
LGTM
This PR contains (in reference #16) :