sqlite3.connect()
sqlite3.connect() is a Python function in the SQLite Module category. Connects to an SQLite database file (or creates it). Returns a Connection object. The syntax is sqlite3.connect(database, timeout=5.0, detect_types=0, isolation_level=None, check_same_thread=True, factory=None). Parameters: database — file path. Returns: Connection object. A typical example: import sqlite3
conn = sqlite3.connect("data.db"). A close sibling is sqlite3.Connection.execute(), which executes a single SQL statement and returns a Cursor. A close sibling is sqlite3.Connection.cursor(), which creates a Cursor object for database operations. A close sibling is sqlite3.Cursor.execute(), which executes a SQL statement with optional parameter substitution. A close sibling is sqlite3.Cursor.executemany(), which executes a SQL statement against all parameter sequences. More about this category: SQLite database — connect, execute, commit, fetchone, fetchall, Row. Related SQLite Module entries: sqlite3.Connection.execute(), sqlite3.Connection.cursor(), sqlite3.Cursor.execute(), sqlite3.Cursor.executemany(), sqlite3.Cursor.fetchone(), sqlite3.Cursor.fetchall(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.