summaryrefslogtreecommitdiff
path: root/sqlite/__init__.py
blob: 039322ef8836be8c9482f640406037885ca42ec4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import _sqlite

"""Python interface to the SQLite embedded database engine."""

#-------------------------------------------------------------------------------
# Module Information
#-------------------------------------------------------------------------------

__revision__ = """$Revision: 1.22 $"""[11:-2]

threadsafety = 1
apilevel = "2.0"
paramstyle = "pyformat"

# This is the version string for the current PySQLite version.
version = "1.1.8"

# This is a tuple with the same digits as the version string, but it's
# suitable for comparisons of various versions.
version_info = (1, 1, 8)

#-------------------------------------------------------------------------------
# Data type support
#-------------------------------------------------------------------------------

from main import DBAPITypeObject, Cursor, Connection, PgResultSet

STRING    = DBAPITypeObject(_sqlite.STRING)

BINARY    = DBAPITypeObject(_sqlite.BINARY)

INT       = DBAPITypeObject(_sqlite.INTEGER)

NUMBER    = DBAPITypeObject(_sqlite.INTEGER,
                            _sqlite.FLOAT)

DATE      = DBAPITypeObject(_sqlite.DATE)

TIME      = DBAPITypeObject(_sqlite.TIME)

TIMESTAMP = DBAPITypeObject(_sqlite.TIMESTAMP)

ROWID     = DBAPITypeObject()

# Nonstandard extension:
UNICODESTRING = DBAPITypeObject(_sqlite.UNICODESTRING)

#-------------------------------------------------------------------------------
# Exceptions
#-------------------------------------------------------------------------------

from _sqlite import Warning, Error, InterfaceError, \
    DatabaseError, DataError, OperationalError, IntegrityError, InternalError, \
    ProgrammingError, NotSupportedError

#-------------------------------------------------------------------------------
# Global Functions
#-------------------------------------------------------------------------------

def connect(*args, **kwargs):
    return Connection(*args, **kwargs)

from _sqlite import encode, decode

Binary = encode

__all__ = ['connect','IntegrityError', 'InterfaceError', 'InternalError',
           'NotSupportedError', 'OperationalError',
           'ProgrammingError', 'Warning',
           'Connection', 'Cursor', 'PgResultSet',
           'apilevel', 'paramstyle', 'threadsafety', 'version', 'version_info',
           'Binary', 'decode']