table db-api connection object methods syntax description db close(closes the connection to the database (represented by the db object which is obtained by calling connect(functiondb commit(commits any pending transaction to the databasedoes nothing for databases that don' support transactions db cursor(returns database cursor object through which queries can be executed rolls back any pending transaction to the state that existed before the transaction begandoes nothing for databases that don' support transactions db rollback(cursor execute("create table directors ("id integer primary key autoincrement unique not null"name text unique not null)"cursor execute("create table dvds ("id integer primary key autoincrement unique not null"title text not null"year integer not null"duration integer not null"director_id integer not null"foreign key (director_idreferences directors)"db commit(return db the sqlite connect(function returns database objecthaving opened the database file it is given and created an empty database file if the file did not exist in view of thisprior to calling sqlite connect()we note whether the database is going to be created from scratchbecause if it iswe must create the tables that the program relies on all queries are executed through database cursoravailable from the database object' cursor(method notice that both tables are created with an id field that has an autoincrement constraint--this means that sqlite will automatically populate the ids with unique numbersso we can leave these fields to sqlite when inserting new records sqlite supports limited range of data types--essentially just booleansnumbersand strings--but this can be extended using data "adaptors"either the predefined ones such as those for dates and datetimesor custom ones that we can use to represent any data types we like the dvds program does not need this functionalitybut if it were requiredthe sqlite module' documentation explains the details the foreign key syntax we have used may not be the same as the syntax for other databasesand in any case it is merely doc