Struct rustyspanner::database::BatchSnapshot[][src]

pub struct BatchSnapshot<'a> { /* fields omitted */ }

Wrapper for generating and processing read/query batches.

Methods

impl<'a> BatchSnapshot<'a>
[src]

Initializes a new BatchSnapshot

Arguments

  • database - Database to use.

  • read_timestamp - (Optional) Execute all reads at the given timestamp.

  • exact_staleness - (Optional) Execute all reads at a timestamp that is exact_staleness old.

Return value

A BatchSnapshot.

Important traits for StreamedResultSet<'a>

Convenience method: perform read operation via snapshot.

See method read

Important traits for StreamedResultSet<'a>

Convenience method: perform query operation via snapshot.

See method execute_sql

Start a partitioned batch read operation.

Uses the PartitionRead API request to initiate the partitioned read. Returns a list of batch information needed to perform the actual read.

Arguments

  • table - Name of the table from which to fetch data.

  • columns - Names of columns to be retrieved.

  • keyset - A KeySet containing keys/ranges identifying rows to be retrieved.

  • index - (Optional) Name of index to use, rather than the table's primary key.

  • partition_size_bytes - (Optional) Desired size for each partition generated. The service uses this as a hint, th actual partition size may differ.

  • max_partitions - (Optional) Desired maximum number of partitions generated. The service uses this as a hint, the actual number of partitions may differ.

Return value

A vector of PartitionRead.

Important traits for StreamedResultSet<'a>

Process a single, partitioned read.

Arguments

Return value

A StreamedResultSet instance which can be used to consume rows.

Start a partitioned batch query operation.

Uses the PartitionQuery API request to start a partitioned query operation. Returns a list of batch information needed to perform the perform the actual queries.

Arguments

  • sql - SQL query statement.

  • params - Values for parameter replacement. Keys must match the names used in sql.

  • param_types - (Optional) Maps explicit types for one or more param values; required if parameters are passed.

  • partition_size_bytes - (Optional) Desired size for each partition generated. The service uses this as a hint, th actual partition size may differ.

  • max_partitions - (Optional) Desired maximum number of partitions generated. The service uses this as a hint, the actual number of partitions may differ.

Return value

A vector of PartitionQuery.

Important traits for StreamedResultSet<'a>

Process a single, partitioned query.

Arguments

Return value

A StreamedResultSet instance which can be used to consume rows.

Important traits for StreamedResultSet<'a>

Process a single, partitioned query or read.

Arguments

Return value

A StreamedResultSet instance which can be used consume rows.

Clean up underlying session.

If the transaction has been shared across multiples machines, calling this on any machine would invalidate the transaction everywhere. Ideally this would be called when data has been read from all partitions.

Auto Trait Implementations

impl<'a> Send for BatchSnapshot<'a>

impl<'a> Sync for BatchSnapshot<'a>