vsql-python 1.2.4__tar.gz → 1.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vsql_python-1.2.4 → vsql_python-1.2.5}/PKG-INFO +6 -4
- {vsql_python-1.2.4 → vsql_python-1.2.5}/README.md +5 -3
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql/_connection.py +6 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/PKG-INFO +6 -4
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/scm_version.json +2 -2
- {vsql_python-1.2.4 → vsql_python-1.2.5}/tests/test_vsql.py +10 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/.github/workflows/release.yml +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/.github/workflows/test.yml +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/.gitignore +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/LICENSE +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/MANIFEST.in +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/example/main.py +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/internal/amalgamation/LICENSE +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/internal/amalgamation/LICENSE-V +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/internal/amalgamation/libvsql.c +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/internal/amalgamation/libvsql.h +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/libvsql_flags.json +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/pyproject.toml +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/scripts/update-amalgamation.sh +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/setup.cfg +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/setup.py +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql/__init__.py +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql/_convert.py +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql/_errors.py +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql/_libvsql.c +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/SOURCES.txt +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/dependency_links.txt +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/scm_file_list.json +0 -0
- {vsql_python-1.2.4 → vsql_python-1.2.5}/src/vsql_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vsql-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.5
|
|
4
4
|
Summary: A DB-API 2.0 (PEP 249) driver for vsql, a single file or in-memory SQL database.
|
|
5
5
|
Author-email: Elliot Chance <elliotchance@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -140,9 +140,11 @@ The `type_code` in `cursor.description` is the name of the type (such as
|
|
|
140
140
|
`vsql.NUMBER`, `vsql.STRING`, `vsql.BINARY` or `vsql.DATETIME` (which includes
|
|
141
141
|
the intervals). The `internal_size` is the length of a string (in octets, 4 for
|
|
142
142
|
each character) or a binary string, the precision of a number, or the length of
|
|
143
|
-
a datetime or interval
|
|
144
|
-
or `NUMERIC`, the precision of a `DECFLOAT`
|
|
145
|
-
|
|
143
|
+
a datetime or interval (which is also its `display_size`). The `precision` and
|
|
144
|
+
`scale` are those of a `DECIMAL` or `NUMERIC`, the precision of a `DECFLOAT`
|
|
145
|
+
(16 or 34), or the leading field precision and the fractional seconds
|
|
146
|
+
precision of an interval. The `scale` of a `TIME` or `TIMESTAMP` is its
|
|
147
|
+
fractional seconds precision.
|
|
146
148
|
|
|
147
149
|
## Errors
|
|
148
150
|
|
|
@@ -121,9 +121,11 @@ The `type_code` in `cursor.description` is the name of the type (such as
|
|
|
121
121
|
`vsql.NUMBER`, `vsql.STRING`, `vsql.BINARY` or `vsql.DATETIME` (which includes
|
|
122
122
|
the intervals). The `internal_size` is the length of a string (in octets, 4 for
|
|
123
123
|
each character) or a binary string, the precision of a number, or the length of
|
|
124
|
-
a datetime or interval
|
|
125
|
-
or `NUMERIC`, the precision of a `DECFLOAT`
|
|
126
|
-
|
|
124
|
+
a datetime or interval (which is also its `display_size`). The `precision` and
|
|
125
|
+
`scale` are those of a `DECIMAL` or `NUMERIC`, the precision of a `DECFLOAT`
|
|
126
|
+
(16 or 34), or the leading field precision and the fractional seconds
|
|
127
|
+
precision of an interval. The `scale` of a `TIME` or `TIMESTAMP` is its
|
|
128
|
+
fractional seconds precision.
|
|
127
129
|
|
|
128
130
|
## Errors
|
|
129
131
|
|
|
@@ -414,6 +414,12 @@ def _column(name, type_name, size, digits, nullable, leading=None):
|
|
|
414
414
|
precision, scale = size, digits
|
|
415
415
|
elif type_name == "DECFLOAT":
|
|
416
416
|
precision = size
|
|
417
|
+
elif type_name.startswith(("TIME", "DATE")):
|
|
418
|
+
# The size is the length of the datetime in positions, and the scale
|
|
419
|
+
# is the fractional seconds precision (a DATE has none).
|
|
420
|
+
display_size = size
|
|
421
|
+
if type_name != "DATE":
|
|
422
|
+
scale = digits
|
|
417
423
|
elif leading is not None:
|
|
418
424
|
# An interval's precision is the leading field precision, and its scale
|
|
419
425
|
# is the fractional seconds precision (if it ends with SECOND). The
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vsql-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.5
|
|
4
4
|
Summary: A DB-API 2.0 (PEP 249) driver for vsql, a single file or in-memory SQL database.
|
|
5
5
|
Author-email: Elliot Chance <elliotchance@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -140,9 +140,11 @@ The `type_code` in `cursor.description` is the name of the type (such as
|
|
|
140
140
|
`vsql.NUMBER`, `vsql.STRING`, `vsql.BINARY` or `vsql.DATETIME` (which includes
|
|
141
141
|
the intervals). The `internal_size` is the length of a string (in octets, 4 for
|
|
142
142
|
each character) or a binary string, the precision of a number, or the length of
|
|
143
|
-
a datetime or interval
|
|
144
|
-
or `NUMERIC`, the precision of a `DECFLOAT`
|
|
145
|
-
|
|
143
|
+
a datetime or interval (which is also its `display_size`). The `precision` and
|
|
144
|
+
`scale` are those of a `DECIMAL` or `NUMERIC`, the precision of a `DECFLOAT`
|
|
145
|
+
(16 or 34), or the leading field precision and the fractional seconds
|
|
146
|
+
precision of an interval. The `scale` of a `TIME` or `TIMESTAMP` is its
|
|
147
|
+
fractional seconds precision.
|
|
146
148
|
|
|
147
149
|
## Errors
|
|
148
150
|
|
|
@@ -147,6 +147,16 @@ def test_description(conn):
|
|
|
147
147
|
assert y[1:6] == ("INTERVAL YEAR TO MONTH", 7, 7, 3, None)
|
|
148
148
|
assert s[1:6] == ("INTERVAL DAY TO SECOND", 18, 18, 4, 3)
|
|
149
149
|
|
|
150
|
+
# The scale of a TIME or TIMESTAMP is the fractional seconds precision.
|
|
151
|
+
conn.execute("""CREATE TABLE baz (d DATE, t TIME, tz TIME(6) WITH TIME ZONE,
|
|
152
|
+
ts TIMESTAMP(3), tsz TIMESTAMP WITH TIME ZONE)""")
|
|
153
|
+
d, t, tz, ts, tsz = conn.execute("SELECT * FROM baz").description
|
|
154
|
+
assert d[1:6] == ("DATE", 10, 10, None, None)
|
|
155
|
+
assert t[1:6] == ("TIME", 8, 8, None, 0)
|
|
156
|
+
assert tz[1:6] == ("TIME WITH TIME ZONE", 21, 21, None, 6)
|
|
157
|
+
assert ts[1:6] == ("TIMESTAMP", 23, 23, None, 3)
|
|
158
|
+
assert tsz[1:6] == ("TIMESTAMP WITH TIME ZONE", 32, 32, None, 6)
|
|
159
|
+
|
|
150
160
|
# A statement that isn't a query has no description.
|
|
151
161
|
conn.execute("DELETE FROM foo")
|
|
152
162
|
cur = conn.execute("DELETE FROM foo")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|