TableRequest¶
- class borneo.TableRequest[source]¶
Bases:
RequestTableRequest is used to create, modify, and drop tables. The operations allowed are those supported by the Data Definition Language (DDL) portion of the query language. The language provides for table creation and removal (drop), index add and drop, as well as schema evolution via alter table. Operations using DDL statements infer the table name from the query statement itself, e.g. “create table mytable(…)”. Table creation requires a valid
TableLimitsobject to define the throughput desired for the table. If TableLimits is provided with any other type of query statement an exception is thrown.This request is also used to modify the limits of throughput and storage for an existing table. This case is handled by specifying a table name and limits without a query statement. If all three are specified it is an error.
Execution of operations specified by this request is implicitly asynchronous. These are potentially long-running operations.
NoSQLHandle.table_request()returns aTableResultinstance that can be used to poll until the table reaches the desired state.The statement is required parameter unless modifying limits.
Methods Summary
Get the compartment id or name if set for the request.
Returns the defined tags or None if not set
Returns the free_form tags or None if not set
Returns the match etag or None if not set
Returns the namespace to use for the operation or None if not set.
Returns the statement, or None if not set.
Returns the table limits, or None if not set.
Returns the table name to use for the operation.
Returns the timeout to use for the operation, in milliseconds.
set_compartment(compartment)Sets the name or id of a compartment to be used for this operation.
set_defined_tags(tags)Sets defined tags
set_free_form_tags(tags)Sets free_form tags
set_match_etag(etag)Sets a ETag to match for the operation to proceed.
set_namespace(namespace)Sets the namespace to use for the operation.
set_statement(statement)Sets the query statement to use for the operation.
set_table_limits(table_limits)Sets the table limits to use for the operation.
set_table_name(table_name)Sets the table name to use for the operation.
set_timeout(timeout_ms)Sets the request timeout value, in milliseconds.
Methods Documentation
- get_compartment()¶
Get the compartment id or name if set for the request.
Cloud service only.
- Returns:
compartment id or name if set for the request, otherwise None if not set.
- Return type:
str
- get_defined_tags()[source]¶
Returns the defined tags or None if not set
Cloud service only.
- Returns:
the defined tags.
- Return type:
dict[str, dict[str, object]]
- Versionadded::
5.4.0
- get_free_form_tags()[source]¶
Returns the free_form tags or None if not set
- Returns:
the free_form tags.
- Return type:
dict[str, str]
- Versionadded::
5.4.0
- get_match_etag()[source]¶
Returns the match etag or None if not set
Cloud service only.
- Returns:
the match etag or None if not set
- Return type:
str
- Versionadded::
5.4.0
- get_namespace()¶
Returns the namespace to use for the operation or None if not set.
On-premises only
- Returns:
namespace, or None if not set.
- Return type:
str
- Versionadded::
5.4.0
- get_statement()[source]¶
Returns the statement, or None if not set.
- Returns:
the statement.
- Return type:
str
- get_table_limits()[source]¶
Returns the table limits, or None if not set.
- Returns:
the limits.
- Return type:
- get_table_name()¶
Returns the table name to use for the operation.
- Returns:
the table name, or None if not set.
- Returns:
str
- get_timeout()[source]¶
Returns the timeout to use for the operation, in milliseconds. A value of 0 indicates that the timeout has not been set.
- Returns:
the timeout value.
- Return type:
int
- set_compartment(compartment)[source]¶
Sets the name or id of a compartment to be used for this operation.
The compartment may be specified as either a name (or path for nested compartments) or as an id (OCID). A name (vs id) can only be used when authenticated using a specific user identity. It is not available if authenticated as an Instance Principal which can be done when calling the service from a compute instance in the Oracle Cloud Infrastructure. See
borneo.iam.SignatureProvider.create_with_instance_principal().Cloud service only.
- Parameters:
compartment (str) – the compartment name or id. If using a nested compartment, specify the full compartment path compartmentA.compartmentB, but exclude the name of the root compartment (tenant).
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if compartment is not a str.
- set_defined_tags(tags)[source]¶
Sets defined tags
Cloud service only.
:param tags the tags :type tags: dict[str, dict[str, object]] :versionadded:: 5.4.0
- set_free_form_tags(tags)[source]¶
Sets free_form tags
Cloud service only.
:param tags the tags :type tags: dict[str, str] :versionadded:: 5.4.0
- set_match_etag(etag)[source]¶
Sets a ETag to match for the operation to proceed. The ETag must be non-null and have been previously returned in
TableResult. The ETag is a form of optimistic concurrency control allowing an application to ensure no unexpected modifications have been made to the table.Cloud service only.
:param etag the tag :type etag: str :versionadded:: 5.4.0
- set_namespace(namespace)[source]¶
Sets the namespace to use for the operation. This will override any configured default value.
On-premises only
- Parameters:
namespace (str) – the namespace
- Raises:
IllegalArgumentException – raises the exception if namespace is not a string.
- Versionadded::
5.4.0
- set_statement(statement)[source]¶
Sets the query statement to use for the operation. This parameter is required unless the operation is intended to change the limits of an existing table.
- Parameters:
statement (str) – the statement.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if statement is not a string.
- set_table_limits(table_limits)[source]¶
Sets the table limits to use for the operation. Limits are used in only 2 cases – table creation statements and limits modification operations. It is not used for other DDL operations.
If limits are set for an on-premises service they are silently ignored.
Cloud service only.
- Parameters:
table_limits (TableLimits) – the limits.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if table_limits is not an instance TableLimits.
- set_table_name(table_name)[source]¶
Sets the table name to use for the operation. The table name is only used to modify the limits of an existing table, and must not be set for any other operation.
- Parameters:
table_name (str) – the name of the table.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if table_name is not a string.
- set_timeout(timeout_ms)[source]¶
Sets the request timeout value, in milliseconds. This overrides any default value set in
NoSQLHandleConfig. The value must be positive.- Parameters:
timeout_ms (int) – the timeout value, in milliseconds.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if the timeout value is less than or equal to 0.