The rustmy module¶
PEP 249 globals¶
| Name | Value | |
|---|---|---|
rustmy.apilevel |
"2.0" |
the DB-API version |
rustmy.threadsafety |
1 |
threads may share the module, not connections |
rustmy.paramstyle |
"format" |
%s and %(name)s placeholders |
rustmy.__version__ |
e.g. "1.5.0" |
rustmy's version |
rustmy.connect is Connection.
rustmy.install_as_MySQLdb
¶
Make import MySQLdb load rustmy (for Django and other code written
against mysqlclient); see rustmy._mysqldb.
Type objects and constructors¶
PEP 249 type objects and constructors.
STRING
module-attribute
¶
BINARY
module-attribute
¶
BINARY = DBAPISet(
{
FieldType.BLOB,
FieldType.TINY_BLOB,
FieldType.MEDIUM_BLOB,
FieldType.LONG_BLOB,
FieldType.GEOMETRY,
FieldType.BIT,
}
)
NUMBER
module-attribute
¶
NUMBER = DBAPISet(
{
FieldType.DECIMAL,
FieldType.NEWDECIMAL,
FieldType.TINY,
FieldType.SHORT,
FieldType.LONG,
FieldType.INT24,
FieldType.LONGLONG,
FieldType.FLOAT,
FieldType.DOUBLE,
FieldType.YEAR,
}
)
DATETIME
module-attribute
¶
DATETIME = DBAPISet(
{
FieldType.DATE,
FieldType.NEWDATE,
FieldType.TIME,
FieldType.DATETIME,
FieldType.TIMESTAMP,
}
)
Constants¶
rustmy.constants holds the MySQL constants under the module names other
drivers use, so code written for them finds them:
| Module | Holds |
|---|---|
rustmy.constants.ER |
server error codes (ER.DUP_ENTRY…), generated from every supported server's catalogue |
rustmy.constants.CR |
client error codes (CR.SERVER_LOST…) |
rustmy.constants.FIELD_TYPE |
column types, as in cursor.description |
rustmy.constants.FLAG |
column flags |
rustmy.constants.CLIENT |
capability flags |
rustmy.constants.SERVER_STATUS |
server status flags |