Class SpannerUtils


  • @InternalApi("Public visibility for re-use by other spanner-change-watcher libraries. API-breaking changes without prior notice is possible.")
    public class SpannerUtils
    extends Object
    Utils for getting commonly needed schema information from a Spanner database.
    • Field Detail

      • FIND_COMMIT_TIMESTAMP_COLUMN_QUERY

        public static final String FIND_COMMIT_TIMESTAMP_COLUMN_QUERY
        Query for getting the column of a table that holds the commit timestamp.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SpannerUtils

        public SpannerUtils()
    • Method Detail

      • getTimestampColumn

        @InternalApi
        public static com.google.api.core.ApiFuture<String> getTimestampColumn​(com.google.cloud.spanner.DatabaseClient client,
                                                                               TableId table)
        Returns the name of the commit timestamp column of the given table.
      • getPrimaryKeyColumns

        @InternalApi
        public static com.google.api.core.ApiFuture<com.google.common.collect.ImmutableList<String>> getPrimaryKeyColumns​(com.google.cloud.spanner.DatabaseClient client,
                                                                                                                          TableId table)
        Returns the primary key columns of a table.
      • buildKey

        @InternalApi
        public static com.google.cloud.spanner.Key buildKey​(Iterable<String> pkColumns,
                                                            com.google.cloud.spanner.ResultSet rs)
        Creates a Key instance from an Iterable of primary key columns and a ResultSet containing the data to use for the key.