The sqlanydb Module
To use the sqlanydb module from a Python script, you must first load it by including the following line at the top of the file.
How to Open and Close a Database Connection Using Python
Generally, you open a single connection to a database and then perform all the required operations through it by executing a sequence of SQL statements. To open a connection, you use the connect method. The return value is a handle to the database connection that you use to perform subsequent operations on that connection.
How to Obtain Result Sets Using Python
Once you have obtained a handle to an open connection, you can access and modify data stored in the database. Perhaps the simplest operation is to retrieve some rows and print them out.
How to Insert Rows Using Python
The simplest way to insert rows into a table is to use a non-parameterized INSERT statement, meaning that values are specified as part of the SQL statement. A new statement is constructed and executed for each new row. As in the previous example, a cursor is required to execute SQL statements.
Database Type Conversion
To control how database types are mapped into Python objects when results are fetched from the database server, conversion callbacks can be registered.