connection

Returns the connection object that was used to create the cursor. (read-only)

See also: MariaDB Connector/Python 1.0

EXAMPLES

In the following example, the text "They are the same" will be output:

import mariadb

conn = mariadb.connect(
    host = '127.0.0.1',
    user = 'root',
    password = 'secret',
    )

cursor = conn.cursor()
if cursor.connection == conn:
    print("They are the same")

conn.close()