Appendix H. Python Interface Reference

This appendix is a reference for the PySQLite extension, which provides an interface to SQLite that is compliant with the Python Database Specification 2.0.

Before attempting any database connectivity with PySQLite, you must import the sqlite module, using

import sqlite

In this appendix, the commands are shown first, followed by the explanation.

Opening and Closing a Database

cx = sqlite.connect(database, mode=0755, converters={}, autocommit=0,
                    encoding=None, timeout=None, command_logfile=None)

Opens a SQLite connection to database and returns a connection object to cx.

The mode argument is currently ignored but may be used in the future to specify the file mode with which the database file is opened.

The converters ...

Get SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.