TableResult

class borneo.TableResult[source]

Bases: Result

TableResult is returned from NoSQLHandle.get_table() and NoSQLHandle.table_request() operations. It encapsulates the state of the table that is the target of the request.

Operations available in NoSQLHandle.table_request() such as table creation, modification, and drop are asynchronous operations. When such an operation has been performed, it is necessary to call NoSQLHandle.get_table() until the status of the table is State.ACTIVE, State.DROPPED or there is an error condition. The method wait_for_completion() exists to perform this task and should be used to wait for an operation to complete.

NoSQLHandle.get_table() is synchronous, returning static information about the table as well as its current state.

Methods Summary

get_compartment()

Returns compartment id of the target table.

get_compartment_id()

Returns compartment id of the target table.

get_ddl()

Returns the DDL (create table) statement used to create this table if available.

get_defined_tags()

Returns defined tags

get_free_form_tags()

Returns free form tags

get_match_etag()

Returns the match etag

get_namespace()

Returns the namespace of the table or null if it is not in a namespace.

get_operation_id()

Returns the operation id for an asynchronous operation.

get_replicas()

Returns a list of Replica if the table is replicated, otherwise None

get_schema()

Returns the schema for the table.

get_state()

Returns the table state.

get_table_id()

Returns the OCID of the table.

get_table_limits()

Returns the throughput and capacity limits for the table.

get_table_name()

Returns the table name of the target table.

is_local_replica_initialized()

Returns True if the table is a replica and its initialization process has been completed, otherwise False

is_replicated()

Returns True if the table is replicated

is_schema_frozen()

Returns True if the schema for this table is frozen.

wait_for_completion(handle, wait_millis, ...)

Waits for a table operation to complete.

Methods Documentation

get_compartment()[source]

Returns compartment id of the target table.

Cloud service only.

Returns:

compartment id.

Return type:

str

get_compartment_id()[source]

Returns compartment id of the target table.

Cloud service only.

Returns:

compartment id.

Return type:

str

get_ddl()[source]

Returns the DDL (create table) statement used to create this table if available. If the table has been altered since initial creation the statement is also altered to reflect the current table schema. This value, when non-null, is functionally equivalent to the schema returned by set_schema(). table.

Returns:

the ddl statement used to create the table

Return type:

str

Versionadded::

5.4.0

get_defined_tags()[source]

Returns defined tags

Cloud service only.

Returns:

the tags

Return type:

dict[str, dict[str, object]]

Versionadded::

5.4.0

get_free_form_tags()[source]

Returns free form tags

Cloud service only.

Returns:

the tags

Return type:

dict[str, str]

Versionadded::

5.4.0

get_match_etag()[source]

Returns the match etag

Cloud service only.

Returns:

the tag

Return type:

str

Versionadded::

5.4.0

get_namespace()[source]

Returns the namespace of the table or null if it is not in a namespace.

On-premises only.

Returns:

namespace

Return type:

str

get_operation_id()[source]

Returns the operation id for an asynchronous operation. This is none if the request did not generate a new operation. The value can be used in set_operation_id() to find potential errors resulting from the operation.

Returns:

the operation id for an asynchronous operation.

Return type:

str

get_replicas()[source]

Returns a list of Replica if the table is replicated, otherwise None

Cloud service only.

Returns:

list of replicas or None

Return type:

list[Replica]

Versionadded::

5.4.2

get_schema()[source]

Returns the schema for the table.

Returns:

the schema for the table.

Return type:

str

get_state()[source]

Returns the table state. A table in state State.ACTIVE or State.UPDATING is usable for normal operation.

Returns:

the state.

Return type:

State

get_table_id()[source]

Returns the OCID of the table. This value will be null if used with the on-premises service.

Cloud service only.

Returns:

the table OCID

Return type:

str

Versionadded::

5.4.0

get_table_limits()[source]

Returns the throughput and capacity limits for the table. Limits from an on-premises service will always be None.

Returns:

the limits.

Return type:

TableLimits

get_table_name()[source]

Returns the table name of the target table.

Returns:

the table name.

Return type:

str

is_local_replica_initialized()[source]

Returns True if the table is a replica and its initialization process has been completed, otherwise False

Cloud service only.

Returns:

True if is an initialized replica

Return type:

bool

Versionadded::

5.4.2

is_replicated()[source]

Returns True if the table is replicated

Cloud service only.

Returns:

True if table is replicated

Return type:

bool

Versionadded::

5.4.2

is_schema_frozen()[source]

Returns True if the schema for this table is frozen.

Cloud service only.

Returns:

frozen state

Return type:

bool

Versionadded::

5.4.2

wait_for_completion(handle, wait_millis, delay_millis)[source]

Waits for a table operation to complete. Table operations are asynchronous. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. This call returns when the table reaches a terminal state, which is either State.ACTIVE or State.DROPPED.

This instance must be the return value of a previous NoSQLHandle.table_request() and contain a non-none operation id representing the in-progress operation unless the operation has already completed.

This instance is modified with any change in table state or metadata.

Parameters:
  • handle (NoSQLHandle) – the NoSQLHandle to use.

  • wait_millis (int) – the total amount of time to wait, in milliseconds. This value must be non-zero and greater than delay_millis.

  • delay_millis (int) – the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.

Raises: