python-sql 1.6.0__tar.gz → 1.7.0__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.
- {python_sql-1.6.0 → python_sql-1.7.0}/.gitlab-ci.yml +1 -1
- {python_sql-1.6.0 → python_sql-1.7.0}/.hgtags +1 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/CHANGELOG +4 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/PKG-INFO +2 -1
- {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/PKG-INFO +2 -1
- {python_sql-1.6.0 → python_sql-1.7.0}/setup.py +1 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/__init__.py +1 -1
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/aggregate.py +16 -6
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_aggregate.py +2 -2
- {python_sql-1.6.0 → python_sql-1.7.0}/tox.ini +1 -1
- {python_sql-1.6.0 → python_sql-1.7.0}/.flake8 +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/.isort.cfg +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/COPYRIGHT +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/MANIFEST.in +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/README.rst +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/SOURCES.txt +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/dependency_links.txt +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/top_level.txt +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/setup.cfg +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/conditionals.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/functions.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/operators.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/__init__.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_alias.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_as.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_cast.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_collate.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_column.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_combining_query.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_conditionals.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_delete.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_excluded.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_expression.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_flavor.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_for.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_from.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_from_item.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_functions.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_grouping.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_insert.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_join.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_lateral.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_literal.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_merge.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_operators.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_order.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_rollup.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_select.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_table.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_update.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_values.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_window.py +0 -0
- {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_with.py +0 -0
|
@@ -57,7 +57,7 @@ test-tox-python:
|
|
|
57
57
|
- tox -e "py${PYTHON_VERSION/./}" -- -v --output-file junit.xml
|
|
58
58
|
parallel:
|
|
59
59
|
matrix:
|
|
60
|
-
- PYTHON_VERSION: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
60
|
+
- PYTHON_VERSION: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
61
61
|
|
|
62
62
|
test-tox-pypy:
|
|
63
63
|
extends: .test-tox
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-sql
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Library to write SQL queries
|
|
5
5
|
Home-page: https://pypi.org/project/python-sql/
|
|
6
6
|
Download-URL: https://downloads.tryton.org/python-sql/
|
|
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
29
|
Classifier: Topic :: Database
|
|
29
30
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
30
31
|
Requires-Python: >=3.5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-sql
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Library to write SQL queries
|
|
5
5
|
Home-page: https://pypi.org/project/python-sql/
|
|
6
6
|
Download-URL: https://downloads.tryton.org/python-sql/
|
|
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
26
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
29
|
Classifier: Topic :: Database
|
|
29
30
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
30
31
|
Requires-Python: >=3.5
|
|
@@ -49,6 +49,7 @@ setup(name='python-sql',
|
|
|
49
49
|
'Programming Language :: Python :: 3.11',
|
|
50
50
|
'Programming Language :: Python :: 3.12',
|
|
51
51
|
'Programming Language :: Python :: 3.13',
|
|
52
|
+
'Programming Language :: Python :: 3.14',
|
|
52
53
|
'Topic :: Database',
|
|
53
54
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
54
55
|
],
|
|
@@ -7,7 +7,7 @@ from collections import defaultdict
|
|
|
7
7
|
from itertools import chain
|
|
8
8
|
from threading import current_thread, local
|
|
9
9
|
|
|
10
|
-
__version__ = '1.
|
|
10
|
+
__version__ = '1.7.0'
|
|
11
11
|
__all__ = [
|
|
12
12
|
'Flavor', 'Table', 'Values', 'Literal', 'Column', 'Grouping', 'Conflict',
|
|
13
13
|
'Matched', 'MatchedUpdate', 'MatchedDelete',
|
|
@@ -4,7 +4,6 @@ from sql import Expression, Flavor, Literal, Window
|
|
|
4
4
|
|
|
5
5
|
__all__ = ['Avg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'Count', 'Every',
|
|
6
6
|
'Max', 'Min', 'Stddev', 'Sum', 'Variance']
|
|
7
|
-
_sentinel = object()
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class Aggregate(Expression):
|
|
@@ -169,20 +168,31 @@ class BoolOr(Aggregate):
|
|
|
169
168
|
_sql = 'BOOL_OR'
|
|
170
169
|
|
|
171
170
|
|
|
171
|
+
class _Star(Expression):
|
|
172
|
+
__slots__ = ()
|
|
173
|
+
|
|
174
|
+
def __str__(self):
|
|
175
|
+
return '*'
|
|
176
|
+
|
|
177
|
+
@property
|
|
178
|
+
def params(self):
|
|
179
|
+
return ()
|
|
180
|
+
|
|
181
|
+
|
|
172
182
|
class Count(Aggregate):
|
|
173
183
|
__slots__ = ()
|
|
174
184
|
_sql = 'COUNT'
|
|
175
185
|
|
|
176
|
-
def __init__(self, expression=
|
|
177
|
-
if expression is _sentinel:
|
|
178
|
-
expression = Literal('*')
|
|
186
|
+
def __init__(self, expression=_Star(), **kwargs):
|
|
179
187
|
super().__init__(expression, **kwargs)
|
|
180
188
|
|
|
181
189
|
@property
|
|
182
190
|
def _case_expression(self):
|
|
183
191
|
expression = super(Count, self)._case_expression
|
|
184
|
-
if (isinstance(self.expression,
|
|
185
|
-
|
|
192
|
+
if (isinstance(self.expression, _Star)
|
|
193
|
+
# Keep testing Literal('*') for backward compatibility
|
|
194
|
+
or (isinstance(self.expression, Literal)
|
|
195
|
+
and expression.value == '*')):
|
|
186
196
|
expression = Literal(1)
|
|
187
197
|
return expression
|
|
188
198
|
|
|
@@ -42,8 +42,8 @@ class TestAggregate(unittest.TestCase):
|
|
|
42
42
|
|
|
43
43
|
def test_count_without_expression(self):
|
|
44
44
|
count = Count()
|
|
45
|
-
self.assertEqual(str(count), 'COUNT(
|
|
46
|
-
self.assertEqual(count.params, (
|
|
45
|
+
self.assertEqual(str(count), 'COUNT(*)')
|
|
46
|
+
self.assertEqual(count.params, ())
|
|
47
47
|
|
|
48
48
|
def test_order_by_one_column(self):
|
|
49
49
|
avg = Avg(self.table.a, order_by=self.table.b)
|
|
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
|
|
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
|