├── .github ├── snippet-bot.yml ├── release-trigger.yml ├── trusted-contribution.yml ├── blunderbuss.yml ├── generated-files-bot.yml ├── ISSUE_TEMPLATE │ ├── support_request.md │ ├── feature_request.md │ └── bug_report.md ├── CODEOWNERS ├── workflows │ ├── renovate_config_check.yaml │ ├── unmanaged_dependency_check.yaml │ ├── integration-tests-against-emulator.yaml │ ├── integration-tests-against-emulator-with-regular-session.yaml │ └── samples.yaml ├── auto-label.yaml ├── dependabot.yml └── PULL_REQUEST_TEMPLATE.md ├── codecov.yaml ├── google-cloud-spanner └── src │ ├── test │ ├── resources │ │ ├── com │ │ │ └── google │ │ │ │ └── cloud │ │ │ │ └── spanner │ │ │ │ ├── it │ │ │ │ ├── invalid │ │ │ │ │ ├── n_number_+1.json │ │ │ │ │ ├── n_number_-01.json │ │ │ │ │ ├── n_number_-2..json │ │ │ │ │ ├── n_number_.-1.json │ │ │ │ │ ├── n_number_0e+.json │ │ │ │ │ ├── n_number_0e.json │ │ │ │ │ ├── n_number_Inf.json │ │ │ │ │ ├── n_number_NaN.json │ │ │ │ │ ├── n_single_space.json │ │ │ │ │ ├── n_array_incomplete.json │ │ │ │ │ ├── n_array_just_comma.json │ │ │ │ │ ├── n_array_just_minus.json │ │ │ │ │ ├── n_array_star_inside.json │ │ │ │ │ ├── n_array_unclosed.json │ │ │ │ │ ├── n_incomplete_null.json │ │ │ │ │ ├── n_incomplete_true.json │ │ │ │ │ ├── n_number_++.json │ │ │ │ │ ├── n_number_+Inf.json │ │ │ │ │ ├── n_number_-1.0..json │ │ │ │ │ ├── n_number_-NaN.json │ │ │ │ │ ├── n_number_.2e-3.json │ │ │ │ │ ├── n_number_0.1.2.json │ │ │ │ │ ├── n_number_0.3e+.json │ │ │ │ │ ├── n_number_0.3e.json │ │ │ │ │ ├── n_number_0.e1.json │ │ │ │ │ ├── n_number_1.0e+.json │ │ │ │ │ ├── n_number_1.0e-.json │ │ │ │ │ ├── n_number_1.0e.json │ │ │ │ │ ├── n_number_1eE2.json │ │ │ │ │ ├── n_number_2.e+3.json │ │ │ │ │ ├── n_number_2.e-3.json │ │ │ │ │ ├── n_number_2.e3.json │ │ │ │ │ ├── n_number_9.e+.json │ │ │ │ │ ├── n_object_emoji.json │ │ │ │ │ ├── n_object_no-colon.json │ │ │ │ │ ├── n_structure_end_array.json │ │ │ │ │ ├── n_structure_no_data.json │ │ │ │ │ ├── n_array_double_comma.json │ │ │ │ │ ├── n_array_extra_close.json │ │ │ │ │ ├── n_array_extra_comma.json │ │ │ │ │ ├── n_incomplete_false.json │ │ │ │ │ ├── n_number_0_capital_E+.json │ │ │ │ │ ├── n_number_0_capital_E.json │ │ │ │ │ ├── n_number_1_000.json │ │ │ │ │ ├── n_number_expression.json │ │ │ │ │ ├── n_number_hex_1_digit.json │ │ │ │ │ ├── n_number_hex_2_digits.json │ │ │ │ │ ├── n_number_infinity.json │ │ │ │ │ ├── n_number_invalid+-.json │ │ │ │ │ ├── n_number_minus_space_1.json │ │ │ │ │ ├── n_number_with_alpha.json │ │ │ │ │ ├── n_object_missing_key.json │ │ │ │ │ ├── n_object_missing_value.json │ │ │ │ │ ├── n_string_backslash_00.json │ │ │ │ │ ├── n_string_escape_x.json │ │ │ │ │ ├── n_string_unescaped_tab.json │ │ │ │ │ ├── n_structure_open_object.json │ │ │ │ │ ├── n_structure_single_star.json │ │ │ │ │ ├── n_array_comma_after_close.json │ │ │ │ │ ├── n_array_comma_and_number.json │ │ │ │ │ ├── n_array_missing_value.json │ │ │ │ │ ├── n_array_number_and_comma.json │ │ │ │ │ ├── n_number_starting_with_dot.json │ │ │ │ │ ├── n_number_with_leading_zero.json │ │ │ │ │ ├── n_object_bad_value.json │ │ │ │ │ ├── n_object_double_colon.json │ │ │ │ │ ├── n_object_missing_colon.json │ │ │ │ │ ├── n_object_non_string_key.json │ │ │ │ │ ├── n_object_single_quote.json │ │ │ │ │ ├── n_object_trailing_comma.json │ │ │ │ │ ├── n_object_unquoted_key.json │ │ │ │ │ ├── n_string_escaped_emoji.json │ │ │ │ │ ├── n_string_incomplete_escape.json │ │ │ │ │ ├── n_string_single_doublequote.json │ │ │ │ │ ├── n_structure_UTF8_BOM_no_data.json │ │ │ │ │ ├── n_structure_angle_bracket_..json │ │ │ │ │ ├── n_structure_double_array.json │ │ │ │ │ ├── n_structure_lone-open-bracket.json │ │ │ │ │ ├── n_structure_open_array_comma.json │ │ │ │ │ ├── n_structure_open_object_comma.json │ │ │ │ │ ├── n_structure_unclosed_array.json │ │ │ │ │ ├── n_structure_unicode-identifier.json │ │ │ │ │ ├── n_array_1_true_without_comma.json │ │ │ │ │ ├── n_array_colon_instead_of_comma.json │ │ │ │ │ ├── n_array_double_extra_comma.json │ │ │ │ │ ├── n_array_incomplete_invalid_value.json │ │ │ │ │ ├── n_array_inner_array_no_comma.json │ │ │ │ │ ├── n_array_unclosed_trailing_comma.json │ │ │ │ │ ├── n_number_minus_infinity.json │ │ │ │ │ ├── n_number_neg_with_garbage_at_end.json │ │ │ │ │ ├── n_number_real_garbage_after_e.json │ │ │ │ │ ├── n_object_bracket_key.json │ │ │ │ │ ├── n_object_garbage_at_end.json │ │ │ │ │ ├── n_object_missing_semicolon.json │ │ │ │ │ ├── n_object_unterminated-value.json │ │ │ │ │ ├── n_string_escaped_backslash_bad.json │ │ │ │ │ ├── n_string_escaped_ctrl_char_tab.json │ │ │ │ │ ├── n_string_invalid_backslash_esc.json │ │ │ │ │ ├── n_string_single_quote.json │ │ │ │ │ ├── n_string_start_escape_unclosed.json │ │ │ │ │ ├── n_string_unescaped_ctrl_char.json │ │ │ │ │ ├── n_string_unicode_CapitalU.json │ │ │ │ │ ├── n_string_with_trailing_garbage.json │ │ │ │ │ ├── n_structure_U+2060_word_joined.json │ │ │ │ │ ├── n_structure_capitalized_True.json │ │ │ │ │ ├── n_structure_close_unopened_array.json │ │ │ │ │ ├── n_structure_open_array_apostrophe.json │ │ │ │ │ ├── n_structure_open_array_open_object.json │ │ │ │ │ ├── n_structure_open_array_open_string.json │ │ │ │ │ ├── n_structure_open_array_string.json │ │ │ │ │ ├── n_structure_open_object_close_array.json │ │ │ │ │ ├── n_structure_open_object_open_array.json │ │ │ │ │ ├── n_structure_open_open.json │ │ │ │ │ ├── n_structure_trailing_#.json │ │ │ │ │ ├── n_structure_whitespace_formfeed.json │ │ │ │ │ ├── n_array_items_separated_by_semicolon.json │ │ │ │ │ ├── n_array_number_and_several_commas.json │ │ │ │ │ ├── n_array_unclosed_with_object_inside.json │ │ │ │ │ ├── n_number_U+FF11_fullwidth_digit_one.json │ │ │ │ │ ├── n_number_neg_int_starting_with_zero.json │ │ │ │ │ ├── n_number_neg_real_without_int_part.json │ │ │ │ │ ├── n_number_real_without_fractional_part.json │ │ │ │ │ ├── n_object_comma_instead_of_colon.json │ │ │ │ │ ├── n_object_trailing_comment.json │ │ │ │ │ ├── n_object_with_trailing_garbage.json │ │ │ │ │ ├── n_string_accentuated_char_no_quotes.json │ │ │ │ │ ├── n_string_invalid_unicode_escape.json │ │ │ │ │ ├── n_string_no_quotes_with_bad_escape.json │ │ │ │ │ ├── n_string_single_string_no_double_quotes.json │ │ │ │ │ ├── n_string_unescaped_newline.json │ │ │ │ │ ├── n_structure_angle_bracket_null.json │ │ │ │ │ ├── n_structure_array_trailing_garbage.json │ │ │ │ │ ├── n_structure_ascii-unicode-identifier.json │ │ │ │ │ ├── n_structure_null-byte-outside-string.json │ │ │ │ │ ├── n_structure_number_with_trailing_garbage.json │ │ │ │ │ ├── n_structure_object_unclosed_no_value.json │ │ │ │ │ ├── n_structure_open_object_open_string.json │ │ │ │ │ ├── n_structure_unclosed_object.json │ │ │ │ │ ├── n_array_newlines_unclosed.json │ │ │ │ │ ├── n_array_spaces_vertical_tab_formfeed.json │ │ │ │ │ ├── n_array_unclosed_with_new_lines.json │ │ │ │ │ ├── n_number_invalid-negative-real.json │ │ │ │ │ ├── n_number_minus_sign_with_trailing_garbage.json │ │ │ │ │ ├── n_object_key_with_single_quotes.json │ │ │ │ │ ├── n_object_several_trailing_commas.json │ │ │ │ │ ├── n_object_trailing_comment_open.json │ │ │ │ │ ├── n_object_trailing_comment_slash_open.json │ │ │ │ │ ├── n_object_two_commas_in_a_row.json │ │ │ │ │ ├── n_string_1_surrogate_then_escape.json │ │ │ │ │ ├── n_string_1_surrogate_then_escape_u.json │ │ │ │ │ ├── n_string_incomplete_escaped_character.json │ │ │ │ │ ├── n_string_incomplete_surrogate.json │ │ │ │ │ ├── n_structure_array_with_extra_array_close.json │ │ │ │ │ ├── n_structure_array_with_unclosed_string.json │ │ │ │ │ ├── n_structure_uescaped_LF_before_string.json │ │ │ │ │ ├── n_structure_whitespace_U+2060_word_joiner.json │ │ │ │ │ ├── n_number_with_alpha_char.json │ │ │ │ │ ├── n_object_repeated_null_null.json │ │ │ │ │ ├── n_object_with_single_string.json │ │ │ │ │ ├── n_string_1_surrogate_then_escape_u1.json │ │ │ │ │ ├── n_string_1_surrogate_then_escape_u1x.json │ │ │ │ │ ├── n_string_leading_uescaped_thinspace.json │ │ │ │ │ ├── n_structure_object_followed_by_closing_object.json │ │ │ │ │ ├── n_structure_object_with_comment.json │ │ │ │ │ ├── n_structure_open_object_string_with_apostrophes.json │ │ │ │ │ ├── n_structure_unclosed_array_partial_null.json │ │ │ │ │ ├── n_object_trailing_comment_slash_open_incomplete.json │ │ │ │ │ ├── n_structure_comma_instead_of_closing_brace.json │ │ │ │ │ ├── n_structure_object_with_trailing_garbage.json │ │ │ │ │ ├── n_structure_unclosed_array_unfinished_false.json │ │ │ │ │ ├── n_structure_unclosed_array_unfinished_true.json │ │ │ │ │ ├── n_object_non_string_key_but_huge_number_instead.json │ │ │ │ │ ├── n_string_incomplete_surrogate_escape_invalid.json │ │ │ │ │ ├── n_array_invalid_utf8.json │ │ │ │ │ ├── n_array_a_invalid_utf8.json │ │ │ │ │ ├── n_structure_single_eacute.json │ │ │ │ │ ├── n_number_invalid-utf-8-in-int.json │ │ │ │ │ ├── n_structure_incomplete_UTF8_BOM.json │ │ │ │ │ ├── n_structure_lone-invalid-utf-8.json │ │ │ │ │ ├── n_string_invalid-utf-8-in-escape.json │ │ │ │ │ ├── n_number_invalid-utf-8-in-bigger-int.json │ │ │ │ │ ├── n_number_invalid-utf-8-in-exponent.json │ │ │ │ │ ├── n_string_invalid_utf8_after_escape.json │ │ │ │ │ ├── n_number_real_with_invalid_utf8_after_e.json │ │ │ │ │ └── n_object_lone_continuation_byte_in_key_and_trailing_comma.json │ │ │ │ └── valid │ │ │ │ │ ├── y_array_empty.json │ │ │ │ │ ├── y_array_null.json │ │ │ │ │ ├── y_number.json │ │ │ │ │ ├── y_number_0e+1.json │ │ │ │ │ ├── y_number_0e1.json │ │ │ │ │ ├── y_object_empty.json │ │ │ │ │ ├── y_string_pi.json │ │ │ │ │ ├── y_string_space.json │ │ │ │ │ ├── y_array_empty-string.json │ │ │ │ │ ├── y_array_false.json │ │ │ │ │ ├── y_number_after_space.json │ │ │ │ │ ├── y_number_minus_zero.json │ │ │ │ │ ├── y_number_simple_int.json │ │ │ │ │ ├── y_object_empty_key.json │ │ │ │ │ ├── y_object_simple.json │ │ │ │ │ ├── y_string_in_array.json │ │ │ │ │ ├── y_string_utf8.json │ │ │ │ │ ├── y_structure_lonely_int.json │ │ │ │ │ ├── y_number_int_with_exp.json │ │ │ │ │ ├── y_number_negative_int.json │ │ │ │ │ ├── y_number_negative_one.json │ │ │ │ │ ├── y_number_negative_zero.json │ │ │ │ │ ├── y_number_real_capital_e.json │ │ │ │ │ ├── y_number_real_neg_exp.json │ │ │ │ │ ├── y_object_basic.json │ │ │ │ │ ├── y_string_simple_ascii.json │ │ │ │ │ ├── y_string_u+2028_line_sep.json │ │ │ │ │ ├── y_string_u+2029_par_sep.json │ │ │ │ │ ├── y_string_unicode.json │ │ │ │ │ ├── y_string_unicode_2.json │ │ │ │ │ ├── y_structure_lonely_false.json │ │ │ │ │ ├── y_structure_lonely_null.json │ │ │ │ │ ├── y_structure_lonely_true.json │ │ │ │ │ ├── y_structure_string_empty.json │ │ │ │ │ ├── y_array_arraysWithSpaces.json │ │ │ │ │ ├── y_array_ending_with_newline.json │ │ │ │ │ ├── y_array_with_1_and_newline.json │ │ │ │ │ ├── y_array_with_leading_space.json │ │ │ │ │ ├── y_array_with_trailing_space.json │ │ │ │ │ ├── y_number_real_exponent.json │ │ │ │ │ ├── y_number_real_pos_exponent.json │ │ │ │ │ ├── y_number_simple_real.json │ │ │ │ │ ├── y_object.json │ │ │ │ │ ├── y_string_comments.json │ │ │ │ │ ├── y_string_double_escape_a.json │ │ │ │ │ ├── y_string_double_escape_n.json │ │ │ │ │ ├── y_string_null_escape.json │ │ │ │ │ ├── y_string_one-byte-utf-8.json │ │ │ │ │ ├── y_string_two-byte-utf-8.json │ │ │ │ │ ├── y_string_with_del_character.json │ │ │ │ │ ├── y_structure_lonely_string.json │ │ │ │ │ ├── y_structure_true_in_array.json │ │ │ │ │ ├── y_structure_whitespace_array.json │ │ │ │ │ ├── y_array_heterogeneous.json │ │ │ │ │ ├── y_number_real_capital_e_neg_exp.json │ │ │ │ │ ├── y_number_real_capital_e_pos_exp.json │ │ │ │ │ ├── y_string_backslash_doublequotes.json │ │ │ │ │ ├── y_string_escaped_noncharacter.json │ │ │ │ │ ├── y_string_nbsp_uescaped.json │ │ │ │ │ ├── y_string_three-byte-utf-8.json │ │ │ │ │ ├── y_string_unescaped_char_delete.json │ │ │ │ │ ├── y_structure_lonely_negative_real.json │ │ │ │ │ ├── y_structure_trailing_newline.json │ │ │ │ │ ├── y_number_real_fraction_exponent.json │ │ │ │ │ ├── y_object_duplicated_key.json │ │ │ │ │ ├── y_object_with_newlines.json │ │ │ │ │ ├── y_string_allowed_escapes.json │ │ │ │ │ ├── y_string_escaped_control_character.json │ │ │ │ │ ├── y_string_in_array_with_leading_space.json │ │ │ │ │ ├── y_string_nonCharacterInUTF-8_U+10FFFF.json │ │ │ │ │ ├── y_string_nonCharacterInUTF-8_U+FFFF.json │ │ │ │ │ ├── y_string_uEscape.json │ │ │ │ │ ├── y_string_uescaped_newline.json │ │ │ │ │ ├── y_string_unicodeEscapedBackslash.json │ │ │ │ │ ├── y_string_unicode_U+FDD0_nonchar.json │ │ │ │ │ ├── y_string_unicode_U+FFFE_nonchar.json │ │ │ │ │ ├── y_array_with_several_null.json │ │ │ │ │ ├── y_object_escaped_null_in_key.json │ │ │ │ │ ├── y_string_accepted_surrogate_pair.json │ │ │ │ │ ├── y_string_backslash_and_u_escaped_zero.json │ │ │ │ │ ├── y_string_last_surrogates_1_and_2.json │ │ │ │ │ ├── y_string_reservedCharacterInUTF-8_U+1BFFF.json │ │ │ │ │ ├── y_string_unicode_U+10FFFE_nonchar.json │ │ │ │ │ ├── y_string_unicode_U+1FFFE_nonchar.json │ │ │ │ │ ├── y_string_unicode_U+2064_invisible_plus.json │ │ │ │ │ ├── y_string_unicode_escaped_double_quote.json │ │ │ │ │ ├── y_object_duplicated_key_and_value.json │ │ │ │ │ ├── y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json │ │ │ │ │ ├── y_object_extreme_numbers.json │ │ │ │ │ ├── y_string_1_2_3_bytes_UTF-8_sequences.json │ │ │ │ │ ├── y_string_accepted_surrogate_pairs.json │ │ │ │ │ ├── y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json │ │ │ │ │ ├── y_number_double_close_to_zero.json │ │ │ │ │ ├── y_object_long_strings.json │ │ │ │ │ ├── y_object_string_unicode.json │ │ │ │ │ └── y_80_nested.json │ │ │ │ ├── descriptors.pb │ │ │ │ ├── README.md │ │ │ │ ├── singer.proto │ │ │ │ ├── jmh │ │ │ │ └── jmh-baseline.json │ │ │ │ └── connection │ │ │ │ ├── ITReadOnlySpannerTest_CreateTables.sql │ │ │ │ └── ITSqlScriptTest_TestInvalidStatements.sql │ │ ├── META-INF │ │ │ └── native-image │ │ │ │ └── com.google.cloud │ │ │ │ └── google-cloud-spanner │ │ │ │ └── native-image.properties │ │ └── logging.properties │ └── java │ │ └── com │ │ └── google │ │ └── cloud │ │ └── spanner │ │ ├── IntegrationTest.java │ │ ├── SerialIntegrationTest.java │ │ ├── SlowTest.java │ │ ├── ParallelIntegrationTest.java │ │ ├── ReadFormatTest.java │ │ ├── SpannerOptionsTestHelper.java │ │ ├── TestHelper.java │ │ ├── JavaVersionUtil.java │ │ ├── connection │ │ ├── ITConnectionImpl.java │ │ ├── TestChannelProvider.java │ │ ├── NoopEndTransactionCallback.java │ │ ├── Repeat.java │ │ ├── SetReadOnlyStalenessSqlScriptTest.java │ │ └── SetStatementTimeoutSqlScriptTest.java │ │ ├── SpannerOptionsHelper.java │ │ ├── TestEnvConfig.java │ │ ├── FlakyTest.java │ │ ├── FakeClock.java │ │ ├── TracerTest.java │ │ └── ForceCloseSpannerFunction.java │ └── main │ ├── resources │ └── META-INF │ │ └── native-image │ │ ├── native-image.properties │ │ └── resource-config.json │ └── java │ └── com │ └── google │ └── cloud │ └── spanner │ ├── package-info.java │ ├── connection │ ├── package-info.java │ ├── DialectNamespaceMapper.java │ ├── PartitionedQueryResultSet.java │ ├── ClientSideStatementValueConverter.java │ └── DdlInTransactionMode.java │ ├── SpannerFactory.java │ ├── encryption │ ├── BackupEncryptionConfig.java │ ├── RestoreEncryptionConfig.java │ ├── UseBackupEncryption.java │ ├── GoogleDefaultEncryption.java │ └── UseDatabaseEncryption.java │ ├── spi │ └── SpannerRpcFactory.java │ ├── IScope.java │ ├── IsSslHandshakeException.java │ ├── Clock.java │ ├── OpenCensusScope.java │ ├── OpenTelemetryScope.java │ ├── StreamingUtil.java │ ├── OpenTelemetryContextKeys.java │ ├── LazySpannerInitializer.java │ ├── StreamingResultSet.java │ ├── DecodeMode.java │ ├── RetryOnDifferentGrpcChannelException.java │ ├── testing │ └── EmulatorSpannerHelper.java │ ├── BuiltInMetricsView.java │ └── SpannerBatchUpdateException.java ├── samples ├── snippets │ └── src │ │ ├── main │ │ └── resources │ │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── io.grpc.LoadBalancerProvider │ │ │ └── com │ │ │ └── example │ │ │ └── spanner │ │ │ ├── descriptors.pb │ │ │ ├── README.md │ │ │ └── singer.proto │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── spanner │ │ ├── ListDatabasesIT.java │ │ ├── CreateInstanceWithAutoscalingConfigSampleIT.java │ │ ├── admin │ │ └── archived │ │ │ ├── GetInstanceConfigSampleIT.java │ │ │ └── ListInstanceConfigsSampleIT.java │ │ └── CreateInstanceWithProcessingUnitsSampleIT.java └── README.md ├── .kokoro ├── nightly │ ├── java8-osx.cfg │ ├── java11.cfg │ ├── java8.cfg │ ├── integration-cloud-devel.cfg │ ├── integration-cloud-staging.cfg │ ├── integration-cloud-devel-directpath-enabled.cfg │ ├── integration-cloud-staging-directpath-enabled.cfg │ ├── common.cfg │ ├── samples.cfg │ ├── java8-samples.cfg │ ├── java11-samples.cfg │ ├── java11-integration.cfg │ ├── integration.cfg │ ├── java11-samples-slow-tests.cfg │ ├── slow-tests.cfg │ └── integration-directpath-enabled.cfg ├── presubmit │ ├── dependencies.cfg │ ├── integration.cfg │ ├── samples.cfg │ ├── common.cfg │ ├── integration-directpath-enabled.cfg │ ├── graalvm-native-a.cfg │ ├── graalvm-native-b.cfg │ ├── graalvm-native-c.cfg │ └── integration-regular-sessions-enabled.cfg ├── common.cfg ├── continuous │ ├── integration-cloud-devel.cfg │ ├── integration-cloud-staging.cfg │ ├── common.cfg │ ├── integration-cloud-devel-directpath-enabled.cfg │ └── integration-cloud-staging-directpath-enabled.cfg ├── build.bat ├── trampoline.sh └── coerce_logs.sh ├── google-cloud-spanner-executor ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── io.grpc.LoadBalancerProvider │ │ └── java │ │ └── com │ │ └── google │ │ └── cloud │ │ └── spanner │ │ └── executor │ │ └── v1 │ │ └── gapic_metadata.json ├── README.md └── clirr-ignored-differences.xml ├── .devcontainer ├── postCreate.sh └── devcontainer.json ├── git-hooks └── pre-commit ├── SECURITY.md ├── license-checks.xml ├── grpc-google-cloud-spanner-admin-database-v1 └── clirr-ignored-differences.xml ├── grpc-google-cloud-spanner-admin-instance-v1 └── clirr-ignored-differences.xml ├── .gitignore ├── license_file ├── java.header ├── versions.txt ├── benchmarks └── src │ └── main │ └── java │ └── com │ └── google │ └── cloud │ └── spanner │ ├── benchmark │ └── BenchmarkRunner.java │ └── SessionPoolOptionsHelper.java ├── proto-google-cloud-spanner-admin-database-v1 └── src │ └── main │ └── java │ └── com │ └── google │ └── spanner │ └── admin │ └── database │ └── v1 │ ├── FullBackupSpecOrBuilder.java │ ├── IncrementalBackupSpecOrBuilder.java │ ├── AddSplitPointsResponseOrBuilder.java │ └── InternalUpdateGraphOperationResponseOrBuilder.java ├── proto-google-cloud-spanner-admin-instance-v1 └── src │ └── main │ └── java │ └── com │ └── google │ └── spanner │ └── admin │ └── instance │ └── v1 │ └── MoveInstanceResponseOrBuilder.java ├── .repo-metadata.json ├── proto-google-cloud-spanner-executor-v1 └── src │ └── main │ └── java │ └── com │ └── google │ └── spanner │ └── executor │ └── v1 │ ├── CloseBatchTransactionActionOrBuilder.java │ ├── TransactionExecutionOptionsOrBuilder.java │ └── SessionPoolOptionsOrBuilder.java └── releases.txt /.github/snippet-bot.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/release-trigger.yml: -------------------------------------------------------------------------------- 1 | enabled: true 2 | multiScmName: java-spanner 3 | -------------------------------------------------------------------------------- /codecov.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | codecov: 3 | ci: 4 | - source.cloud.google.com 5 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_+1.json: -------------------------------------------------------------------------------- 1 | [+1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_-01.json: -------------------------------------------------------------------------------- 1 | [-01] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_-2..json: -------------------------------------------------------------------------------- 1 | [-2.] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_.-1.json: -------------------------------------------------------------------------------- 1 | [.-1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0e+.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0e.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_Inf.json: -------------------------------------------------------------------------------- 1 | [Inf] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_NaN.json: -------------------------------------------------------------------------------- 1 | [NaN] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_single_space.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_empty.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_null.json: -------------------------------------------------------------------------------- 1 | [null] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number.json: -------------------------------------------------------------------------------- 1 | [123e65] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_0e+1.json: -------------------------------------------------------------------------------- 1 | [0e+1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_0e1.json: -------------------------------------------------------------------------------- 1 | [0e1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_empty.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_pi.json: -------------------------------------------------------------------------------- 1 | ["π"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_space.json: -------------------------------------------------------------------------------- 1 | " " -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_incomplete.json: -------------------------------------------------------------------------------- 1 | ["x" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_just_comma.json: -------------------------------------------------------------------------------- 1 | [,] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_just_minus.json: -------------------------------------------------------------------------------- 1 | [-] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_star_inside.json: -------------------------------------------------------------------------------- 1 | [*] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_unclosed.json: -------------------------------------------------------------------------------- 1 | ["" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_incomplete_null.json: -------------------------------------------------------------------------------- 1 | [nul] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_incomplete_true.json: -------------------------------------------------------------------------------- 1 | [tru] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_++.json: -------------------------------------------------------------------------------- 1 | [++1234] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_+Inf.json: -------------------------------------------------------------------------------- 1 | [+Inf] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_-1.0..json: -------------------------------------------------------------------------------- 1 | [-1.0.] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_-NaN.json: -------------------------------------------------------------------------------- 1 | [-NaN] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_.2e-3.json: -------------------------------------------------------------------------------- 1 | [.2e-3] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0.1.2.json: -------------------------------------------------------------------------------- 1 | [0.1.2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0.3e+.json: -------------------------------------------------------------------------------- 1 | [0.3e+] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0.3e.json: -------------------------------------------------------------------------------- 1 | [0.3e] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0.e1.json: -------------------------------------------------------------------------------- 1 | [0.e1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_1.0e+.json: -------------------------------------------------------------------------------- 1 | [1.0e+] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_1.0e-.json: -------------------------------------------------------------------------------- 1 | [1.0e-] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_1.0e.json: -------------------------------------------------------------------------------- 1 | [1.0e] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_1eE2.json: -------------------------------------------------------------------------------- 1 | [1eE2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_2.e+3.json: -------------------------------------------------------------------------------- 1 | [2.e+3] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_2.e-3.json: -------------------------------------------------------------------------------- 1 | [2.e-3] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_2.e3.json: -------------------------------------------------------------------------------- 1 | [2.e3] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_9.e+.json: -------------------------------------------------------------------------------- 1 | [9.e+] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_emoji.json: -------------------------------------------------------------------------------- 1 | {🇨🇭} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_no-colon.json: -------------------------------------------------------------------------------- 1 | {"a" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_end_array.json: -------------------------------------------------------------------------------- 1 | ] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_empty-string.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_false.json: -------------------------------------------------------------------------------- 1 | [false] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_after_space.json: -------------------------------------------------------------------------------- 1 | [ 4] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_minus_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_simple_int.json: -------------------------------------------------------------------------------- 1 | [123] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_empty_key.json: -------------------------------------------------------------------------------- 1 | {"":0} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_simple.json: -------------------------------------------------------------------------------- 1 | {"a":[]} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_in_array.json: -------------------------------------------------------------------------------- 1 | ["asd"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_utf8.json: -------------------------------------------------------------------------------- 1 | ["€𝄞"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_int.json: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_double_comma.json: -------------------------------------------------------------------------------- 1 | [1,,2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_extra_close.json: -------------------------------------------------------------------------------- 1 | ["x"]] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["",] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_incomplete_false.json: -------------------------------------------------------------------------------- 1 | [fals] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0_capital_E+.json: -------------------------------------------------------------------------------- 1 | [0E+] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_0_capital_E.json: -------------------------------------------------------------------------------- 1 | [0E] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_1_000.json: -------------------------------------------------------------------------------- 1 | [1 000.0] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_expression.json: -------------------------------------------------------------------------------- 1 | [1+2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_hex_1_digit.json: -------------------------------------------------------------------------------- 1 | [0x1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_hex_2_digits.json: -------------------------------------------------------------------------------- 1 | [0x42] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_infinity.json: -------------------------------------------------------------------------------- 1 | [Infinity] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid+-.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_minus_space_1.json: -------------------------------------------------------------------------------- 1 | [- 1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_with_alpha.json: -------------------------------------------------------------------------------- 1 | [1.2a-3] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_missing_key.json: -------------------------------------------------------------------------------- 1 | {:"b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_missing_value.json: -------------------------------------------------------------------------------- 1 | {"a": -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_backslash_00.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_escape_x.json: -------------------------------------------------------------------------------- 1 | ["\x00"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_unescaped_tab.json: -------------------------------------------------------------------------------- 1 | [" "] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object.json: -------------------------------------------------------------------------------- 1 | { -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_single_star.json: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_int_with_exp.json: -------------------------------------------------------------------------------- 1 | [20e1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_negative_int.json: -------------------------------------------------------------------------------- 1 | [-123] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_negative_one.json: -------------------------------------------------------------------------------- 1 | [-1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_negative_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_capital_e.json: -------------------------------------------------------------------------------- 1 | [1E22] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1e-2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_basic.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_simple_ascii.json: -------------------------------------------------------------------------------- 1 | ["asd "] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_u+2028_line_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_u+2029_par_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode.json: -------------------------------------------------------------------------------- 1 | ["\uA66D"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_2.json: -------------------------------------------------------------------------------- 1 | ["⍂㈴⍂"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_false.json: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_null.json: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_true.json: -------------------------------------------------------------------------------- 1 | true -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_string_empty.json: -------------------------------------------------------------------------------- 1 | "" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_comma_after_close.json: -------------------------------------------------------------------------------- 1 | [""], -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_comma_and_number.json: -------------------------------------------------------------------------------- 1 | [,1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_missing_value.json: -------------------------------------------------------------------------------- 1 | [ , ""] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_number_and_comma.json: -------------------------------------------------------------------------------- 1 | [1,] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_starting_with_dot.json: -------------------------------------------------------------------------------- 1 | [.123] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_with_leading_zero.json: -------------------------------------------------------------------------------- 1 | [012] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_bad_value.json: -------------------------------------------------------------------------------- 1 | ["x", truth] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_double_colon.json: -------------------------------------------------------------------------------- 1 | {"x"::"b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_missing_colon.json: -------------------------------------------------------------------------------- 1 | {"a" b} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_non_string_key.json: -------------------------------------------------------------------------------- 1 | {1:1} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_single_quote.json: -------------------------------------------------------------------------------- 1 | {'a':0} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_trailing_comma.json: -------------------------------------------------------------------------------- 1 | {"id":0,} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_unquoted_key.json: -------------------------------------------------------------------------------- 1 | {a: "b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_escaped_emoji.json: -------------------------------------------------------------------------------- 1 | ["\🌀"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_incomplete_escape.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_single_doublequote.json: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_UTF8_BOM_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_angle_bracket_..json: -------------------------------------------------------------------------------- 1 | <.> -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_double_array.json: -------------------------------------------------------------------------------- 1 | [][] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_lone-open-bracket.json: -------------------------------------------------------------------------------- 1 | [ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_array_comma.json: -------------------------------------------------------------------------------- 1 | [, -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object_comma.json: -------------------------------------------------------------------------------- 1 | {, -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unclosed_array.json: -------------------------------------------------------------------------------- 1 | [1 -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unicode-identifier.json: -------------------------------------------------------------------------------- 1 | å -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_arraysWithSpaces.json: -------------------------------------------------------------------------------- 1 | [[] ] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_ending_with_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_with_1_and_newline.json: -------------------------------------------------------------------------------- 1 | [1 2 | ] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_with_trailing_space.json: -------------------------------------------------------------------------------- 1 | [2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_exponent.json: -------------------------------------------------------------------------------- 1 | [123e45] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_pos_exponent.json: -------------------------------------------------------------------------------- 1 | [1e+2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_simple_real.json: -------------------------------------------------------------------------------- 1 | [123.456789] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf", "dfg":"fgh"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_comments.json: -------------------------------------------------------------------------------- 1 | ["a/*b*/c/*d//e"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_double_escape_a.json: -------------------------------------------------------------------------------- 1 | ["\\a"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_double_escape_n.json: -------------------------------------------------------------------------------- 1 | ["\\n"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_null_escape.json: -------------------------------------------------------------------------------- 1 | ["\u0000"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_one-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u002c"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_two-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0123"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_with_del_character.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_string.json: -------------------------------------------------------------------------------- 1 | "asd" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_true_in_array.json: -------------------------------------------------------------------------------- 1 | [true] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_whitespace_array.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_1_true_without_comma.json: -------------------------------------------------------------------------------- 1 | [1 true] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_colon_instead_of_comma.json: -------------------------------------------------------------------------------- 1 | ["": 1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_double_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["x",,] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_incomplete_invalid_value.json: -------------------------------------------------------------------------------- 1 | [x -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_inner_array_no_comma.json: -------------------------------------------------------------------------------- 1 | [3[4]] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_unclosed_trailing_comma.json: -------------------------------------------------------------------------------- 1 | [1, -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_minus_infinity.json: -------------------------------------------------------------------------------- 1 | [-Infinity] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_neg_with_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | [-1x] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_real_garbage_after_e.json: -------------------------------------------------------------------------------- 1 | [1ea] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_bracket_key.json: -------------------------------------------------------------------------------- 1 | {[: "x"} 2 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | {"a":"a" 123} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_missing_semicolon.json: -------------------------------------------------------------------------------- 1 | {"a" "b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_unterminated-value.json: -------------------------------------------------------------------------------- 1 | {"a":"a -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_escaped_backslash_bad.json: -------------------------------------------------------------------------------- 1 | ["\\\"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_escaped_ctrl_char_tab.json: -------------------------------------------------------------------------------- 1 | ["\ "] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid_backslash_esc.json: -------------------------------------------------------------------------------- 1 | ["\a"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_single_quote.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_start_escape_unclosed.json: -------------------------------------------------------------------------------- 1 | ["\ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_unescaped_ctrl_char.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_unicode_CapitalU.json: -------------------------------------------------------------------------------- 1 | "\UA66D" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | ""x -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_U+2060_word_joined.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_capitalized_True.json: -------------------------------------------------------------------------------- 1 | [True] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_close_unopened_array.json: -------------------------------------------------------------------------------- 1 | 1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_array_apostrophe.json: -------------------------------------------------------------------------------- 1 | [' -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_array_open_object.json: -------------------------------------------------------------------------------- 1 | [{ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_array_open_string.json: -------------------------------------------------------------------------------- 1 | ["a -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_array_string.json: -------------------------------------------------------------------------------- 1 | ["a" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object_close_array.json: -------------------------------------------------------------------------------- 1 | {] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object_open_array.json: -------------------------------------------------------------------------------- 1 | {[ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_open.json: -------------------------------------------------------------------------------- 1 | ["\{["\{["\{["\{ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_trailing_#.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}#{} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_whitespace_formfeed.json: -------------------------------------------------------------------------------- 1 | [ ] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_heterogeneous.json: -------------------------------------------------------------------------------- 1 | [null, 1, "1", {}] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_capital_e_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1E-2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_capital_e_pos_exp.json: -------------------------------------------------------------------------------- 1 | [1E+2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_backslash_doublequotes.json: -------------------------------------------------------------------------------- 1 | ["\""] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_escaped_noncharacter.json: -------------------------------------------------------------------------------- 1 | ["\uFFFF"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_nbsp_uescaped.json: -------------------------------------------------------------------------------- 1 | ["new\u00A0line"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_three-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0821"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unescaped_char_delete.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_lonely_negative_real.json: -------------------------------------------------------------------------------- 1 | -0.1 -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_structure_trailing_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] 2 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_items_separated_by_semicolon.json: -------------------------------------------------------------------------------- 1 | [1:2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_number_and_several_commas.json: -------------------------------------------------------------------------------- 1 | [1,,] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_unclosed_with_object_inside.json: -------------------------------------------------------------------------------- 1 | [{} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_U+FF11_fullwidth_digit_one.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_neg_int_starting_with_zero.json: -------------------------------------------------------------------------------- 1 | [-012] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_neg_real_without_int_part.json: -------------------------------------------------------------------------------- 1 | [-.123] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_real_without_fractional_part.json: -------------------------------------------------------------------------------- 1 | [1.] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_comma_instead_of_colon.json: -------------------------------------------------------------------------------- 1 | {"x", null} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_trailing_comment.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**/ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}# -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_accentuated_char_no_quotes.json: -------------------------------------------------------------------------------- 1 | [é] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid_unicode_escape.json: -------------------------------------------------------------------------------- 1 | ["\uqqqq"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_no_quotes_with_bad_escape.json: -------------------------------------------------------------------------------- 1 | [\n] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_single_string_no_double_quotes.json: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_unescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new 2 | line"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_angle_bracket_null.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_array_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [1]x -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_ascii-unicode-identifier.json: -------------------------------------------------------------------------------- 1 | aå -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_null-byte-outside-string.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_number_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | 2@ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_object_unclosed_no_value.json: -------------------------------------------------------------------------------- 1 | {"": -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object_open_string.json: -------------------------------------------------------------------------------- 1 | {"a -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unclosed_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"asd" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_real_fraction_exponent.json: -------------------------------------------------------------------------------- 1 | [123.456e78] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_duplicated_key.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"c"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_with_newlines.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": "b" 3 | } -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_allowed_escapes.json: -------------------------------------------------------------------------------- 1 | ["\"\\\/\b\f\n\r\t"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_escaped_control_character.json: -------------------------------------------------------------------------------- 1 | ["\u0012"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_in_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [ "asd"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_nonCharacterInUTF-8_U+10FFFF.json: -------------------------------------------------------------------------------- 1 | ["􏿿"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_nonCharacterInUTF-8_U+FFFF.json: -------------------------------------------------------------------------------- 1 | ["￿"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_uEscape.json: -------------------------------------------------------------------------------- 1 | ["\u0061\u30af\u30EA\u30b9"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_uescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new\u000Aline"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicodeEscapedBackslash.json: -------------------------------------------------------------------------------- 1 | ["\u005C"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+FDD0_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFDD0"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFFFE"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_newlines_unclosed.json: -------------------------------------------------------------------------------- 1 | ["a", 2 | 4 3 | ,1, -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_spaces_vertical_tab_formfeed.json: -------------------------------------------------------------------------------- 1 | [" a"\f] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_unclosed_with_new_lines.json: -------------------------------------------------------------------------------- 1 | [1, 2 | 1 3 | ,1 -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-negative-real.json: -------------------------------------------------------------------------------- 1 | [-123.123foo] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_minus_sign_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [-foo] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_key_with_single_quotes.json: -------------------------------------------------------------------------------- 1 | {key: 'value'} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_several_trailing_commas.json: -------------------------------------------------------------------------------- 1 | {"id":0,,,,,} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_trailing_comment_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**// -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_trailing_comment_slash_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}// -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_two_commas_in_a_row.json: -------------------------------------------------------------------------------- 1 | {"a":"b",,"c":"d"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_1_surrogate_then_escape.json: -------------------------------------------------------------------------------- 1 | ["\uD800\"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_1_surrogate_then_escape_u.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_incomplete_escaped_character.json: -------------------------------------------------------------------------------- 1 | ["\u00A"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_incomplete_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_array_with_extra_array_close.json: -------------------------------------------------------------------------------- 1 | [1]] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_array_with_unclosed_string.json: -------------------------------------------------------------------------------- 1 | ["asd] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_uescaped_LF_before_string.json: -------------------------------------------------------------------------------- 1 | [\u000A""] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_whitespace_U+2060_word_joiner.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_array_with_several_null.json: -------------------------------------------------------------------------------- 1 | [1,null,null,null,2] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_escaped_null_in_key.json: -------------------------------------------------------------------------------- 1 | {"foo\u0000bar": 42} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_accepted_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["\uD801\udc37"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_backslash_and_u_escaped_zero.json: -------------------------------------------------------------------------------- 1 | ["\\u0000"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_last_surrogates_1_and_2.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFF"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_reservedCharacterInUTF-8_U+1BFFF.json: -------------------------------------------------------------------------------- 1 | ["𛿿"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+10FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFE"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+1FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uD83F\uDFFE"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+2064_invisible_plus.json: -------------------------------------------------------------------------------- 1 | ["\u2064"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_escaped_double_quote.json: -------------------------------------------------------------------------------- 1 | ["\u0022"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_with_alpha_char.json: -------------------------------------------------------------------------------- 1 | [1.8011670033376514H-308] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_repeated_null_null.json: -------------------------------------------------------------------------------- 1 | {null:null,null:null} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_with_single_string.json: -------------------------------------------------------------------------------- 1 | { "foo" : "bar", "a" } -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_1_surrogate_then_escape_u1.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_1_surrogate_then_escape_u1x.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1x"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_leading_uescaped_thinspace.json: -------------------------------------------------------------------------------- 1 | [\u0020"asd"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_object_followed_by_closing_object.json: -------------------------------------------------------------------------------- 1 | {}} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_object_with_comment.json: -------------------------------------------------------------------------------- 1 | {"a":/*comment*/"b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_open_object_string_with_apostrophes.json: -------------------------------------------------------------------------------- 1 | {'a' -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unclosed_array_partial_null.json: -------------------------------------------------------------------------------- 1 | [ false, nul -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_duplicated_key_and_value.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"b"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json: -------------------------------------------------------------------------------- 1 | ["\u200B"] -------------------------------------------------------------------------------- /samples/snippets/src/main/resources/META-INF/services/io.grpc.LoadBalancerProvider: -------------------------------------------------------------------------------- 1 | io.grpc.internal.PickFirstLoadBalancerProvider 2 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_trailing_comment_slash_open_incomplete.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/ -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_comma_instead_of_closing_brace.json: -------------------------------------------------------------------------------- 1 | {"x": true, -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a": true} "x" -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unclosed_array_unfinished_false.json: -------------------------------------------------------------------------------- 1 | [ true, fals -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_unclosed_array_unfinished_true.json: -------------------------------------------------------------------------------- 1 | [ false, tru -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_extreme_numbers.json: -------------------------------------------------------------------------------- 1 | { "min": -1.0e+28, "max": 1.0e+28 } -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_1_2_3_bytes_UTF-8_sequences.json: -------------------------------------------------------------------------------- 1 | ["\u0060\u012a\u12AB"] -------------------------------------------------------------------------------- /.kokoro/nightly/java8-osx.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | build_file: "java-spanner/.kokoro/build.sh" 4 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_non_string_key_but_huge_number_instead.json: -------------------------------------------------------------------------------- 1 | {9999E9999:1} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_incomplete_surrogate_escape_invalid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\uD800\x"] -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_accepted_surrogate_pairs.json: -------------------------------------------------------------------------------- 1 | ["\ud83d\ude39\ud83d\udc8d"] -------------------------------------------------------------------------------- /google-cloud-spanner-executor/src/main/resources/META-INF/services/io.grpc.LoadBalancerProvider: -------------------------------------------------------------------------------- 1 | io.grpc.internal.PickFirstLoadBalancerProvider 2 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd1e"] -------------------------------------------------------------------------------- /google-cloud-spanner-executor/README.md: -------------------------------------------------------------------------------- 1 | This module is for Google-internal use ([details]( 2 | http://go/cloud-spanner-client-testing-design)). 3 | This is not for customers. 4 | 5 | -------------------------------------------------------------------------------- /.devcontainer/postCreate.sh: -------------------------------------------------------------------------------- 1 | echo "Post Create Starting" 2 | 3 | mvn clean install -B -V -ntp \ 4 | -DskipTests=true \ 5 | -Dmaven.javadoc.skip=true \ 6 | -Dclirr.skip=true 7 | -------------------------------------------------------------------------------- /git-hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copy this file into your .git/hooks folder 4 | 5 | set -e 6 | 7 | # Checks for Formatting errors 8 | mvn com.coveo:fmt-maven-plugin:check 9 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_number_double_close_to_zero.json: -------------------------------------------------------------------------------- 1 | [-0.000000000000000000000000000000000000000000000000000000000000000000000000000001] 2 | -------------------------------------------------------------------------------- /samples/snippets/src/main/resources/com/example/spanner/descriptors.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/samples/snippets/src/main/resources/com/example/spanner/descriptors.pb -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_long_strings.json: -------------------------------------------------------------------------------- 1 | {"x":[{"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_object_string_unicode.json: -------------------------------------------------------------------------------- 1 | {"title":"\u041f\u043e\u043b\u0442\u043e\u0440\u0430 \u0417\u0435\u043c\u043b\u0435\u043a\u043e\u043f\u0430" } -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/descriptors.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/descriptors.pb -------------------------------------------------------------------------------- /.github/trusted-contribution.yml: -------------------------------------------------------------------------------- 1 | trustedContributors: 2 | - renovate-bot 3 | - gcf-owl-bot[bot] 4 | 5 | annotations: 6 | - type: comment 7 | text: "/gcbrun" 8 | - type: label 9 | text: "kokoro:force-run" 10 | -------------------------------------------------------------------------------- /.kokoro/nightly/java11.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java11" 7 | } 8 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_invalid_utf8.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_a_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_array_a_invalid_utf8.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_single_eacute.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_single_eacute.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-int.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_incomplete_UTF8_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_incomplete_UTF8_BOM.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_lone-invalid-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_structure_lone-invalid-utf-8.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid-utf-8-in-escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid-utf-8-in-escape.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-bigger-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-bigger-int.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-exponent.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_invalid-utf-8-in-exponent.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid_utf8_after_escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_string_invalid_utf8_after_escape.json -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_real_with_invalid_utf8_after_e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_number_real_with_invalid_utf8_after_e.json -------------------------------------------------------------------------------- /.github/blunderbuss.yml: -------------------------------------------------------------------------------- 1 | # Configuration for the Blunderbuss GitHub app. For more info see 2 | # https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss 3 | assign_issues: 4 | - rahul2393 5 | assign_prs_by: 6 | - labels: 7 | - samples 8 | to: 9 | - googleapis/java-samples-reviewers 10 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-spanner/native-image.properties: -------------------------------------------------------------------------------- 1 | Args=--initialize-at-build-time=org.junit.runner.RunWith \ 2 | --initialize-at-build-time=org.junit.experimental.categories.Category \ 3 | --initialize-at-build-time=org.junit.runners.model.FrameworkField 4 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_lone_continuation_byte_in_key_and_trailing_comma.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/java-spanner/HEAD/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/invalid/n_object_lone_continuation_byte_in_key_and_trailing_comma.json -------------------------------------------------------------------------------- /.kokoro/nightly/java8.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "REPORT_COVERAGE" 11 | value: "true" 12 | } 13 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/README.md: -------------------------------------------------------------------------------- 1 | #### To generate SingerProto.java and descriptors.pb file from singer.proto using `protoc` 2 | ```shell 3 | cd google-cloud-spanner/src/test/resources/com/google/cloud/spanner 4 | protoc --proto_path=. --include_imports --descriptor_set_out=descriptors.pb --java_out=. singer.proto 5 | ``` 6 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | .level=INFO 2 | .handlers=java.util.logging.ConsoleHandler 3 | java.util.logging.ConsoleHandler.level=INFO 4 | java.util.logging.Logger.useParentHandlers=true 5 | 6 | # Set log level to WARN for SpannerImpl to prevent log spamming of the Spanner configuration. 7 | com.google.cloud.spanner.SpannerImpl.LEVEL=WARN 8 | -------------------------------------------------------------------------------- /.kokoro/presubmit/dependencies.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "TRAMPOLINE_BUILD_FILE" 11 | value: "github/java-spanner/.kokoro/dependencies.sh" 12 | } 13 | -------------------------------------------------------------------------------- /samples/snippets/src/main/resources/com/example/spanner/README.md: -------------------------------------------------------------------------------- 1 | #### To generate SingerProto.java and descriptors.pb file from singer.proto using `protoc` 2 | ```shell 3 | cd samples/snippets/src/main/resources/ 4 | protoc --proto_path=com/example/spanner/ --include_imports --descriptor_set_out=com/example/spanner/descriptors.pb 5 | --java_out=. com/example/spanner/singer.proto 6 | ``` 7 | -------------------------------------------------------------------------------- /.github/generated-files-bot.yml: -------------------------------------------------------------------------------- 1 | externalManifests: 2 | - type: json 3 | file: 'synth.metadata' 4 | jsonpath: '$.generatedFiles[*]' 5 | - type: json 6 | file: '.github/readme/synth.metadata/synth.metadata' 7 | jsonpath: '$.generatedFiles[*]' 8 | ignoreAuthors: 9 | - 'cloud-java-bot' 10 | - 'renovate-bot' 11 | - 'yoshi-automation' 12 | - 'release-please[bot]' 13 | - 'gcf-owl-bot[bot]' 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support request 3 | about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. 4 | 5 | --- 6 | 7 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 8 | -------------------------------------------------------------------------------- /license-checks.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /grpc-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7012 6 | com/google/spanner/admin/database/v1/* 7 | * 8 | 9 | 10 | -------------------------------------------------------------------------------- /grpc-google-cloud-spanner-admin-instance-v1/clirr-ignored-differences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7012 6 | com/google/spanner/admin/instance/v1/* 7 | * 8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code owners file. 2 | # This file controls who is tagged for review for any given pull request. 3 | 4 | # For syntax help see: 5 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax 6 | 7 | # The @googleapis/spanner-client-libraries-java is the default owner for changes in this repo 8 | * @googleapis/yoshi-java @googleapis/spanner-client-libraries-java 9 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/resources/META-INF/native-image/native-image.properties: -------------------------------------------------------------------------------- 1 | Args = --initialize-at-build-time=com.google.cloud.spanner.IntegrationTestEnv,\ 2 | org.junit.experimental.categories.CategoryValidator,\ 3 | org.junit.validator.AnnotationValidator,\ 4 | java.lang.annotation.Annotation \ 5 | -H:ReflectionConfigurationResources=${.}/com.google.cloud.spanner/grpc-gcp-reflect-config.json \ 6 | --features=com.google.cloud.spanner.nativeimage.SpannerFeature 7 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/resources/META-INF/native-image/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": [ 3 | {"pattern": "\\Qcom/google/cloud/spanner/connection/ClientSideStatements.json\\E"}, 4 | {"pattern": "\\Qcom/google/cloud/spanner/connection/PG_ClientSideStatements.json\\E"}, 5 | {"pattern": "\\Qcom/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json\\E"}, 6 | {"pattern": "\\Qcom/google/cloud/spanner/connection/ITSqlScriptTest_TestQueryOptions.sql\\E"} 7 | ] 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Packages 2 | dist 3 | bin 4 | var 5 | sdist 6 | target 7 | 8 | # Unit test / coverage reports 9 | .coverage 10 | .tox 11 | nosetests.xml 12 | 13 | # Translations 14 | *.mo 15 | 16 | # Mr Developer 17 | .mr.developer.cfg 18 | .project 19 | .pydevproject 20 | *.iml 21 | .idea 22 | .settings 23 | .DS_Store 24 | .classpath 25 | .tool-versions 26 | 27 | # Built documentation 28 | docs/ 29 | 30 | # Python utilities 31 | *.pyc 32 | 33 | .flattened-pom.xml 34 | .java-version 35 | .vscode/ 36 | -------------------------------------------------------------------------------- /.kokoro/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} 4 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 5 | 6 | # All builds use the trampoline script to run in docker. 7 | build_file: "java-spanner/.kokoro/trampoline.sh" 8 | 9 | # Tell the trampoline which build file to use. 10 | env_vars: { 11 | key: "TRAMPOLINE_BUILD_FILE" 12 | value: "github/java-spanner/.kokoro/build.sh" 13 | } 14 | -------------------------------------------------------------------------------- /samples/snippets/src/main/resources/com/example/spanner/singer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package examples.spanner.music; 4 | 5 | option java_package = "com.example.spanner"; 6 | option java_outer_classname = "SingerProto"; 7 | option java_multiple_files = false; 8 | 9 | message SingerInfo { 10 | optional int64 singer_id = 1; 11 | optional string birth_date = 2; 12 | optional string nationality = 3; 13 | optional Genre genre = 4; 14 | } 15 | 16 | enum Genre { 17 | POP = 0; 18 | JAZZ = 1; 19 | FOLK = 2; 20 | ROCK = 3; 21 | } 22 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/singer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package examples.spanner.music; 4 | 5 | option java_package = "com.google.cloud.spanner"; 6 | option java_outer_classname = "SingerProto"; 7 | option java_multiple_files = false; 8 | 9 | message SingerInfo { 10 | optional int64 singer_id = 1; 11 | optional string birth_date = 2; 12 | optional string nationality = 3; 13 | optional Genre genre = 4; 14 | } 15 | 16 | enum Genre { 17 | POP = 0; 18 | JAZZ = 1; 19 | FOLK = 2; 20 | ROCK = 3; 21 | } 22 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration-cloud-devel.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-devel" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration-cloud-staging.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-staging" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/renovate_config_check.yaml: -------------------------------------------------------------------------------- 1 | name: Renovate Bot Config Validation 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'renovate.json' 7 | 8 | jobs: 9 | renovate_bot_config_validation: 10 | runs-on: ubuntu-24.04 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Node.js 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: '22' 20 | 21 | - name: Install Renovate and Config Validator 22 | run: | 23 | npm install -g npm@latest 24 | npm install --global renovate 25 | renovate-config-validator 26 | -------------------------------------------------------------------------------- /.kokoro/continuous/integration-cloud-devel.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-devel" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "REPORT_COVERAGE" 26 | value: "true" 27 | } -------------------------------------------------------------------------------- /license_file: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ -------------------------------------------------------------------------------- /.kokoro/continuous/integration-cloud-staging.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-staging" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "REPORT_COVERAGE" 26 | value: "true" 27 | } -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/jmh/jmh-baseline.json: -------------------------------------------------------------------------------- 1 | { 2 | "benchmarkResultMap": { 3 | "com.google.cloud.spanner.benchmarking.ReadBenchmark.queryBenchmark": { 4 | "scorePercentiles": [ 5 | { 6 | "percentile": "50.0", 7 | "baseline": "450", 8 | "difference": "20" 9 | } 10 | ] 11 | }, 12 | "com.google.cloud.spanner.benchmarking.ReadBenchmark.readBenchmark": { 13 | "scorePercentiles": [ 14 | { 15 | "percentile": "50.0", 16 | "baseline": "450", 17 | "difference": "20" 18 | } 19 | ] 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /.github/auto-label.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | requestsize: 15 | enabled: true 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | # Disable version updates for Maven dependencies 8 | # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. 9 | ignore: 10 | - dependency-name: "*" 11 | - package-ecosystem: "pip" 12 | directory: "/" 13 | schedule: 14 | interval: "daily" 15 | # Disable version updates for pip dependencies 16 | # If a security vulnerability comes in, we will be notified about 17 | # it via template in the synthtool repository. 18 | ignore: 19 | - dependency-name: "*" 20 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration-cloud-devel-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-devel-directpath-enabled" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 26 | value: "true" 27 | } 28 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration-cloud-staging-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-staging-directpath-enabled" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 26 | value: "true" 27 | } 28 | -------------------------------------------------------------------------------- /java.header: -------------------------------------------------------------------------------- 1 | ^/\*$ 2 | ^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ 3 | ^ \*$ 4 | ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ 5 | ^ \* you may not use this file except in compliance with the License\.$ 6 | ^ \* You may obtain a copy of the License at$ 7 | ^ \*$ 8 | ^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ 9 | ^ \*$ 10 | ^ \* Unless required by applicable law or agreed to in writing, software$ 11 | ^ \* distributed under the License is distributed on an "AS IS" BASIS,$ 12 | ^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ 13 | ^ \* See the License for the specific language governing permissions and$ 14 | ^ \* limitations under the License\.$ 15 | ^ \*/$ 16 | -------------------------------------------------------------------------------- /versions.txt: -------------------------------------------------------------------------------- 1 | # Format: 2 | # module:released-version:current-version 3 | 4 | proto-google-cloud-spanner-admin-instance-v1:6.105.0:6.105.1-SNAPSHOT 5 | proto-google-cloud-spanner-v1:6.105.0:6.105.1-SNAPSHOT 6 | proto-google-cloud-spanner-admin-database-v1:6.105.0:6.105.1-SNAPSHOT 7 | grpc-google-cloud-spanner-v1:6.105.0:6.105.1-SNAPSHOT 8 | grpc-google-cloud-spanner-admin-instance-v1:6.105.0:6.105.1-SNAPSHOT 9 | grpc-google-cloud-spanner-admin-database-v1:6.105.0:6.105.1-SNAPSHOT 10 | google-cloud-spanner:6.105.0:6.105.1-SNAPSHOT 11 | google-cloud-spanner-executor:6.105.0:6.105.1-SNAPSHOT 12 | proto-google-cloud-spanner-executor-v1:6.105.0:6.105.1-SNAPSHOT 13 | grpc-google-cloud-spanner-executor-v1:6.105.0:6.105.1-SNAPSHOT 14 | -------------------------------------------------------------------------------- /google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/executor/v1/gapic_metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": "1.0", 3 | "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", 4 | "language": "java", 5 | "protoPackage": "google.spanner.executor.v1", 6 | "libraryPackage": "com.google.cloud.spanner.executor.v1", 7 | "services": { 8 | "SpannerExecutorProxy": { 9 | "clients": { 10 | "grpc": { 11 | "libraryClient": "SpannerExecutorProxyClient", 12 | "rpcs": { 13 | "ExecuteActionAsync": { 14 | "methods": ["executeActionAsyncCallable"] 15 | } 16 | } 17 | } 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /.kokoro/continuous/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | regex: "**/*sponge_log.txt" 8 | } 9 | } 10 | 11 | # Download trampoline resources. 12 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 13 | 14 | # Use the trampoline script to run in docker. 15 | build_file: "java-spanner/.kokoro/trampoline.sh" 16 | 17 | env_vars: { 18 | key: "TRAMPOLINE_BUILD_FILE" 19 | value: "github/java-spanner/.kokoro/build.sh" 20 | } 21 | 22 | env_vars: { 23 | key: "JOB_TYPE" 24 | value: "test" 25 | } 26 | 27 | env_vars: { 28 | key: "GCLOUD_PROJECT" 29 | value: "gcloud-devel" 30 | } 31 | -------------------------------------------------------------------------------- /.kokoro/nightly/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | regex: "**/*sponge_log.txt" 8 | } 9 | } 10 | 11 | # Download trampoline resources. 12 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 13 | 14 | # Use the trampoline script to run in docker. 15 | build_file: "java-spanner/.kokoro/trampoline.sh" 16 | 17 | env_vars: { 18 | key: "TRAMPOLINE_BUILD_FILE" 19 | value: "github/java-spanner/.kokoro/build.sh" 20 | } 21 | 22 | env_vars: { 23 | key: "JOB_TYPE" 24 | value: "test" 25 | } 26 | 27 | env_vars: { 28 | key: "GCLOUD_PROJECT" 29 | value: "gcloud-devel" 30 | } 31 | 32 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: 2 | - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-spanner/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea 3 | - [ ] Ensure the tests and linter pass 4 | - [ ] Code coverage does not decrease (if any source code was changed) 5 | - [ ] Appropriate docs were updated (if necessary) 6 | 7 | Fixes # ☕️ 8 | 9 | If you write sample code, please follow the [samples format]( 10 | https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). 11 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/it/valid/y_80_nested.json: -------------------------------------------------------------------------------- 1 | {"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{"nest":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} 2 | -------------------------------------------------------------------------------- /.kokoro/continuous/integration-cloud-devel-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-devel-directpath-enabled" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "REPORT_COVERAGE" 26 | value: "true" 27 | } 28 | 29 | env_vars: { 30 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 31 | value: "true" 32 | } 33 | -------------------------------------------------------------------------------- /.kokoro/continuous/integration-cloud-staging-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-cloud-staging-directpath-enabled" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_APPLICATION_CREDENTIALS" 16 | value: "secret_manager/java-client-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "SECRET_MANAGER_KEYS" 21 | value: "java-client-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "REPORT_COVERAGE" 26 | value: "true" 27 | } 28 | 29 | env_vars: { 30 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 31 | value: "true" 32 | } 33 | -------------------------------------------------------------------------------- /.kokoro/presubmit/integration.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | -------------------------------------------------------------------------------- /.github/workflows/unmanaged_dependency_check.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | name: Unmanaged dependency check 4 | jobs: 5 | unmanaged_dependency_check: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v5 9 | - uses: actions/setup-java@v5 10 | with: 11 | distribution: temurin 12 | java-version: 11 13 | - name: Install modules 14 | shell: bash 15 | run: | 16 | # No argument to build.sh installs the modules in local Maven 17 | # repository 18 | .kokoro/build.sh 19 | - name: Unmanaged dependency check 20 | uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.2 21 | with: 22 | bom-path: google-cloud-spanner-bom/pom.xml 23 | -------------------------------------------------------------------------------- /google-cloud-spanner-executor/clirr-ignored-differences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7004 6 | com/google/cloud/executor/spanner/CloudExecutorImpl 7 | CloudExecutorImpl(boolean) 8 | CloudExecutorImpl(boolean, double) 9 | 10 | 11 | 7002 12 | com/google/cloud/spanner/SessionPoolOptionsHelper 13 | com.google.cloud.spanner.SessionPoolOptions$Builder setUseMultiplexedSessionBlindWrite(com.google.cloud.spanner.SessionPoolOptions$Builder, boolean) 14 | 15 | 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this library 4 | 5 | --- 6 | 7 | Thanks for stopping by to let us know something could be better! 8 | 9 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 10 | 11 | **Is your feature request related to a problem? Please describe.** 12 | What the problem is. Example: I'm always frustrated when [...] 13 | 14 | **Describe the solution you'd like** 15 | What you want to happen. 16 | 17 | **Describe alternatives you've considered** 18 | Any alternative solutions or features you've considered. 19 | 20 | **Additional context** 21 | Any other context or screenshots about the feature request. 22 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Integration Test interface. */ 20 | public interface IntegrationTest {} 21 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/SerialIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Serial Integration Test interface. */ 20 | public interface SerialIntegrationTest {} 21 | -------------------------------------------------------------------------------- /.kokoro/nightly/samples.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "samples" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "ENABLE_BUILD_COP" 37 | value: "true" 38 | } 39 | -------------------------------------------------------------------------------- /.kokoro/presubmit/samples.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "samples" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "ENABLE_BUILD_COP" 37 | value: "true" 38 | } 39 | -------------------------------------------------------------------------------- /.kokoro/build.bat: -------------------------------------------------------------------------------- 1 | :: Copyright 2022 Google LLC 2 | :: 3 | :: Licensed under the Apache License, Version 2.0 (the "License"); 4 | :: you may not use this file except in compliance with the License. 5 | :: You may obtain a copy of the License at 6 | :: 7 | :: http://www.apache.org/licenses/LICENSE-2.0 8 | :: 9 | :: Unless required by applicable law or agreed to in writing, software 10 | :: distributed under the License is distributed on an "AS IS" BASIS, 11 | :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | :: See the License for the specific language governing permissions and 13 | :: limitations under the License. 14 | :: Github action job to test core java library features on 15 | :: downstream client libraries before they are released. 16 | :: See documentation in type-shell-output.bat 17 | 18 | "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh 19 | -------------------------------------------------------------------------------- /.kokoro/nightly/java8-samples.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "samples" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "ENABLE_BUILD_COP" 37 | value: "true" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /.kokoro/nightly/java11-samples.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java11" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "samples" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "ENABLE_BUILD_COP" 37 | value: "true" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/SlowTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Category of slow tests, to be run on the nightly build * */ 20 | public interface SlowTest extends IntegrationTest {} 21 | -------------------------------------------------------------------------------- /.kokoro/nightly/java11-integration.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-public-resources/java11014" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration" 12 | } 13 | # TODO: remove this after we've migrated all tests and scripts 14 | env_vars: { 15 | key: "GCLOUD_PROJECT" 16 | value: "gcloud-devel" 17 | } 18 | 19 | env_vars: { 20 | key: "GOOGLE_CLOUD_PROJECT" 21 | value: "gcloud-devel" 22 | } 23 | 24 | env_vars: { 25 | key: "ENABLE_FLAKYBOT" 26 | value: "true" 27 | } 28 | 29 | env_vars: { 30 | key: "GOOGLE_APPLICATION_CREDENTIALS" 31 | value: "secret_manager/java-it-service-account" 32 | } 33 | 34 | env_vars: { 35 | key: "SECRET_MANAGER_KEYS" 36 | value: "java-it-service-account" 37 | } 38 | 39 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/ParallelIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Parallel Integration Test interface. */ 20 | public interface ParallelIntegrationTest extends IntegrationTest {} 21 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration" 12 | } 13 | # TODO: remove this after we've migrated all tests and scripts 14 | env_vars: { 15 | key: "GCLOUD_PROJECT" 16 | value: "java-docs-samples-testing" 17 | } 18 | 19 | env_vars: { 20 | key: "GOOGLE_CLOUD_PROJECT" 21 | value: "java-docs-samples-testing" 22 | } 23 | 24 | env_vars: { 25 | key: "ENABLE_FLAKYBOT" 26 | value: "true" 27 | } 28 | 29 | env_vars: { 30 | key: "GOOGLE_APPLICATION_CREDENTIALS" 31 | value: "secret_manager/java-it-service-account" 32 | } 33 | 34 | env_vars: { 35 | key: "SECRET_MANAGER_KEYS" 36 | value: "java-it-service-account" 37 | } 38 | 39 | -------------------------------------------------------------------------------- /.kokoro/nightly/java11-samples-slow-tests.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java11" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "samples-slow-tests" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "ENABLE_BUILD_COP" 37 | value: "true" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /.kokoro/presubmit/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | regex: "**/*sponge_log.txt" 8 | } 9 | } 10 | 11 | # Download trampoline resources. 12 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 13 | 14 | # Use the trampoline script to run in docker. 15 | build_file: "java-spanner/.kokoro/trampoline.sh" 16 | 17 | env_vars: { 18 | key: "TRAMPOLINE_BUILD_FILE" 19 | value: "github/java-spanner/.kokoro/build.sh" 20 | } 21 | 22 | env_vars: { 23 | key: "JOB_TYPE" 24 | value: "test" 25 | } 26 | 27 | env_vars: { 28 | key: "GCLOUD_PROJECT" 29 | value: "gcloud-devel" 30 | } 31 | 32 | before_action { 33 | fetch_keystore { 34 | keystore_resource { 35 | keystore_config_id: 73713 36 | keyname: "dpebot_codecov_token" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.kokoro/nightly/slow-tests.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | # Runs the slow tests only in the nightly build 3 | 4 | # Configure the docker image for kokoro-trampoline. 5 | env_vars: { 6 | key: "TRAMPOLINE_IMAGE" 7 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 8 | } 9 | 10 | env_vars: { 11 | key: "JOB_TYPE" 12 | value: "slowtests" 13 | } 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "ENABLE_FLAKYBOT" 27 | value: "true" 28 | } 29 | 30 | env_vars: { 31 | key: "GOOGLE_APPLICATION_CREDENTIALS" 32 | value: "secret_manager/java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "SECRET_MANAGER_KEYS" 37 | value: "java-it-service-account" 38 | } 39 | -------------------------------------------------------------------------------- /.kokoro/presubmit/integration-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-directpath-enabled" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 37 | value: "true" 38 | } -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * A client for Cloud Spanner - A no-compromise relational database service. 19 | * 20 | * @see Cloud Spanner 21 | */ 22 | package com.google.cloud.spanner; 23 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/ReadFormatTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import org.junit.runner.RunWith; 20 | 21 | /** Unit tests for running the test read format tests. */ 22 | @RunWith(ReadFormatTestRunner.class) 23 | public class ReadFormatTest {} 24 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTestHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.cloud.spanner; 17 | 18 | public class SpannerOptionsTestHelper { 19 | 20 | public static void resetActiveTracingFramework() { 21 | SpannerOptions.resetActiveTracingFramework(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Internal API for Google Cloud Spanner. This API may introduce breaking changes without prior 19 | * notice. 20 | */ 21 | @com.google.api.core.InternalApi 22 | package com.google.cloud.spanner.connection; 23 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.cloud.ServiceFactory; 20 | 21 | /** Factory to create instance of {@code Spanner}. */ 22 | public interface SpannerFactory extends ServiceFactory {} 23 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/encryption/BackupEncryptionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.encryption; 18 | 19 | import com.google.api.core.InternalApi; 20 | 21 | /** Marker interface for encryption configurations that can be applied on backups. */ 22 | @InternalApi 23 | public interface BackupEncryptionConfig {} 24 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/encryption/RestoreEncryptionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.encryption; 18 | 19 | import com.google.api.core.InternalApi; 20 | 21 | /** Marker interface for encryption configurations that can be applied on restores. */ 22 | @InternalApi 23 | public interface RestoreEncryptionConfig {} 24 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/TestHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.cloud.spanner; 17 | 18 | class TestHelper { 19 | 20 | static boolean isMultiplexSessionDisabled() { 21 | return System.getenv() 22 | .getOrDefault("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS", "") 23 | .equalsIgnoreCase("false"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.kokoro/nightly/integration-directpath-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-directpath-enabled" 12 | } 13 | # TODO: remove this after we've migrated all tests and scripts 14 | env_vars: { 15 | key: "GCLOUD_PROJECT" 16 | value: "cloud-java-ci-sample" 17 | } 18 | 19 | env_vars: { 20 | key: "GOOGLE_CLOUD_PROJECT" 21 | value: "cloud-java-ci-sample" 22 | } 23 | 24 | env_vars: { 25 | key: "ENABLE_FLAKYBOT" 26 | value: "true" 27 | } 28 | 29 | env_vars: { 30 | key: "GOOGLE_APPLICATION_CREDENTIALS" 31 | value: "secret_manager/java-client-testing" 32 | } 33 | 34 | env_vars: { 35 | key: "SECRET_MANAGER_KEYS" 36 | value: "java-client-testing" 37 | } 38 | 39 | env_vars: { 40 | key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS" 41 | value: "true" 42 | } 43 | -------------------------------------------------------------------------------- /.kokoro/presubmit/graalvm-native-a.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.1" # {x-version-update:google-cloud-shared-dependencies:current} 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "graalvm" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "IT_SERVICE_ACCOUNT_EMAIL" 37 | value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" 38 | } -------------------------------------------------------------------------------- /.kokoro/presubmit/graalvm-native-b.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.1" # {x-version-update:google-cloud-shared-dependencies:current} 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "graalvm" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "IT_SERVICE_ACCOUNT_EMAIL" 37 | value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" 38 | } -------------------------------------------------------------------------------- /.kokoro/presubmit/graalvm-native-c.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.1" # {x-version-update:google-cloud-shared-dependencies:current} 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "graalvm" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "IT_SERVICE_ACCOUNT_EMAIL" 37 | value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" 38 | } -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/SpannerRpcFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.spi; 18 | 19 | import com.google.cloud.spanner.SpannerOptions; 20 | import com.google.cloud.spi.ServiceRpcFactory; 21 | 22 | /** Factory to create instances of {@code SpannerRpc}. */ 23 | public interface SpannerRpcFactory extends ServiceRpcFactory {} 24 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/IScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** 20 | * This interface represents a scope that wraps both OpenCensus and OpenTelemetry scopes. It extends 21 | * the AutoCloseable interface and overrides the close method that does not throw an exception. 22 | */ 23 | interface IScope extends AutoCloseable { 24 | @Override 25 | void close(); 26 | } 27 | -------------------------------------------------------------------------------- /.kokoro/trampoline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | set -eo pipefail 16 | # Always run the cleanup script, regardless of the success of bouncing into 17 | # the container. 18 | function cleanup() { 19 | chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 20 | ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 21 | echo "cleanup"; 22 | } 23 | trap cleanup EXIT 24 | 25 | $(dirname $0)/populate-secrets.sh # Secret Manager secrets. 26 | python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" 27 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ITReadOnlySpannerTest_CreateTables.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | NEW_CONNECTION; 18 | 19 | SET READONLY = FALSE; 20 | START BATCH DDL; 21 | 22 | CREATE TABLE NUMBERS (NUMBER INT64 NOT NULL, NAME STRING(200) NOT NULL) PRIMARY KEY (NUMBER); 23 | CREATE TABLE PRIME_NUMBERS (PRIME_NUMBER INT64 NOT NULL, BINARY_REPRESENTATION STRING(MAX) NOT NULL) PRIMARY KEY (PRIME_NUMBER); 24 | RUN BATCH; 25 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/IsSslHandshakeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.common.base.Predicate; 20 | import javax.net.ssl.SSLHandshakeException; 21 | 22 | public class IsSslHandshakeException implements Predicate { 23 | 24 | @Override 25 | public boolean apply(Throwable input) { 26 | return input instanceof SSLHandshakeException; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/Clock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import java.time.Instant; 20 | 21 | /** 22 | * Wrapper around current time so that we can fake it in tests. TODO(user): Replace with Java 8 23 | * Clock. 24 | */ 25 | class Clock { 26 | static final Clock INSTANCE = new Clock(); 27 | 28 | Clock() {} 29 | 30 | Instant instant() { 31 | return Instant.now(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/JavaVersionUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.gson.internal.JavaVersion; 20 | 21 | /** Util class for getting the Java version the tests are executed on. */ 22 | public class JavaVersionUtil { 23 | 24 | /** Returns the major Java version (e.g. 8, 11, 17) */ 25 | public static int getJavaMajorVersion() { 26 | return JavaVersion.getMajorJavaVersion(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenCensusScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import io.opencensus.common.Scope; 20 | 21 | class OpenCensusScope implements IScope { 22 | 23 | private final Scope openCensusScope; 24 | 25 | OpenCensusScope(Scope openCensusScope) { 26 | this.openCensusScope = openCensusScope; 27 | } 28 | 29 | @Override 30 | public void close() { 31 | openCensusScope.close(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DialectNamespaceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import com.google.cloud.spanner.Dialect; 20 | 21 | class DialectNamespaceMapper { 22 | static String getNamespace(Dialect dialect) { 23 | switch (dialect) { 24 | case POSTGRESQL: 25 | return "SPANNER."; 26 | case GOOGLE_STANDARD_SQL: 27 | default: 28 | return ""; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ITConnectionImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.cloud.spanner.connection; 17 | 18 | import com.google.cloud.spanner.connection.ITAbstractSpannerTest.ITConnection; 19 | 20 | /** Implementation of {@link ITConnection} for Spanner generic (not JDBC) connections. */ 21 | public class ITConnectionImpl extends ConnectionImpl implements ITConnection { 22 | ITConnectionImpl(ConnectionOptions options) { 23 | super(options); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import io.opentelemetry.context.Scope; 20 | 21 | class OpenTelemetryScope implements IScope { 22 | 23 | private final Scope openTelemetryScope; 24 | 25 | OpenTelemetryScope(Scope openTelemetryScope) { 26 | this.openTelemetryScope = openTelemetryScope; 27 | } 28 | 29 | @Override 30 | public void close() { 31 | openTelemetryScope.close(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Helper to configure SpannerOptions for tests. */ 20 | public class SpannerOptionsHelper { 21 | 22 | /** 23 | * Resets the activeTracingFramework. This variable is used for internal testing, and is not a 24 | * valid production scenario. 25 | */ 26 | public static void resetActiveTracingFramework() { 27 | SpannerOptions.resetActiveTracingFramework(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/TestEnvConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import java.io.IOException; 20 | 21 | /** Interface for TestEnvConfig. */ 22 | public interface TestEnvConfig { 23 | /** Returns the options to use to create the Cloud Spanner client for integration tests. */ 24 | SpannerOptions spannerOptions(); 25 | 26 | /** Custom setup. */ 27 | void setUp() throws IOException; 28 | 29 | /** Custom tear down. */ 30 | void tearDown(); 31 | } 32 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/StreamingUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | final class StreamingUtil { 20 | 21 | private StreamingUtil() {} 22 | 23 | static boolean initiateStreaming( 24 | ResultSet resultSet, AsyncResultSet.StreamMessageListener streamMessageListener) { 25 | if (resultSet instanceof StreamingResultSet) { 26 | return ((StreamingResultSet) resultSet).initiateStreaming(streamMessageListener); 27 | } 28 | return false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/TestChannelProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import com.google.api.gax.rpc.TransportChannelProvider; 20 | import com.google.cloud.spanner.v1.SpannerSettings; 21 | 22 | public final class TestChannelProvider implements ConnectionOptions.ExternalChannelProvider { 23 | public TransportChannelProvider getChannelProvider(String host, int port) { 24 | return SpannerSettings.defaultTransportChannelProvider(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/FlakyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** 20 | * Annotation for JUnit {@link org.junit.experimental.categories.Category} that indicates a test is 21 | * flaky. These will be excluded from integration tests. Use this annotation sparingly: typically it 22 | * should only be used for a test where the flakiness is dependent on a fix in a module dependency 23 | * (for example, grpc-java) and cannot be addressed locally. 24 | */ 25 | public interface FlakyTest {} 26 | -------------------------------------------------------------------------------- /.kokoro/presubmit/integration-regular-sessions-enabled.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Configure the docker image for kokoro-trampoline. 4 | env_vars: { 5 | key: "TRAMPOLINE_IMAGE" 6 | value: "gcr.io/cloud-devrel-kokoro-resources/java8" 7 | } 8 | 9 | env_vars: { 10 | key: "JOB_TYPE" 11 | value: "integration-regular-sessions" 12 | } 13 | 14 | # TODO: remove this after we've migrated all tests and scripts 15 | env_vars: { 16 | key: "GCLOUD_PROJECT" 17 | value: "gcloud-devel" 18 | } 19 | 20 | env_vars: { 21 | key: "GOOGLE_CLOUD_PROJECT" 22 | value: "gcloud-devel" 23 | } 24 | 25 | env_vars: { 26 | key: "GOOGLE_APPLICATION_CREDENTIALS" 27 | value: "secret_manager/java-it-service-account" 28 | } 29 | 30 | env_vars: { 31 | key: "SECRET_MANAGER_KEYS" 32 | value: "java-it-service-account" 33 | } 34 | 35 | env_vars: { 36 | key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS" 37 | value: "false" 38 | } 39 | 40 | env_vars: { 41 | key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS" 42 | value: "false" 43 | } 44 | 45 | env_vars: { 46 | key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW" 47 | value: "false" 48 | } 49 | -------------------------------------------------------------------------------- /benchmarks/src/main/java/com/google/cloud/spanner/benchmark/BenchmarkRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.benchmark; 18 | 19 | import java.time.Duration; 20 | import java.util.List; 21 | 22 | interface BenchmarkRunner { 23 | enum TransactionType { 24 | READ_ONLY_SINGLE_USE_READ, 25 | READ_ONLY_SINGLE_USE_QUERY, 26 | READ_ONLY_MULTI_USE, 27 | READ_WRITE 28 | } 29 | 30 | enum Environment { 31 | PROD, 32 | CLOUD_DEVEL 33 | } 34 | 35 | List execute(BenchmarkingConfiguration configuration); 36 | } 37 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/FullBackupSpecOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/admin/database/v1/backup.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.admin.database.v1; 21 | 22 | public interface FullBackupSpecOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.FullBackupSpec) 25 | com.google.protobuf.MessageOrBuilder {} 26 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryContextKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.api.core.InternalApi; 20 | import io.opentelemetry.context.ContextKey; 21 | 22 | /** 23 | * Keys for OpenTelemetry context variables that are used by the Spanner client library. Only 24 | * intended for internal use. 25 | */ 26 | @InternalApi 27 | public class OpenTelemetryContextKeys { 28 | @InternalApi 29 | public static final ContextKey THREAD_NAME_KEY = ContextKey.named("thread.name"); 30 | } 31 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/encryption/UseBackupEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.encryption; 18 | 19 | /** The data is encrypted with the same configuration as specified by the backup being restored. */ 20 | public class UseBackupEncryption implements RestoreEncryptionConfig { 21 | 22 | static final UseBackupEncryption INSTANCE = new UseBackupEncryption(); 23 | 24 | private UseBackupEncryption() {} 25 | 26 | @Override 27 | public String toString() { 28 | return "UseBackupEncryption{}"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/FakeClock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.cloud.spanner; 17 | 18 | import java.time.Instant; 19 | import java.util.concurrent.atomic.AtomicLong; 20 | 21 | /** 22 | * Class which allows to mock {@link Clock} in unit tests and return custom time values within the 23 | * tests. 24 | */ 25 | class FakeClock extends Clock { 26 | final AtomicLong currentTimeMillis = new AtomicLong(); 27 | 28 | @Override 29 | public Instant instant() { 30 | return Instant.ofEpochMilli(currentTimeMillis.get()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/PartitionedQueryResultSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import com.google.cloud.spanner.ResultSet; 20 | 21 | /** Result set that is returned for partitioned queries. */ 22 | public interface PartitionedQueryResultSet extends ResultSet { 23 | 24 | /** Returns the number of partitions that this result set contains. */ 25 | int getNumPartitions(); 26 | 27 | /** Returns the degree of parallelism that this result set uses. */ 28 | int getParallelism(); 29 | } 30 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/IncrementalBackupSpecOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/admin/database/v1/backup.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.admin.database.v1; 21 | 22 | public interface IncrementalBackupSpecOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.IncrementalBackupSpec) 25 | com.google.protobuf.MessageOrBuilder {} 26 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/NoopEndTransactionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import com.google.cloud.spanner.connection.UnitOfWork.EndTransactionCallback; 20 | 21 | class NoopEndTransactionCallback implements EndTransactionCallback { 22 | static final NoopEndTransactionCallback INSTANCE = new NoopEndTransactionCallback(); 23 | 24 | private NoopEndTransactionCallback() {} 25 | 26 | @Override 27 | public void onSuccess() {} 28 | 29 | @Override 30 | public void onFailure() {} 31 | } 32 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/Repeat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | /** Simple util class for repeating (test) functions. */ 20 | class Repeat { 21 | 22 | /** Repeat the given {@link Runnable} twice. */ 23 | static void twice(Runnable runnable) { 24 | repeat(runnable, 2); 25 | } 26 | 27 | /** Repeat the given {@link Runnable} n times. */ 28 | static void repeat(Runnable runnable, int n) { 29 | for (int ignore = 0; ignore < n; ignore++) { 30 | runnable.run(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/MoveInstanceResponseOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/admin/instance/v1/spanner_instance_admin.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.admin.instance.v1; 21 | 22 | public interface MoveInstanceResponseOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.admin.instance.v1.MoveInstanceResponse) 25 | com.google.protobuf.MessageOrBuilder {} 26 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/encryption/GoogleDefaultEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.encryption; 18 | 19 | /** The data is encrypted with a key that is fully managed by Google. */ 20 | public class GoogleDefaultEncryption implements BackupEncryptionConfig, RestoreEncryptionConfig { 21 | 22 | static final GoogleDefaultEncryption INSTANCE = new GoogleDefaultEncryption(); 23 | 24 | private GoogleDefaultEncryption() {} 25 | 26 | @Override 27 | public String toString() { 28 | return "GoogleDefaultEncryption{}"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/AddSplitPointsResponseOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/admin/database/v1/spanner_database_admin.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.admin.database.v1; 21 | 22 | public interface AddSplitPointsResponseOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.AddSplitPointsResponse) 25 | com.google.protobuf.MessageOrBuilder {} 26 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/encryption/UseDatabaseEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.encryption; 18 | 19 | /** 20 | * The data is encrypted with the same configuration as specified by the source database for a 21 | * backup. 22 | */ 23 | public class UseDatabaseEncryption implements BackupEncryptionConfig { 24 | 25 | static final UseDatabaseEncryption INSTANCE = new UseDatabaseEncryption(); 26 | 27 | private UseDatabaseEncryption() {} 28 | 29 | @Override 30 | public String toString() { 31 | return "UseDatabaseEncryption{}"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/TracerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** 20 | * Tests marked with this {@link org.junit.experimental.categories.Category} will be executed in a 21 | * separate execution with the maven-surefire plugin. The tests will be excluded from execution with 22 | * the maven-failsafe plugin. 23 | * 24 | *

