File: __init__.py

package info (click to toggle)
pygresql 1%3A6.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,944 kB
  • sloc: python: 15,052; ansic: 5,730; makefile: 16; sh: 10
file content (186 lines) | stat: -rw-r--r-- 3,802 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/python
#
# PyGreSQL - a Python interface for the PostgreSQL database.
#
# This file contains the classic pg module.
#
# Copyright (c) 2024 by the PyGreSQL Development Team
#
# The notification handler is based on pgnotify which is
# Copyright (c) 2001 Ng Pheng Siong. All rights reserved.
#
# Please see the LICENSE.TXT file for specific restrictions.

"""PyGreSQL classic interface.

This pg module implements some basic database management stuff.
It includes the _pg module and builds on it, providing the higher
level wrapper class named DB with additional functionality.
This is known as the "classic" ("old style") PyGreSQL interface.
For a DB-API 2 compliant interface use the newer pgdb module.
"""

from __future__ import annotations

from .adapt import Adapter, Bytea, Hstore, Json, Literal
from .cast import Typecasts, get_typecast, set_typecast
from .core import (
    INV_READ,
    INV_WRITE,
    POLLING_FAILED,
    POLLING_OK,
    POLLING_READING,
    POLLING_WRITING,
    RESULT_DDL,
    RESULT_DML,
    RESULT_DQL,
    RESULT_EMPTY,
    SEEK_CUR,
    SEEK_END,
    SEEK_SET,
    TRANS_ACTIVE,
    TRANS_IDLE,
    TRANS_INERROR,
    TRANS_INTRANS,
    TRANS_UNKNOWN,
    Connection,
    DatabaseError,
    DataError,
    Error,
    IntegrityError,
    InterfaceError,
    InternalError,
    InvalidResultError,
    MultipleResultsError,
    NoResultError,
    NotSupportedError,
    OperationalError,
    ProgrammingError,
    Query,
    Warning,
    cast_array,
    cast_hstore,
    cast_record,
    connect,
    escape_bytea,
    escape_string,
    get_array,
    get_bool,
    get_bytea_escaped,
    get_datestyle,
    get_decimal,
    get_decimal_point,
    get_defbase,
    get_defhost,
    get_defopt,
    get_defport,
    get_defuser,
    get_jsondecode,
    get_pqlib_version,
    set_array,
    set_bool,
    set_bytea_escaped,
    set_datestyle,
    set_decimal,
    set_decimal_point,
    set_defbase,
    set_defhost,
    set_defopt,
    set_defpasswd,
    set_defport,
    set_defuser,
    set_jsondecode,
    set_query_helpers,
    unescape_bytea,
    version,
)
from .db import DB
from .helpers import RowCache, init_core
from .notify import NotificationHandler

__all__ = [
    'DB',
    'INV_READ',
    'INV_WRITE',
    'POLLING_FAILED',
    'POLLING_OK',
    'POLLING_READING',
    'POLLING_WRITING',
    'RESULT_DDL',
    'RESULT_DML',
    'RESULT_DQL',
    'RESULT_EMPTY',
    'SEEK_CUR',
    'SEEK_END',
    'SEEK_SET',
    'TRANS_ACTIVE',
    'TRANS_IDLE',
    'TRANS_INERROR',
    'TRANS_INTRANS',
    'TRANS_UNKNOWN',
    'Adapter',
    'Bytea',
    'Connection',
    'DataError',
    'DatabaseError',
    'Error',
    'Hstore',
    'IntegrityError',
    'InterfaceError',
    'InternalError',
    'InvalidResultError',
    'Json',
    'Literal',
    'MultipleResultsError',
    'NoResultError',
    'NotSupportedError',
    'NotificationHandler',
    'OperationalError',
    'ProgrammingError',
    'Query',
    'RowCache',
    'Typecasts',
    'Warning',
    '__version__',
    'cast_array',
    'cast_hstore',
    'cast_record',
    'connect',
    'escape_bytea',
    'escape_string',
    'get_array',
    'get_bool',
    'get_bytea_escaped',
    'get_datestyle',
    'get_decimal',
    'get_decimal_point',
    'get_defbase',
    'get_defhost',
    'get_defopt',
    'get_defport',
    'get_defuser',
    'get_jsondecode',
    'get_pqlib_version',
    'get_typecast',
    'set_array',
    'set_bool',
    'set_bytea_escaped',
    'set_datestyle',
    'set_decimal',
    'set_decimal_point',
    'set_defbase',
    'set_defhost',
    'set_defopt',
    'set_defpasswd',
    'set_defport',
    'set_defuser',
    'set_jsondecode',
    'set_query_helpers',
    'set_typecast',
    'unescape_bytea',
    'version',
]

__version__ = version

init_core()