Uh oh!
There was an error while loading. Please reload this page.
spanner-jdbc: Step 16 - JdbcResultSet - #5891
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| /** Extract {@link java.sql.Types} code from Spanner {@link Type}. */ | ||
| static int extractColumnType(Type type) { | ||
| if (type.equals(Type.bool())) |
There was a problem hiding this comment.
I would either flip the equality here, or check for null and throw first.
There was a problem hiding this comment.
Same applies to further if statements in this file.
| } | ||
| private static final String RESULTSET_NOT_SUPPORTED = | ||
| "Getting a resultset from an array is not supported"; |
| JdbcPreconditions.checkArgument(start >= 1, "Start position must be >= 1"); | ||
| JdbcPreconditions.checkArgument(searchstr != null, "searchstr may not be null"); | ||
| checkPosition(start); | ||
| int res = value.indexOf(searchstr, (int) start - 1); |
There was a problem hiding this comment.
same applies to below usage of the parameter
| @@ -0,0 +1,267 @@ | |||
| /* | |||
There was a problem hiding this comment.
I think this was already done in step 13. Does it need a rebase?
There was a problem hiding this comment.
I based this PR on step 13 to avoid build errors. Once 13 is merged, this one should be rebased.
There was a problem hiding this comment.
It has now been rebased.
| @@ -0,0 +1,274 @@ | |||
| /* | |||
There was a problem hiding this comment.
think this was again already added
There was a problem hiding this comment.
I based this PR on step 13 to avoid build errors. Once 13 is merged, this one should be rebased.
Uh oh!
There was an error while loading. Please reload this page.
| @Test | ||
| public void testToString() { | ||
| assertNotNull(subject.toString()); |
There was a problem hiding this comment.
let's also assert what the string value is
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Codecov Report
@@ Coverage Diff @@## spanner-jdbc #5891 +/- ##
==================================================
- Coverage 46.12% 46.12% -0.01%
Complexity 24189 24189 ==================================================
Files 2456 2456 Lines 262236 262236 Branches 29602 29602 ==================================================
- Hits 120952 120949 -3 - Misses 132173 132176 +3
Partials 9111 9111
Continue to review full report at Codecov.
|
d463224 to
68a099cCompare* add jdbc types and type mappings for Cloud Spanner * update CR year * add jdbc ResultSet * added null checks and javadoc and fixed formatting * added missing checks for negative overflow and added test cases * fixed camel case * refactored if-statements into one, added actual check for toString * removed formatter hints * extracted to variable + added extra documentation
Adds
java.sql.ResultSetimplementation for Cloud Spanner. This is basically a wrapper around acom.google.cloud.spanner.ResultSet.(The branch of this PR is based on step 13. Step 13 has been merged and this PR has been rebased.)