Back to index

python3.2  3.2.2
Functions | Variables
sqlite3.dbapi2 Namespace Reference

Functions

def DateFromTicks
def TimeFromTicks
def TimestampFromTicks
def register_adapters_and_converters

Variables

string paramstyle = "qmark"
int threadsafety = 1
string apilevel = "2.0"
 Date = datetime.date
 Time = datetime.time
 Timestamp = datetime.datetime
tuple version_info = tuple([int(x) for x in version.split(".")])
tuple sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])
 Binary = memoryview

Function Documentation

Definition at line 40 of file dbapi2.py.

00040 
00041 def DateFromTicks(ticks):
00042     return Date(*time.localtime(ticks)[:3])

Definition at line 54 of file dbapi2.py.

00054 
00055 def register_adapters_and_converters():
00056     def adapt_date(val):
00057         return val.isoformat()
00058 
00059     def adapt_datetime(val):
00060         return val.isoformat(" ")
00061 
00062     def convert_date(val):
00063         return datetime.date(*map(int, val.split(b"-")))
00064 
00065     def convert_timestamp(val):
00066         datepart, timepart = val.split(b" ")
00067         year, month, day = map(int, datepart.split(b"-"))
00068         timepart_full = timepart.split(b".")
00069         hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
00070         if len(timepart_full) == 2:
00071             microseconds = int(timepart_full[1])
00072         else:
00073             microseconds = 0
00074 
00075         val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds)
00076         return val
00077 
00078 
00079     register_adapter(datetime.date, adapt_date)
00080     register_adapter(datetime.datetime, adapt_datetime)
00081     register_converter("date", convert_date)
00082     register_converter("timestamp", convert_timestamp)
00083 
00084 register_adapters_and_converters()
00085 
00086 # Clean up namespace
00087 
00088 del(register_adapters_and_converters)

Here is the call graph for this function:

Definition at line 43 of file dbapi2.py.

00043 
00044 def TimeFromTicks(ticks):
00045     return Time(*time.localtime(ticks)[3:6])

Definition at line 46 of file dbapi2.py.

00046 
00047 def TimestampFromTicks(ticks):
00048     return Timestamp(*time.localtime(ticks)[:6])


Variable Documentation

Definition at line 32 of file dbapi2.py.

sqlite3.dbapi2.Binary = memoryview

Definition at line 52 of file dbapi2.py.

Definition at line 34 of file dbapi2.py.

Definition at line 28 of file dbapi2.py.

Definition at line 50 of file dbapi2.py.

Definition at line 30 of file dbapi2.py.

Definition at line 36 of file dbapi2.py.

Definition at line 38 of file dbapi2.py.

tuple sqlite3.dbapi2.version_info = tuple([int(x) for x in version.split(".")])

Definition at line 49 of file dbapi2.py.