python database access def step(self,value)self total +value self count + def finalize(self)return self total self count create_aggregate("myavg", ,averagersample use in query execute("select myavg(numfrom sometable"aggregation works by making repeated calls to the step(method with input values and then calling finalize(to obtain the final value create_collation(namefuncregisters user-defined collation function for use in sql statements name is string containing the name of the collation functionand func is function that accepts two inputs and returns - depending on whether or not the first input is belowequal toor above the second input you use the user-defined function using sql expression such as "select from table order by colname collate namec execute(sql [params] shortcut method that creates cursor object using cursor(and executes the cursor' execute(method with sql statements in sql with the parameters in params executemany(sql [params] shortcut method that creates cursor object using cursor(and executes the cursor' executemany(method with sql statements in sql with the parameters in params executescript(sqla shortcut method that creates cursor object using cursor(and executes the cursor' executescript(method with sql statements in sql interrupt(aborts any currently executing queries on the connection this is meant to be called from separate thread iterdump(returns an iterator that dumps the entire database contents to series of sql statements that could be executed to recreate the database this could be useful if exporting the database elsewhere or if you need to dump the contents of an in-memory database to file for later restoration set_authorizer(auth_callbackregisters an authorization callback function that gets executed on every access to column of data in the database the callback function must take five arguments as auth_callback(codearg arg dbnameinnernamethe value returned by this callback is one of sqlite_ok if access is allowedsqlite_deny if the sql statement should fail with an erroror sqlite_ignore if the column should be ignored by treating it as null value the first argument code is an integer action code arg and lib fl ff