connection_id

Overview

Returns the (thread) id for the current connection. (read only)

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

The following outputs the connection ID (thread ID) for the current MariaDB connection:

import mariadb

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

cid = conn.connection_id
print(cid) # Prints an integer value

CHANGE HISTORY

Release Series

History

1.1

  • Present starting in MariaDB Connector/Python 1.1.0rc1.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.