DBAPI Module
Pure Python DB API wrapper around Kinetica Python API.
The global method to return a Kinetica connection
Example
Parameters
Raises
Returns
The global method to return an async Kinetica connection
Example
Parameters
Raises
Returns
A DB API 2.0 compliant connection for Kinetica, as outlined in PEP 249.
Constructor Called by connect() in gpudb.dbapi
Parameters
Raises
The sequence of parameters must contain one entry for each argument that the procedure expects. The result of the call is returned as modified copy of the input sequence.
The procedure may also provide a result set as output.
Parameters
Returns
Close the database connection.
Commit changes made since the start of the pending transaction.
Return a database cursor.
The method to execute a single SQL statement (query or command) and return a cursor.
Parameters may be provided as sequence or mapping and will be bound to variables in the operation. Variables are specified in a database-specific notation (see the module’s paramstyle attribute for details).
See also
ParamStyle
Parameters
Raises
Returns
The cursor is only returned from the last execution
See also
Example - inserting multiple records
Parameters
Returns
This method executes an SQL script which is a ‘;’ separated list of SQL statements.
See also
Parameters
Returns
Roll back to the start of the pending transaction, discarding changes.
A DB API 2.0 compliant cursor for Kinetica, as outlined in PEP 249.
Execute an SQL stored procedure, passing the sequence of parameters. The parameters should contain one entry for each procedure argument.
The result of the call is returned as a modified copy of the input parameters. The procedure may also provide a result set, which can be made available through the standard fetch methods.
Close the cursor.
Commit changes made since the start of the pending transaction.
The parent Connection of the implementing cursor.
This read-only attribute is a sequence of 7-item sequences.
Each of these sequences contains information describing one result column:
The first two items (name and type_code) are mandatory, the other five are optional and are set to None if no meaningful values can be provided.
This attribute will be None for operations that do not return rows or if the cursor has not had an operation invoked via the .execute*() method yet.
Returns
used to iterate over the results of the query
Parameters
Returns
Execute an SQL query, parameterising the query with sequences or mappings passed as parameters.
Not supported as of now.
Fetch the remaining rows from the query result set as a list of sequences of Python types.
If rows in the result set have been exhausted, an empty list will be returned. If the previous call to execute did not produce a result set, an error can be raised.
Fetch the next size rows from the query result set as a list of sequences of Python types.
If the size parameter is not supplied, the arraysize property will be used instead.
If rows in the result set have been exhausted, an empty list will be returned. If the previous call to execute did not produce a result set, an error can be raised.
Fetch the next row from the query result set as a sequence of Python types (or return None when no more rows are available).
If the previous call to execute did not produce a result set, an error can be raised.
Skip the cursor to the next available result set, discarding rows from the current set. If there are no more sets, return None, otherwise return True.
This method is optional, as not all databases implement multiple result sets.
Roll back to the start of the pending transaction, discarding changes.
A read-only attribute returning the number of rows that the last execute call returned (for e.g. SELECT calls) or affected (for e.g. UPDATE/INSERT calls).
If no execute has been performed or the rowcount cannot be determined, this should return -1.
Can be used before a call to execute to predefine memory areas for the operation’s parameters.
sizes is a sequence containing an item - a type, or an integer specifying the maximum length for a string - for each input parameter. If the item is None, no memory will be reserved for that column.
Implementations are free to have this method do nothing.
Can be used before a call to execute to predefine buffer sizes for fetches of ‘large’ columns (e.g. LONG, BLOB, etc.).
size is an int, referring to the size of the column.
column is an optional int, referring to the index in the result sequence. If this is not provided, this will set the default size for all ‘large’ columns in the cursor.
Implementations are free to have this method do nothing.
timestamp[, tz] -> tz’s local time from POSIX timestamp.
Return the time, given a Unix timestamp.
Create a date from a POSIX timestamp.
The timestamp is a number, e.g. created via time.time(), that is interpreted as local time.
alias of date
alias of time
alias of datetime
alias of str
alias of datetime
alias of float
alias of bytes
alias of str
alias of bytes
Base error outlined in PEP 249.
Interface error outlined in PEP 249.
Raised for errors with the database interface.
Database error outlined in PEP 249.
Raised for errors with the database.
Data error outlined in PEP 249.
Raised for errors that are due to problems with processed data.
Integrity error outlined in PEP 249.
Raised when errors occur which affect the relational integrity of the database (e.g. constraint violations).
Integrity error outlined in PEP 249.
Raised when the database encounters an internal error.
Not supported error outlined in PEP 249.
Raised when an unsupported operation is attempted.
Operational error outlined in PEP 249.
Raised for errors in the database’s operation.
Programming error outlined in PEP 249.
Raised for SQL programming errors.