MariaDB Connector/Python 1.0
This page is part of MariaDB's Enterprise Documentation.
The parent of this page is: Reference
Topics on this page:
Overview
A summary of the MariaDB Connector/Python API:
Name | Type | Description |
---|---|---|
Method | Returns an object for holding a binary (long) string value | |
Method | Establishes a connection to a database server and returns a connection object | |
Method | Create a connection pool and returns a connection pool object | |
Method | Returns an object for holding a date value | |
Method | Returns an object for holding a date value, built from the given ticks value (seconds since the epoch) | |
Method | Returns a MariaDB field information object | |
Method | Returns an object for holding a time value | |
Method | Returns an object for holding a time value, built from the given ticks value (seconds since the epoch) | |
Method | This function constructs an object holding a time stamp value | |
Method | Returns an object for holding a timestamp value, built from the given ticks value (seconds since the epoch) |
Connection Class
Name | Type | Description |
---|---|---|
Attribute | This connection value (read/write) enables or disables automatic reconnection to the server when the connection is lost | |
Attribute | This connection value (read/write) determines if commits occur automatically or manually. Default: | |
Method | Changes the user and default database of the current connection. A valid username and password pair must be provided and that user must have sufficient permissions to access the desired database. If for any reason authorization fails, the current user authentication will remain. | |
Attribute | This connection value (read/write) sets the character set to use | |
Method | Close the connection now (instead of when the object is destroyed) | |
Attribute | Returns the client character set collation for the connection. (read-only) | |
Method | Commit any pending transaction to the database | |
Method | Establishes a connection to a database server and returns a connection object | |
Attribute | Returns the (thread) id for the current connection. (read only) | |
Attribute | Conversion dictionary | |
Method | Returns a new cursor object for the current connection | |
Attribute | Returns or sets the default database for the current connection. (read/write) | |
Attribute | The connection's data source name. (read-only) | |
Method | Returns a backslash-escaped string that can be used inside single or double quotes in an SQL statement | |
Method | get_server_version() method exists for compatibility reasons. However the preferred way to retrieve server version information are the server_version and server_version_info connection attributes | |
Method | Asks the server to kill a database connection based on its thread ID | |
Method | Checks if the connection to the database server is still available and throws an exception if it is not | |
Method | Tries to make a connection object active again by reconnecting to the server using the same credentials which were specified in connect() method | |
Method | Resets a connection object, clearing session state and pending results. All open cursors for the connection become invalid and must be recreated to be used again. | |
Method | Causes any uncommitted changes on a connection to be discarded | |
Attribute | This connection value (read-only) returns the alphanumeric version of connected database. See server_version for the numeric version. | |
Attribute | The server name or IP address that was used to make the connection to the database. (read-only) | |
Attribute | The port number that was used to make the connection to the database. (read-only) | |
Attribute | This connection value (read-only) returns the numeric version of the database in the form VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH | |
Attribute | Returns numeric version of connected database server in tuple format | |
Attribute | The name of the TLS cipher used for the connection or None. (read-only) | |
Attribute | The version of the TLS cipher used for the connection or None. (read-only) | |
Method | Begins a TPC transaction with the given transaction ID xid | |
Method | Commit a two-phase-commit transaction that was started with tpc_begin() and validated using tpc_prepare() | |
Method | Performs the verification phase of two-phase-commit transaction started with the tpc_begin() method | |
Method | Returns a list of pending two-phase-commit transaction IDs for the current connection | |
Method | Aborts a two-phase-commit transaction that was started with tpc_begin(). A rollback can be done before or after the tpc_prepare() is called. | |
Attribute | This connection value (read-only) returns the path of the unix socket that was used for the connection or None if the connection was made via IP | |
Attribute | Returns the user name for the current connection. (read-only) | |
Attribute | Returns the number of warnings from the last executed statement, or zero. (read only) | |
Method | Returns a transaction ID object suitable for passing to the two-phase-commit functions, starting with tpc_begin() |
Cursor Class
Name | Type | Description |
---|---|---|
Attribute | This cursor value (read/write) is the number of rows that fetchmany() reads per call. The default is 1. | |
Attribute | This cursor value (read/write) sets if the entire result-set of a SELECT or | |
Method | Executes a stored procedure | |
Method | Closes the cursor. If the cursor has pending or unread results, .close() will cancel them so that further operations using the same connection can be executed. | |
Attribute | Indicates if the cursor is closed and can't be reused. (read only) | |
Attribute | Returns the connection object that was used to create the cursor. (read-only) | |
Attribute | Returns column (field) information for a statement that returns values, such as a SELECT or a | |
Method | Specifies a SQL statement to execute | |
Method | Specifies a SQL statement to execute multiple times, based on a list of argument values | |
Method | Fetches all rows of a pending result set and returns a list of tuples | |
Method | Fetches the number of rows specified by the | |
Method | Fetches next row of a pending result set and returns a tuple | |
Method | Returns the number of fields (columns) of a result set | |
Attribute | Returns the automatically generated ID value from an INSERT statement on a table that has an AUTO_INCREMENT column | |
Method | Return the next row from the currently executing SQL statement using the same semantics as .fetchone() | |
Method | Makes the cursor skip to the next available result-set in a query that returns multiple result-sets | |
Attribute | Provides the number of rows returned by the last query. (read-only) | |
Attribute | Provides the current row number in the result-set. (read-only) | |
Method | Scrolls the cursor in the result-set to a new position according to mode | |
Method | Required by PEP-249. Does nothing in MariaDB Connector/Python. | |
Method | Required by PEP-249. Does nothing in MariaDB Connector/Python. | |
Attribute | Indicates if the current result set contains in out or out parameter from a previous executed stored procedure | |
Attribute | Displays the last executed SQL statement. (read-only) | |
Attribute | Returns the number of warnings from the last executed statement, or zero. (read only) |
Fieldinfo Class
Name | Type | Description |
---|---|---|
Method | Returns flag information for the given field | |
Method | Returns type information for the given field |
Pool Class
Name | Type | Description |
---|---|---|
Method | Adds a connection to the connection pool. In case the pool doesn't have a free slot or is not configured a PoolError exception will be raised. | |
Method | Closes connection pool and all connections | |
Method | Returns a connection from the connection pool or raises a PoolError exception if a connection is not available | |
Attribute | Returns the maximum allowed size of the connection pool. (read only) | |
Attribute | Returns the name of the connection pool. (read only) | |
Attribute | If set to true, the connection will be reset on both client and server side after .close() method is called. (read/write) | |
Attribute | Returns the size of the connection pool. (read only) | |
Method | Sets the connection configuration for the connection pool. For valid connection arguments check the mariadb.connect() method. |
Constants
Name | Description |
---|---|
CLIENT.CAN_HANDLE_EXPIRED_PASSWORDS | Connector/C |
CLIENT.COMPRESS | Connector/C |
CLIENT.CONNECT_ATTRS | Connector/C |
CLIENT.CONNECT_WITH_DB | Connector/C |
CLIENT.FOUND_ROWS | Connector/C |
CLIENT.IGNORE_SPACE | Connector/C |
CLIENT.INTERACTIVE | Connector/C |
CLIENT.LOCAL_FILES | Connector/C |
CLIENT.LONG_FLAG | Connector/C |
CLIENT.LONG_PASSWORD | Value: 1 |
CLIENT.MULTI_RESULTS | Connector/C |
CLIENT.MULTI_STATEMENTS | Connector/C |
CLIENT.MYSQL | Connector/C |
CLIENT.NO_SCHEMA | Connector/C |
CLIENT.PLUGIN_AUTH | Connector/C |
CLIENT.PS_MULTI_RESULTS | Connector/C |
CLIENT.REMEMBER_OPTIONS | Connector/C |
CLIENT.SECURE_CONNECTION | Connector/C |
CLIENT.SESSION_TRACKING | Connector/C |
CLIENT.SSL | Connector/C |
CLIENT.SSL_VERIFY_SERVER_CERT | Connector/C |
CLIENT.TRANSACTIONS | Connector/C |
CURSOR.NONE | Value: 0 |
CURSOR.READ_ONLY | Value: 1 |
FIELD_TYPE.BIT | Connector/C |
FIELD_TYPE.BLOB | Connector/C |
FIELD_TYPE.DATE | Connector/C |
FIELD_TYPE.DATETIME | Connector/C |
FIELD_TYPE.DATETIME2 | Connector/C |
FIELD_TYPE.DECIMAL | Connector/C |
FIELD_TYPE.DOUBLE | Connector/C |
FIELD_TYPE.ENUM | Connector/C |
FIELD_TYPE.FLOAT | Connector/C |
FIELD_TYPE.GEOMETRY | Value: 255 |
FIELD_TYPE.INT24 | Connector/C |
FIELD_TYPE.JSON | Connector/C |
FIELD_TYPE.LONG | Connector/C |
FIELD_TYPE.LONG_BLOB | Connector/C |
FIELD_TYPE.LONGLONG | Connector/C |
FIELD_TYPE.MEDIUM_BLOB | Connector/C |
FIELD_TYPE.NEWDATE | Connector/C |
FIELD_TYPE.NEWDECIMAL | Connector/C |
FIELD_TYPE.NULL | Connector/C |
FIELD_TYPE.SET | Connector/C |
FIELD_TYPE.SHORT | Connector/C |
FIELD_TYPE.STRING | Value: 254 |
FIELD_TYPE.TIME | Connector/C |
FIELD_TYPE.TIME2 | Connector/C |
FIELD_TYPE.TIMESTAMP | Connector/C |
FIELD_TYPE.TIMESTAMP2 | Connector/C |
FIELD_TYPE.TINY | Connector/C |
FIELD_TYPE.TINY_BLOB | Connector/C |
FIELD_TYPE.VAR_STRING | Value: 253 |
FIELD_TYPE.VARCHAR | Connector/C |
FIELD_TYPE.YEAR | Connector/C |
INDICATOR.DEFAULT | Connector/C |
INDICATOR.IGNORE | Connector/C |
INDICATOR.IGNORE_ROW | Connector/C |
INDICATOR.NULL | Connector/C |