innoldb.static package¶
Submodules¶
innoldb.static.clauses module¶
- innoldb.static.clauses.set_statement(*columns)¶
- innoldb.static.clauses.where_equals(*columns)¶
Generates a PartiQL WHERE clause for an arbitrary number of columns.
- Parameters
columns (list) – List of columns to include in the where clause.
- Returns
WHERE clause
- Return type
str
- innoldb.static.clauses.where_in(**columns)¶
innoldb.static.driver module¶
- class innoldb.static.driver.Driver¶
Bases:
object- static create_index(driver, table, index)¶
Static method for generating an index on table
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Drivertable (str) – table to be updated
index (str) – index to search against
- Returns
iterable containing result
- static create_table(driver, table)¶
Static method for creating a table within a ledger
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Drivertable (str) – table to be updated
- Returns
iterable containing result
- static down_convert(ion_obj)¶
Down nonvert an amazon.ion ION object
- Parameters
ion_obj ([type]) – an Amazon.ion object.
- Returns
JSON object
- Return type
dict
- static driver(ledger)¶
Static method for retrieving a QLDB driver
- Parameters
ledger (str) – Name of the ledger
- Returns
QLDB Driver
- Return type
pyqldb.driver.qldb_driver.QldbDriver
- static execute(transaction_executor, statement, *params, unsafe=False)¶
Static method for executing transactions with QLDB driver.
- Parameters
transaction_executor – Executor is injected into callback function through pyqldb.driver.qldb_driver.execute_lambda method.
statement (str) – Parameterized PartialQL query.
*params – Arguments for parameterized query.
- static history(driver, table, index, id)¶
- static history_full(driver, table)¶
- static insert(driver, document, table)¶
Static method for inserting document into table
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Driverdocument (dict) – document containing fields to insert
table (str) – table into which document is inserted
- Returns
iterable containing result
- static query(driver, query, unsafe=False)¶
- static query_all(driver, table)¶
Static method for querying table by field.
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Driverfield (str) – field to be searched
value (str) – search value
table (str) – table to be quiered
- Returns
iterable containing result
- static query_by_fields(driver, table, **fields)¶
Static method for querying table by field.
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Driverfields (dict) – Keyword arguments. A dictionary containing the fields used to construct WHERE clause in query.
- Returns
iterable containing result
- static query_in_fields(driver, table, **fields)¶
Static method for querying table where fields match a value in a collection
- Parameters
driver ([type]) – [description]
table ([type]) – [description]
- ..note::
`python Driver().query_in_fields(driver, table, **{ 'a': ['b', 'c' , 'd'], '1': [ 2, 3, 4] }) `will search all documents where a field a has a value belonging to the set (‘b’, ‘c’, ‘d’) and a field 1 whose value belongs to the set (2, 3, 4).
- static sanitize(obj)¶
Remove escape characters from data type
- Parameters
query (str) – Statement that needs sanitized
- Returns
Sanitized query
- static tables(ledger)¶
- static update(driver, document, table, index)¶
Static method for updating QLDB table
- Parameters
driver (
pyqldb.driver.qldb_driver.QldbDriver) – QLDB Driverdocument (dict) – document to be updated
table (dict) – name of the table where the document is
index (str) – name of the table index
- Returns
iterable containing result set
innoldb.static.logger module¶
- innoldb.static.logger.getLogger(name: str) logging.Logger¶
Returns an instance of the
logging.Loggerclass configured to print events on the logging.INFO level to stdout. Add special methods for logging application environment and logging dictionaries, via the log_env and log_dict methods.- Parameters
name (str) – Name of the module instantiating the
logging.Logger.- Returns
Instance of Logger.
- Return type
logging.Logger