SQLITE 3
sqlite3-interface DB-API 2.0 pour la base de donnée SQLite.............3
1. Fonctions et constantes du module.............................................................................4
sqlite3.PARSE_DECLTYPES .........................................................................................................4
sqlite3.PARSE_COLNAMES...........................................................................................................4
sqlite3.connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory,
cached_statements]) ...................................................................................................................... 4
sqlite3.register_converter(typename, callable) ...............................................................................5
sqlite3.register_adapter(type, callable)............................................................................................5
sqlite3.complete_statement(sql)...................................................................................................... 5
con.close()....................................................................................................................................... 6
2. Les objets Connection...................................................................................................6
class sqlite3.Connection.................................................................................................................. 6
Connection.isolation_level............................................................................................................... 6
Connection.in_transaction -v.3.2-....................................................................................................6
Connection.cursor([cursorClass]) ...................................................................................................6
Connection.commit() ...................................................................................................................... 6
Connection.rollback()....................................................................................................................... 6
Connection.close............................................................................................................................. 7
Connection.execute(sql[, parameters]) ...........................................................................................7
Connection.executemany(sql[, parameters])...................................................................................7
Connection.executescript(sql_script)...............................................................................................7
Connection.create_function(name, num_params, func) .................................................................7
Connection.create_collation(name, callable) ..................................................................................8
Connection.interrupt()...................................................................................................................... 8
Connection.set_authorizer(authorizer_callback)..............................................................................9
Connection.set_progress_handler(handler, n) ................................................................................9
Connection.enable_load_extension(enabled) -version 3.2.-............................................................9
Connection.load_extension(path) -version 3.2.-............................................................................10
Connection.row_factory................................................................................................................. 10
Connection.text_factory................................................................................................................. 10
Connection.total_changes.............................................................................................................11
Connection.iterdump..................................................................................................................... 12
3. Les objets Cursor.........................................................................................................12
class sqlite3.Cursor ...................................................................................................................... 12
Cursor.execute(sql[, parameters]) ................................................................................................12
Cursor.executemany(sql, seq_of_parameters) .............................................................................13
Cursor.executescript(sql_script)....................................................................................................14
Cursor.fetchone() ..........................................................................................................................14
Cursor.fetchmany([size=cursor.arraysize])....................................................................................14
Cursor.fetchall() ............................................................................................................................ 14
Cursor.rowcount............................................................................................................................ 15
Cursor.lastrowid............................................................................................................................. 15
Cursor.description.......................................................................................................................... 15
19 septembre 2013 page 1 SQLITE 3