|
Next
Previous
Contents
3. Using MySQLdbMySQLdb is a Python Database API Specification 2.0 database module, so you should be familiar with the spec. Deviations from the spec are documented in the MySQLdb documentation.
3.1 cursor.rollback() always fails!MySQLdb now supports transactions if the server supports transaction-safe tables (TSTs) and you are using them. If your server doesn't support them, rollbacks will always fail, as they should, because it can't do what you asked. Even if your server does support them, rollbacks will fail if you modified any non-TST tables.
OTOH,
3.2 How do I use some of the special MySQL features?First answer: Don't, if you can avoid it. Your program will not be portable to other databases.
Second answer: Nearly all the special API calls are implemented on the _mysql connection object, and the MySQLdb connection object can also invoke them. See the built-in module docs to find out what ones are implemented, and the MySQL C API docs to see what they do.
3.3 I still wanna use _mysql directly.Well, it
Next Previous Contents |