Python client library  |  Google Cloud (original) (raw)

Skip to main content

Stay organized with collections Save and categorize content based on your preferences.

Snapshot API

Model a set of read-only queries to a database as a snapshot.

class google.cloud.spanner_v1.snapshot.Snapshot(session, read_timestamp=None, min_read_timestamp=None, max_staleness=None, exact_staleness=None, multi_use=False)

Allow a set of reads / SQL statements with shared staleness.

Seehttps://cloud.google.com/spanner/reference/rpc/google.spanner.v1#google.spanner.v1.TransactionOptions.ReadOnly

If no options are passed, reads will use the strong model, reading at a timestamp where all previously committed transactions are visible.

begin()

Begin a read-only transaction on the database.

execute_sql(sql, params=None, param_types=None, query_mode=None, query_options=None, request_options=None, partition=None, retry=<_MethodDefault._DEFAULT_VALUE:

Perform an ExecuteStreamingSql API request.

partition_query(sql, params=None, param_types=None, partition_size_bytes=None, max_partitions=None, *, retry=<_MethodDefault._DEFAULT_VALUE:

Perform a PartitionQuery API request.

partition_read(table, columns, keyset, index='', partition_size_bytes=None, max_partitions=None, *, retry=<_MethodDefault._DEFAULT_VALUE:

Perform a PartitionRead API request for rows in a table.

read(table, columns, keyset, index='', limit=0, partition=None, request_options=None, data_boost_enabled=False, *, retry=<_MethodDefault._DEFAULT_VALUE:

Perform a StreamingRead API request for rows in a table.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-02 UTC.