Separate execution prevents the injection of any custom tracing configuration from interfering 25 | * with other tests, as most tracing configuration is stored in static final variables. 26 | */ 27 | public interface TracerTest {} 28 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/LazySpannerInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Default implementation of {@link AbstractLazyInitializer} for a {@link Spanner} instance. */ 20 | public class LazySpannerInitializer extends AbstractLazyInitializer { 21 | /** 22 | * Initializes a default {@link Spanner} instance. Override this method to create an instance with 23 | * custom configuration. 24 | */ 25 | @Override 26 | protected Spanner initialize() throws Exception { 27 | return SpannerOptions.newBuilder().build().getService(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.repo-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_shortname": "spanner", 3 | "name_pretty": "Cloud Spanner", 4 | "product_documentation": "https://cloud.google.com/spanner/docs/", 5 | "api_description": "is a fully managed, mission-critical, relational database service that offers transactional consistency at global scale, schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication for high availability. Be sure to activate the Cloud Spanner API on the Developer's Console to use Cloud Spanner from your project.", 6 | "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-spanner/latest/history", 7 | "release_level": "stable", 8 | "transport": "grpc", 9 | "language": "java", 10 | "repo": "googleapis/java-spanner", 11 | "repo_short": "java-spanner", 12 | "distribution_name": "com.google.cloud:google-cloud-spanner", 13 | "api_id": "spanner.googleapis.com", 14 | "library_type": "GAPIC_COMBO", 15 | "requires_billing": true, 16 | "codeowner_team": "@googleapis/spanner-client-libraries-java", 17 | "excluded_poms": "google-cloud-spanner-bom", 18 | "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open", 19 | "recommended_package": "com.google.cloud.spanner", 20 | "min_java_version": 8 21 | } -------------------------------------------------------------------------------- /proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/InternalUpdateGraphOperationResponseOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/admin/database/v1/spanner_database_admin.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.admin.database.v1; 21 | 22 | public interface InternalUpdateGraphOperationResponseOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) 25 | com.google.protobuf.MessageOrBuilder {} 26 | -------------------------------------------------------------------------------- /.github/workflows/integration-tests-against-emulator.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | name: integration-tests-against-emulator 7 | jobs: 8 | units: 9 | runs-on: ubuntu-latest 10 | 11 | services: 12 | emulator: 13 | image: gcr.io/cloud-spanner-emulator/emulator:latest 14 | ports: 15 | - 9010:9010 16 | - 9020:9020 17 | 18 | steps: 19 | - uses: actions/checkout@v5 20 | - uses: stCarolas/setup-maven@v5 21 | with: 22 | maven-version: 3.8.1 23 | # Build with JDK 11 and run tests with JDK 8 24 | - uses: actions/setup-java@v5 25 | with: 26 | java-version: 11 27 | distribution: temurin 28 | - name: Compiling main library 29 | run: .kokoro/build.sh 30 | - uses: actions/setup-java@v5 31 | with: 32 | java-version: 8 33 | distribution: temurin 34 | - name: Running tests 35 | run: | 36 | mvn -V -B -Dspanner.testenv.instance="" -Penable-integration-tests \ 37 | -DtrimStackTrace=false -Dclirr.skip=true -Denforcer.skip=true \ 38 | -Dmaven.main.skip=true -fae verify 39 | env: 40 | JOB_TYPE: test 41 | SPANNER_EMULATOR_HOST: localhost:9010 42 | GOOGLE_CLOUD_PROJECT: emulator-test-project 43 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/StreamingResultSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.api.core.InternalApi; 20 | 21 | /** Streaming implementation of ResultSet that supports streaming of chunks */ 22 | interface StreamingResultSet extends ResultSet { 23 | 24 | /** 25 | * Returns the {@link boolean} for this {@link ResultSet}. This method will be used by 26 | * AsyncResultSet internally to initiate gRPC streaming. This method should not be called by the 27 | * users. 28 | */ 29 | @InternalApi 30 | boolean initiateStreaming(AsyncResultSet.StreamMessageListener streamMessageListener); 31 | } 32 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ITSqlScriptTest_TestInvalidStatements.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Script for testing invalid/unrecognized statements 19 | */ 20 | -- EXPLAIN statement 21 | @EXPECT EXCEPTION INVALID_ARGUMENT 'INVALID_ARGUMENT: Unknown statement: EXPLAIN' 22 | EXPLAIN SELECT * 23 | FROM Singers; 24 | 25 | -- EXPLAIN ANALYZE statement 26 | @EXPECT EXCEPTION INVALID_ARGUMENT 'INVALID_ARGUMENT: Unknown statement: EXPLAIN ANALYZE' 27 | EXPLAIN ANALYZE SELECT * 28 | FROM Singers; 29 | 30 | -- SET unknown property 31 | @EXPECT EXCEPTION INVALID_ARGUMENT 'INVALID_ARGUMENT: Unknown statement: SET some_property' 32 | SET some_property='value'; -------------------------------------------------------------------------------- /samples/snippets/src/test/java/com/example/spanner/ListDatabasesIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.spanner; 18 | 19 | import static org.junit.Assert.assertTrue; 20 | 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | import org.junit.runners.JUnit4; 24 | 25 | @RunWith(JUnit4.class) 26 | public class ListDatabasesIT extends SampleTestBaseV2 { 27 | 28 | @Test 29 | public void testListDatabaseRoles() throws Exception { 30 | final String out = 31 | SampleRunner.runSample( 32 | () -> 33 | ListDatabasesSample.listDatabases(projectId, instanceId)); 34 | assertTrue(out.contains("Databases for projects")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/integration-tests-against-emulator-with-regular-session.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | name: integration-tests-against-emulator-with-multiplexed-session 7 | jobs: 8 | units: 9 | runs-on: ubuntu-latest 10 | 11 | services: 12 | emulator: 13 | image: gcr.io/cloud-spanner-emulator/emulator:latest 14 | ports: 15 | - 9010:9010 16 | - 9020:9020 17 | 18 | steps: 19 | - uses: actions/checkout@v5 20 | - uses: stCarolas/setup-maven@v5 21 | with: 22 | maven-version: 3.8.1 23 | # Build with JDK 11 and run tests with JDK 8 24 | - uses: actions/setup-java@v5 25 | with: 26 | java-version: 11 27 | distribution: temurin 28 | - name: Compiling main library 29 | run: .kokoro/build.sh 30 | - uses: actions/setup-java@v5 31 | with: 32 | java-version: 8 33 | distribution: temurin 34 | - name: Running tests 35 | run: | 36 | mvn -V -B -Dspanner.testenv.instance="" -Penable-integration-tests \ 37 | -DtrimStackTrace=false -Dclirr.skip=true -Denforcer.skip=true \ 38 | -Dmaven.main.skip=true -fae verify 39 | env: 40 | JOB_TYPE: test 41 | SPANNER_EMULATOR_HOST: localhost:9010 42 | GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: false -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/DecodeMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | /** Specifies how and when to decode a value from protobuf to a plain Java object. */ 20 | public enum DecodeMode { 21 | /** 22 | * Decodes all columns of a row directly when a {@link ResultSet} is advanced to the next row with 23 | * {@link ResultSet#next()} 24 | */ 25 | DIRECT, 26 | /** 27 | * Decodes all columns of a row the first time a {@link ResultSet} value is retrieved from the 28 | * row. 29 | */ 30 | LAZY_PER_ROW, 31 | /** 32 | * Decodes a columns of a row the first time the value of that column is retrieved from the row. 33 | */ 34 | LAZY_PER_COL, 35 | } 36 | -------------------------------------------------------------------------------- /benchmarks/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.api.core.InternalApi; 20 | 21 | /** 22 | * Simple helper class to get access to a package-private method in the {@link 23 | * com.google.cloud.spanner.SessionPoolOptions}. 24 | */ 25 | @InternalApi 26 | public class SessionPoolOptionsHelper { 27 | 28 | // TODO: Remove when Builder.setUseMultiplexedSession(..) has been made public. 29 | public static SessionPoolOptions.Builder setUseMultiplexedSession( 30 | SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSession) { 31 | return sessionPoolOptionsBuilder.setUseMultiplexedSession(useMultiplexedSession); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.kokoro/coerce_logs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2019 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script finds and moves sponge logs so that they can be found by placer 17 | # and are not flagged as flaky by sponge. 18 | 19 | set -eo pipefail 20 | 21 | ## Get the directory of the build script 22 | scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) 23 | ## cd to the parent directory, i.e. the root of the git repo 24 | cd ${scriptDir}/.. 25 | 26 | job=$(basename ${KOKORO_JOB_NAME}) 27 | 28 | echo "coercing sponge logs..." 29 | for xml in `find . -name *-sponge_log.xml` 30 | do 31 | class=$(basename ${xml} | cut -d- -f2) 32 | dir=$(dirname ${xml})/${job}/${class} 33 | text=$(dirname ${xml})/${class}-sponge_log.txt 34 | mkdir -p ${dir} 35 | mv ${xml} ${dir}/sponge_log.xml 36 | mv ${text} ${dir}/sponge_log.txt 37 | done 38 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/RetryOnDifferentGrpcChannelException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import javax.annotation.Nullable; 20 | 21 | class RetryOnDifferentGrpcChannelException extends SpannerException { 22 | private final int channel; 23 | 24 | RetryOnDifferentGrpcChannelException( 25 | @Nullable String message, int channel, @Nullable Throwable cause) { 26 | // Note: We set retryable=false, as the exception is not retryable in the standard way. 27 | super( 28 | DoNotConstructDirectly.ALLOWED, ErrorCode.INTERNAL, /* retryable= */ false, message, cause); 29 | this.channel = channel; 30 | } 31 | 32 | int getChannel() { 33 | return this.channel; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/testing/EmulatorSpannerHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.testing; 18 | 19 | import com.google.common.base.Strings; 20 | 21 | /** Utility class for checking emulator state for tests */ 22 | public class EmulatorSpannerHelper { 23 | 24 | public static final String SPANNER_EMULATOR_HOST = "SPANNER_EMULATOR_HOST"; 25 | 26 | /** 27 | * Checks whether the emulator is being used. This is done by checking if the 28 | * SPANNER_EMULATOR_HOST environment variable is set. 29 | * 30 | * @return true if the emulator is being used. Returns false otherwise. 31 | */ 32 | public static boolean isUsingEmulator() { 33 | return !Strings.isNullOrEmpty(System.getenv(SPANNER_EMULATOR_HOST)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; 20 | import io.opentelemetry.sdk.metrics.export.MetricExporter; 21 | import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; 22 | 23 | class BuiltInMetricsView { 24 | 25 | private BuiltInMetricsView() {} 26 | 27 | /** Register built-in metrics on the {@link SdkMeterProviderBuilder} with credentials. */ 28 | static void registerBuiltinMetrics( 29 | MetricExporter metricExporter, SdkMeterProviderBuilder builder) { 30 | BuiltInMetricsConstant.getAllViews().forEach(builder::registerView); 31 | builder.registerMetricReader(PeriodicMetricReader.create(metricExporter)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerBatchUpdateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | public class SpannerBatchUpdateException extends SpannerException { 20 | private final long[] updateCounts; 21 | 22 | /** Private constructor. Use {@link SpannerExceptionFactory} to create instances. */ 23 | SpannerBatchUpdateException( 24 | DoNotConstructDirectly token, 25 | ErrorCode code, 26 | String message, 27 | long[] counts, 28 | Throwable cause) { 29 | super(token, code, false, message, cause, null); 30 | updateCounts = counts; 31 | } 32 | 33 | /** Returns the number of rows affected by each statement that is successfully run. */ 34 | public long[] getUpdateCounts() { 35 | return updateCounts; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SetReadOnlyStalenessSqlScriptTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import org.junit.Test; 20 | 21 | public class SetReadOnlyStalenessSqlScriptTest extends AbstractSqlScriptTest { 22 | private String getFileName() { 23 | switch (dialect) { 24 | case POSTGRESQL: 25 | return "postgresql/SetReadOnlyStalenessTest.sql"; 26 | case GOOGLE_STANDARD_SQL: 27 | default: 28 | return "SetReadOnlyStalenessTest.sql"; 29 | } 30 | } 31 | 32 | @Test 33 | public void testSetReadOnlyStalenessScript() throws Exception { 34 | SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider(dialect)); 35 | verifier.verifyStatementsInFile(getFileName(), getClass(), true); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | Thanks for stopping by to let us know something could be better! 8 | 9 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 10 | 11 | Please run down the following list and make sure you've tried the usual "quick fixes": 12 | 13 | - Search the issues already opened: https://github.com/googleapis/java-spanner/issues 14 | - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform 15 | 16 | If you are still having issues, please include as much information as possible: 17 | 18 | #### Environment details 19 | 20 | 1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). 21 | General, Core, and Other are also allowed as types 22 | 2. OS type and version: 23 | 3. Java version: 24 | 4. version(s): 25 | 26 | #### Steps to reproduce 27 | 28 | 1. ? 29 | 2. ? 30 | 31 | #### Code example 32 | 33 | ```java 34 | // example 35 | ``` 36 | 37 | #### Stack trace 38 | ``` 39 | Any relevant stacktrace here. 40 | ``` 41 | 42 | #### External references such as API reference guides 43 | 44 | - ? 45 | 46 | #### Any additional information below 47 | 48 | 49 | Following these steps guarantees the quickest resolution possible. 50 | 51 | Thanks! 52 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-executor-v1/src/main/java/com/google/spanner/executor/v1/CloseBatchTransactionActionOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/executor/v1/cloud_executor.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.executor.v1; 21 | 22 | public interface CloseBatchTransactionActionOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.executor.v1.CloseBatchTransactionAction) 25 | com.google.protobuf.MessageOrBuilder { 26 | 27 | /** 28 | * 29 | * 30 | *

31 |    * Indicates whether the transaction needs to be cleaned up.
32 |    * 
33 | * 34 | * bool cleanup = 1; 35 | * 36 | * @return The cleanup. 37 | */ 38 | boolean getCleanup(); 39 | } 40 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementValueConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | /** 20 | * Interface for converters that are used by {@link ClientSideStatement} that sets a value that need 21 | * to be converted from a string to a specific type. Implementing classes must have a public 22 | * constructor that takes a String parameter. The String parameter will contain a regular expression 23 | * for the allowed values for the property. 24 | */ 25 | interface ClientSideStatementValueConverter { 26 | 27 | /** The type to convert to. */ 28 | Class getParameterClass(); 29 | 30 | /** 31 | * The actual convert method. Should return null for values that could not be 32 | * converted. 33 | */ 34 | T convert(String value); 35 | } 36 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/ForceCloseSpannerFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner; 18 | 19 | import com.google.common.base.Function; 20 | import java.util.concurrent.TimeUnit; 21 | 22 | /** Class for tests that need to be able to force-close a {@link Spanner} instance. */ 23 | public class ForceCloseSpannerFunction implements Function { 24 | private final long timeout; 25 | private final TimeUnit unit; 26 | 27 | public ForceCloseSpannerFunction(long timeout, TimeUnit unit) { 28 | this.timeout = timeout; 29 | this.unit = unit; 30 | } 31 | 32 | public Void apply(Spanner spanner) { 33 | if (spanner instanceof SpannerImpl) { 34 | ((SpannerImpl) spanner).close(timeout, unit); 35 | } else { 36 | spanner.close(); 37 | } 38 | return null; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /releases.txt: -------------------------------------------------------------------------------- 1 | 6739e12:1.47.0 2 | 100cc59:1.46.0 3 | c88eb1d:1.45.0 4 | 6afd140:1.44.0 5 | 755fd13:1.43.0 6 | dfe5da3:1.42.0 7 | 44fa57b:1.41.0 8 | 27dc689:1.38.0 9 | 16e4851:1.37.0 10 | 476c4be:1.36.0 11 | 403cd0e:1.35.0 12 | 7e6d7ab:1.34.0 13 | 6d87b65:1.33.0 14 | 2c35b7b:1.32.0 15 | b9a7f53:1.31.0 16 | 3978864:1.30.0 17 | 0055e0b:1.29.0 18 | a0ae465:1.28.0 19 | bbaec8b:1.27.0 20 | 562d0bf:1.26.0 21 | d1122c9:1.25.0 22 | 04ac5fe:1.24.0 23 | 0fdbb4a:1.23.0 24 | a892d71:1.22.0 25 | 098e182:1.21.0 26 | cb48702:1.20.0 27 | 88af93f:1.19.0 28 | 393ab17:1.18.0 29 | 7301f03:1.17.0 30 | 1e748c6:1.16.0 31 | d2215ef:1.15.0 32 | 2ede22f:1.14.0 33 | 2545e09:1.13.0 34 | bc3d800:1.12.0 35 | f892ee9:1.11.0 36 | e0fc9a4:1.10.0 37 | ea0d715:1.9.0 38 | 9bca164:1.8.0 39 | 92d4c0c:1.7.0 40 | e440776:1.6.0 41 | 6ba35ba:1.5.0 42 | e6c52b5:1.4.0 43 | 2cc884d:1.3.0 44 | d51f49f:1.2.0 45 | 4ab4705:1.1.0 46 | 4fe36e6:1.0.0 47 | fddc8b0:0.72.0-beta 48 | 50c96ae:0.71.0-beta 49 | 567aa6f:0.70.0-beta 50 | 2eca299:0.69.0-beta 51 | cf33def:0.68.0-beta 52 | ea5608d:0.67.0-beta 53 | e006e5b:0.66.0-beta 54 | 9e8fce1:0.65.0-beta 55 | 3000a36:0.64.0-beta 56 | 07ef452:0.63.0-beta 57 | 8e7a255:0.62.0-beta 58 | eeaff12:0.61.0-beta 59 | 3d387a3:0.60.0-beta 60 | 0dc9bc5:0.59.0-beta 61 | 2f112a3:0.58.0-beta 62 | 85bc9e1:0.56.0-beta 63 | f3c446e:0.55.1-beta 64 | 844bc14:0.55.0-beta 65 | 0d466be:0.54.0-beta 66 | 9d30034:0.53.0-beta 67 | d768f1a:0.52.0-beta 68 | 3e6489d:0.51.0-beta 69 | 12e3e81:0.50.0-beta 70 | 6398093:0.49.0-beta 71 | aa7cacb:0.48.0-beta 72 | -------------------------------------------------------------------------------- /.github/workflows/samples.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | name: samples 4 | jobs: 5 | checkstyle: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - uses: actions/setup-java@v1 10 | with: 11 | java-version: 11 12 | - name: Run checkstyle 13 | run: mvn -P lint --quiet --batch-mode checkstyle:check 14 | working-directory: samples/snippets 15 | compile-java8: 16 | name: "compile (8)" 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: actions/setup-java@v3 21 | with: 22 | # Java 11 to generate class file targeting Java 8 23 | java-version: 11 24 | distribution: temurin 25 | - name: Compile Spanner 26 | run: mvn clean install -Dclirr.skip=true 27 | - uses: actions/setup-java@v3 28 | with: 29 | java-version: 8 30 | distribution: temurin 31 | - name: Compile samples 32 | run: mvn compile 33 | working-directory: samples 34 | 35 | compile: 36 | runs-on: ubuntu-latest 37 | strategy: 38 | matrix: 39 | java: [11, 17] 40 | steps: 41 | - uses: actions/checkout@v4 42 | - uses: actions/setup-java@v3 43 | with: 44 | java-version: ${{matrix.java}} 45 | distribution: temurin 46 | - name: Compile Spanner 47 | run: mvn clean install -Dclirr.skip=true 48 | - name: Compile samples 49 | run: mvn compile 50 | working-directory: samples 51 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-executor-v1/src/main/java/com/google/spanner/executor/v1/TransactionExecutionOptionsOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/executor/v1/cloud_executor.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.executor.v1; 21 | 22 | public interface TransactionExecutionOptionsOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.executor.v1.TransactionExecutionOptions) 25 | com.google.protobuf.MessageOrBuilder { 26 | 27 | /** 28 | * 29 | * 30 | *
31 |    * Whether optimistic concurrency should be used to execute this transaction.
32 |    * 
33 | * 34 | * bool optimistic = 1; 35 | * 36 | * @return The optimistic. 37 | */ 38 | boolean getOptimistic(); 39 | } 40 | -------------------------------------------------------------------------------- /samples/snippets/src/test/java/com/example/spanner/CreateInstanceWithAutoscalingConfigSampleIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.spanner; 18 | 19 | import static com.google.common.truth.Truth.assertThat; 20 | 21 | import com.google.spanner.admin.database.v1.InstanceName; 22 | import org.junit.Test; 23 | 24 | public class CreateInstanceWithAutoscalingConfigSampleIT extends SampleTestBaseV2 { 25 | 26 | @Test 27 | public void testCreateInstanceWithAutoscalingConfig() throws Exception { 28 | String instanceId = idGenerator.generateInstanceId(); 29 | String out = 30 | SampleRunner.runSample( 31 | () -> CreateInstanceWithAutoscalingConfigExample.createInstance(projectId, instanceId)); 32 | assertThat(out) 33 | .contains(String.format("Autoscaler instance %s", 34 | InstanceName.of(projectId, instanceId).toString())); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /samples/snippets/src/test/java/com/example/spanner/admin/archived/GetInstanceConfigSampleIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.spanner.admin.archived; 18 | 19 | import static org.junit.Assert.assertTrue; 20 | 21 | import com.example.spanner.SampleRunner; 22 | import com.example.spanner.SampleTestBase; 23 | import org.junit.Test; 24 | 25 | public class GetInstanceConfigSampleIT extends SampleTestBase { 26 | 27 | @Test 28 | public void testGetInstanceConfig() throws Exception { 29 | final String out = SampleRunner.runSample(() -> 30 | GetInstanceConfigSample.getInstanceConfig(projectId, instanceConfigName) 31 | ); 32 | 33 | assertTrue( 34 | "Expected instance config " + instanceConfigName + " to contain at least one leader option." 35 | + " Output received was " + out, 36 | out.matches("(?s:.*\\[.+\\].*)") 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /samples/snippets/src/test/java/com/example/spanner/admin/archived/ListInstanceConfigsSampleIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.spanner.admin.archived; 18 | 19 | import static org.junit.Assert.assertTrue; 20 | 21 | import com.example.spanner.SampleRunner; 22 | import com.example.spanner.SampleTestBase; 23 | import org.junit.Test; 24 | 25 | public class ListInstanceConfigsSampleIT extends SampleTestBase { 26 | 27 | @Test 28 | public void testListInstanceConfigs() throws Exception { 29 | final String out = SampleRunner.runSample(() -> 30 | ListInstanceConfigsSample.listInstanceConfigs(projectId) 31 | ); 32 | 33 | assertTrue( 34 | "Expected instance config " + instanceConfigName + " to contain at least one leader option." 35 | + " Output received was " + out, 36 | out.matches("(?s:.*nam6: \\[.+\\].*)") 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /samples/snippets/src/test/java/com/example/spanner/CreateInstanceWithProcessingUnitsSampleIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.spanner; 18 | 19 | import static com.google.common.truth.Truth.assertThat; 20 | 21 | import com.google.spanner.admin.database.v1.InstanceName; 22 | import org.junit.Test; 23 | 24 | public class CreateInstanceWithProcessingUnitsSampleIT extends SampleTestBaseV2 { 25 | 26 | @Test 27 | public void testCreateInstanceWithProcessingUnits() throws Exception { 28 | String instanceId = idGenerator.generateInstanceId(); 29 | String out = 30 | SampleRunner.runSample( 31 | () -> CreateInstanceWithProcessingUnitsExample.createInstance(projectId, instanceId)); 32 | assertThat(out) 33 | .contains(String.format("Instance %s has %d processing units", 34 | InstanceName.of(projectId, instanceId).toString(), 500)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /proto-google-cloud-spanner-executor-v1/src/main/java/com/google/spanner/executor/v1/SessionPoolOptionsOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // Generated by the protocol buffer compiler. DO NOT EDIT! 17 | // source: google/spanner/executor/v1/cloud_executor.proto 18 | 19 | // Protobuf Java Version: 3.25.8 20 | package com.google.spanner.executor.v1; 21 | 22 | public interface SessionPoolOptionsOrBuilder 23 | extends 24 | // @@protoc_insertion_point(interface_extends:google.spanner.executor.v1.SessionPoolOptions) 25 | com.google.protobuf.MessageOrBuilder { 26 | 27 | /** 28 | * 29 | * 30 | *
31 |    * passing this as true, will make applicable RPCs use multiplexed sessions
32 |    * instead of regular sessions
33 |    * 
34 | * 35 | * bool use_multiplexed = 1; 36 | * 37 | * @return The useMultiplexed. 38 | */ 39 | boolean getUseMultiplexed(); 40 | } 41 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SetStatementTimeoutSqlScriptTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | import com.google.cloud.spanner.Dialect; 20 | import org.junit.Test; 21 | 22 | public class SetStatementTimeoutSqlScriptTest extends AbstractSqlScriptTest { 23 | 24 | private String getFile(Dialect dialect) { 25 | switch (dialect) { 26 | case POSTGRESQL: 27 | return "postgresql/SetStatementTimeoutTest.sql"; 28 | case GOOGLE_STANDARD_SQL: 29 | default: 30 | return "SetStatementTimeoutTest.sql"; 31 | } 32 | } 33 | 34 | @Test 35 | public void testSetStatementTimeoutScript() throws Exception { 36 | SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider(dialect)); 37 | verifier.verifyStatementsInFile(getFile(dialect), getClass(), true); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Cloud Spanner and the Google Cloud Client libraries 2 | 3 | 4 | Open in Cloud Shell 5 | 6 | [Cloud Spanner][Spanner] is a horizontally-scalable database-as-a-service 7 | with transactions and SQL support. 8 | These sample Java applications demonstrate how to access the Spanner API using 9 | the [Google Cloud Client Library for Java][java-spanner]. 10 | 11 | [Spanner]: https://cloud.google.com/spanner/ 12 | [java-spanner]: https://github.com/googleapis/java-spanner 13 | 14 | ## Quickstart 15 | 16 | Install [Maven](http://maven.apache.org/). 17 | 18 | Build your project from the root directory (`java-spanner`): 19 | 20 | mvn clean package -DskipTests 21 | cd samples/snippets 22 | mvn package 23 | 24 | Every subsequent command here should be run from a subdirectory `samples/snippets`. 25 | 26 | ### Running samples 27 | 28 | Usage: 29 | 30 | java -jar target/spanner-snippets/spanner-google-cloud-samples.jar operation my-instance my-database 31 | 32 | #### Examples 33 | 34 | Create Database: 35 | 36 | java -jar target/spanner-google-cloud-samples-jar-with-dependencies.jar my-instance my-database 37 | 38 | Listing database operations: 39 | 40 | java -jar target/spanner-snippets/spanner-google-cloud-samples.jar listdatabaseoperations my-instance my-database -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Java 11", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | "args": { 6 | // Use the VARIANT arg to pick a Debian OS version: buster, bullseye 7 | // Use bullseye when running on local arm64/Apple Silicon. 8 | "VARIANT": "bullseye", 9 | // Options 10 | "INSTALL_MAVEN": "true", 11 | "INSTALL_GRADLE": "false", 12 | "NODE_VERSION": "lts/*" 13 | } 14 | }, 15 | 16 | // Configure tool-specific properties. 17 | "customizations": { 18 | // Configure properties specific to VS Code. 19 | "vscode": { 20 | // Set *default* container specific settings.json values on container create. 21 | "settings": { 22 | "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current", 23 | "java.configuration.runtimes": [{ 24 | "default": true, 25 | "name": "JavaSE-11", 26 | "path": "/usr/local/sdkman/candidates/java/current" 27 | }] 28 | }, 29 | 30 | // Add the IDs of extensions you want installed when the container is created. 31 | "extensions": [ 32 | "vscjava.vscode-java-pack", 33 | "ms-azuretools.vscode-docker" 34 | ] 35 | } 36 | }, 37 | 38 | // Use 'postCreateCommand' to run commands after the container is created. 39 | "postCreateCommand": "bash .devcontainer/postCreate.sh", 40 | 41 | // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 42 | "remoteUser": "vscode" 43 | } 44 | -------------------------------------------------------------------------------- /google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DdlInTransactionMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.cloud.spanner.connection; 18 | 19 | /** Enum used for setting the behavior of DDL in read/write transactions. */ 20 | public enum DdlInTransactionMode { 21 | /** All DDL statements in a read/write transaction fail. */ 22 | FAIL, 23 | /** 24 | * DDL statements in an empty transaction are allowed. That is; if the connection is in 25 | * AutoCommit=false mode and no other statement has been executed, then executing a DDL statement 26 | * or a DDL batch is allowed. 27 | */ 28 | ALLOW_IN_EMPTY_TRANSACTION, 29 | /** 30 | * DDL statements automatically cause the current transaction to be committed and the DDL 31 | * statement is subsequently executed without a transaction. This is equal to how MySQL and Oracle 32 | * behave. 33 | */ 34 | AUTO_COMMIT_TRANSACTION; 35 | } 36 | --------------------------------------------------------------------------------