Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@olavloite
Copy link

Adds a JDBC driver for Cloud Spanner.

olavloite and others added 30 commits July 23, 2019 17:51
* create jdbc project

* added spanner-jdbc to versions
add interfaces for client side statements
* create jdbc project

* added spanner-jdbc to versions

* add interfaces for client side statements

* changed prerequisiteStatements to examplePrequisiteStatements

* add generic connection interface

* changed to normal getter name
* add DirectExecuteResultSet

* readability: extracted numberOfParameters and firstParameterType to vars
* add ReplaceableForwardingResultSet

* fixed CR year

* added note for zero-based column indices + added vars for readability
* add StatementResultImpl

* added missing test cases for convenience methods
* add client side statement parser

* changed loops to a map lookup

* fixed spacing between variables and javadoc

* merge with spanner-jdbc

* changed lists to sets
…tion retries (#5876)

* add specific AbortedExceptions for failed tx retries

* updated CR year
…tions (#5881)

add base interface for unit of work on connections
…anner (#5877)

* add jdbc types and type mappings for Cloud Spanner

* update CR year

* changed name to getSpannerType

* simplified if statements and added curly braces to for loops
* add CredentialService

* updated CR year

* remove public visibility

* make getAppDefault overridable and mock this in the test

* removed 'internal' from private method name

* add error msg as constant

* removed custom httptransport
* add ConnectionOptions

* add SpannerPool

* removed auto-generated methods

* changed to get-and-check-for-null

get and check for null is more appropriate in this case, as we would
never want to return null from this method

* added documentation

* fixed wrong null check
* 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
* add ConnectionImpl

* fix CR year

* moved DdlClient creation to separate method

* updated changed class reference
* add ReadWriteTransaction

* refactor inner classes to separate files

* included allowed state to error msg

* added javadoc to the COMMIT and RUN BATCH statements

* removed todo no longer needed in public repo
* add DmlBatch

* updated CR year
* add jdbc connection implementation

* update CR year

* add warnings for ClientInfo
…tation (#5911)

* add jdbc Statement and PreparedStatement implementation

* updated CR year

* return successful/failed ddl statements

* changed variable names from x to value

* added missing test cases
* add DdlBatch

* return successful/failed DDL statements

* extracted update count extraction to a separate method
* add parameter store for jdbc parameters

* add null check

* added additional test statements

* added tests for null values in array and null-array
* add JdbcDriver

* add jdbc DataSource implementation

* removed information from test connection url
* add JdbcDatabaseMetadata

* added implementation for getUserName
…#5931)

* fixes compile errors, missing test classes and test failures

* updated CR years
kolea2 and others added 3 commits August 2, 2019 16:59
* change integration tests to use the Spanner IT test env

* add DDL integration tests

* add extra information on failure

* fix typo

* extract correct error code

* merge with spanner-jdbc
…ns and retries (#6003)

* add integration tests for transactions and retries

* add assertions that the values are actually written
@olavloite olavloite requested a review from kolea2 August 5, 2019 08:57
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2019
@olavloite olavloite added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 5, 2019
@olavloite olavloite marked this pull request as ready for review August 5, 2019 11:51
…ipts (#5999)

* change integration tests to use the Spanner IT test env

* use util method from verifier for reading sql statements from file

* integration tests hat are executed purely using sql scripts

* fixed typo's and removed unnecessary test statement
@codecov
Copy link

codecov bot commented Aug 5, 2019

Codecov Report

Merging #6007 into master will increase coverage by 0.22%.
The diff coverage is 72.12%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6007      +/-   ##
============================================
+ Coverage     46.79%   47.02%   +0.22%     
- Complexity    25663    27107    +1444     
============================================
  Files          2456     2516      +60     
  Lines        267638   273463    +5825     
  Branches      30559    31321     +762     
============================================
+ Hits         125245   128587    +3342     
- Misses       133133   134453    +1320     
- Partials       9260    10423    +1163
Impacted Files Coverage Δ Complexity Δ
...src/main/java/com/google/cloud/ServiceOptions.java 40.66% <ø> (+0.4%) 30 <0> (+1) ⬆️
.../com/google/cloud/spanner/jdbc/JdbcDataSource.java 0% <0%> (ø) 0 <0> (?)
...com/google/cloud/spanner/jdbc/StatementResult.java 100% <100%> (ø) 0 <0> (?)
...oogle/cloud/spanner/jdbc/ClientSideStatements.java 100% <100%> (ø) 4 <4> (?)
.../spanner/jdbc/ConnectionStatementExecutorImpl.java 100% <100%> (ø) 27 <27> (?)
...ud/spanner/jdbc/StatementExecutionInterceptor.java 100% <100%> (ø) 0 <0> (?)
...e/cloud/spanner/jdbc/TransactionRetryListener.java 100% <100%> (ø) 0 <0> (?)
...google/cloud/spanner/jdbc/StatementResultImpl.java 100% <100%> (ø) 20 <20> (?)
...com/google/cloud/spanner/jdbc/TransactionMode.java 100% <100%> (ø) 4 <4> (?)
...ogle/cloud/spanner/jdbc/JdbcParameterMetaData.java 15.27% <15.27%> (ø) 5 <5> (?)
... and 259 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73fbc45...0f3a523. Read the comment docs.

@@ -17,6 +17,7 @@
package com.google.cloud.spanner;

import com.google.api.core.ApiFunction;
import com.google.api.core.InternalApi;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bad merge here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the change to ServiceOptions had not been merged in. I'll add it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to ServiceOptions has been added.

kolea2 and others added 2 commits August 5, 2019 17:08
@kolea2 kolea2 changed the title Spanner: Add JDBC driver to google-cloud-contrib Spanner JDBC: Add Spanner JDBC driver to google-cloud-contrib Aug 5, 2019
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not merge yet

@kolea2 kolea2 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 5, 2019
@olavloite olavloite merged commit 48e062a into master Aug 5, 2019
@Neenu1995 Neenu1995 deleted the spanner-jdbc branch July 6, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants