for exampleif you call sqlite register_converter('decimal'decimal decimal)then you can have values in queries converted to decimal objects by writing queries such as 'select price as "price [decimal]from stocksregister_adapter(typefuncregisters an adapter function for python type type that is used when storing values of that type in the datatype func is function that accepts an instance of type type as input and returns intfloatutf- -encoded byte stringunicode stringor buffer as result for exampleif you wanted to store decimal objectsyou might use sqlite register_adapter(decimal decimal,floatcomplete_statement(sreturns true if the string represents one or more complete sql statements separated by semicolons this might be useful if writing an interactive program that reads queries from the user enable_callback_tracebacks(flagdetermines the handling of exceptions in user-defined callback functions such as converters and adapters by defaultexceptions are ignored if flag is set to truetraceback messages will be printed on sys stderr connection objects the connection object returned by the connect(function supports the standard operations described in the database api in additionthe following methods specific to the sqlite module are provided create_function(namenum_paramsfunccreates user-defined function that can be used in sql statements name is string containing the name of the functionnum_params is an integer giving the number of parametersand func is python function that provides the implementation here is simple exampledef toupper( )return upper( create_function("toupper", ,touppersample use in query execute("select toupper(name),foo,bar from sometable"although python function is being definedthe parameters and inputs of this function should only be intfloatstrunicodebufferor none create_aggregate(namenum_paramsaggregate_classcreates user-defined aggregation function for use in sql statements name is string containing the name of the functionand num_params is an integer giving the number of input parameters aggregate_class is class that implements the aggregation operation this class must support initialization with no arguments and implements step(paramsmethod that accepts the same number of parameters as given in num_params and finalize(method that returns the final result here is simple exampleclass averager(object)def _init_ (self)self total self count lib fl ff