piccolo 1.7.0__py3-none-any.whl → 1.9.0__py3-none-any.whl
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.
- piccolo/__init__.py +1 -1
- piccolo/columns/base.py +59 -29
- piccolo/columns/defaults/base.py +5 -3
- piccolo/query/functions/__init__.py +7 -0
- piccolo/query/functions/aggregate.py +12 -12
- piccolo/query/functions/math.py +48 -0
- piccolo/query/functions/type_conversion.py +82 -0
- piccolo/querystring.py +30 -0
- piccolo/schema.py +2 -1
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/METADATA +1 -1
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/RECORD +26 -18
- tests/apps/migrations/auto/integration/test_migrations.py +28 -5
- tests/apps/migrations/auto/test_migration_manager.py +15 -15
- tests/columns/test_array.py +63 -19
- tests/columns/test_get_sql_value.py +66 -0
- tests/query/functions/__init__.py +0 -0
- tests/query/functions/base.py +34 -0
- tests/query/{test_functions.py → functions/test_functions.py} +5 -43
- tests/query/functions/test_math.py +39 -0
- tests/query/functions/test_string.py +25 -0
- tests/query/functions/test_type_conversion.py +134 -0
- tests/query/test_querystring.py +136 -0
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/LICENSE +0 -0
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/WHEEL +0 -0
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/entry_points.txt +0 -0
- {piccolo-1.7.0.dist-info → piccolo-1.9.0.dist-info}/top_level.txt +0 -0
piccolo/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "1.
|
1
|
+
__VERSION__ = "1.9.0"
|
piccolo/columns/base.py
CHANGED
@@ -201,6 +201,10 @@ class ColumnMeta:
|
|
201
201
|
)
|
202
202
|
return self._table
|
203
203
|
|
204
|
+
@table.setter
|
205
|
+
def table(self, value: t.Type[Table]):
|
206
|
+
self._table = value
|
207
|
+
|
204
208
|
###########################################################################
|
205
209
|
|
206
210
|
# Used by Foreign Keys:
|
@@ -826,7 +830,11 @@ class Column(Selectable):
|
|
826
830
|
engine_type=engine_type, with_alias=False
|
827
831
|
)
|
828
832
|
|
829
|
-
def get_sql_value(
|
833
|
+
def get_sql_value(
|
834
|
+
self,
|
835
|
+
value: t.Any,
|
836
|
+
delimiter: str = "'",
|
837
|
+
) -> str:
|
830
838
|
"""
|
831
839
|
When using DDL statements, we can't parameterise the values. An example
|
832
840
|
is when setting the default for a column. So we have to convert from
|
@@ -835,11 +843,18 @@ class Column(Selectable):
|
|
835
843
|
|
836
844
|
:param value:
|
837
845
|
The Python value to convert to a string usable in a DDL statement
|
838
|
-
e.g. 1
|
846
|
+
e.g. ``1``.
|
847
|
+
:param delimiter:
|
848
|
+
The string returned by this function is wrapped in delimiters,
|
849
|
+
ready to be added to a DDL statement. For example:
|
850
|
+
``'hello world'``.
|
839
851
|
:returns:
|
840
|
-
The string usable in the DDL statement e.g. '1'
|
852
|
+
The string usable in the DDL statement e.g. ``'1'``.
|
841
853
|
|
842
854
|
"""
|
855
|
+
from piccolo.engine.sqlite import ADAPTERS as sqlite_adapters
|
856
|
+
|
857
|
+
# Common across all DB engines
|
843
858
|
if isinstance(value, Default):
|
844
859
|
return getattr(value, self._meta.engine_type)
|
845
860
|
elif value is None:
|
@@ -847,37 +862,52 @@ class Column(Selectable):
|
|
847
862
|
elif isinstance(value, (float, decimal.Decimal)):
|
848
863
|
return str(value)
|
849
864
|
elif isinstance(value, str):
|
850
|
-
return f"
|
865
|
+
return f"{delimiter}{value}{delimiter}"
|
851
866
|
elif isinstance(value, bool):
|
852
867
|
return str(value).lower()
|
853
|
-
elif isinstance(value, datetime.datetime):
|
854
|
-
return f"'{value.isoformat().replace('T', ' ')}'"
|
855
|
-
elif isinstance(value, datetime.date):
|
856
|
-
return f"'{value.isoformat()}'"
|
857
|
-
elif isinstance(value, datetime.time):
|
858
|
-
return f"'{value.isoformat()}'"
|
859
|
-
elif isinstance(value, datetime.timedelta):
|
860
|
-
interval = IntervalCustom.from_timedelta(value)
|
861
|
-
return getattr(interval, self._meta.engine_type)
|
862
868
|
elif isinstance(value, bytes):
|
863
|
-
return f"
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
(
|
872
|
-
|
873
|
-
|
874
|
-
|
869
|
+
return f"{delimiter}{value.hex()}{delimiter}"
|
870
|
+
|
871
|
+
# SQLite specific
|
872
|
+
if self._meta.engine_type == "sqlite":
|
873
|
+
if adapter := sqlite_adapters.get(type(value)):
|
874
|
+
sqlite_value = adapter(value)
|
875
|
+
return (
|
876
|
+
f"{delimiter}{sqlite_value}{delimiter}"
|
877
|
+
if isinstance(sqlite_value, str)
|
878
|
+
else sqlite_value
|
879
|
+
)
|
880
|
+
|
881
|
+
# Postgres and Cockroach
|
882
|
+
if self._meta.engine_type in ["postgres", "cockroach"]:
|
883
|
+
if isinstance(value, datetime.datetime):
|
884
|
+
return f"{delimiter}{value.isoformat().replace('T', ' ')}{delimiter}" # noqa: E501
|
885
|
+
elif isinstance(value, datetime.date):
|
886
|
+
return f"{delimiter}{value.isoformat()}{delimiter}"
|
887
|
+
elif isinstance(value, datetime.time):
|
888
|
+
return f"{delimiter}{value.isoformat()}{delimiter}"
|
889
|
+
elif isinstance(value, datetime.timedelta):
|
890
|
+
interval = IntervalCustom.from_timedelta(value)
|
891
|
+
return getattr(interval, self._meta.engine_type)
|
892
|
+
elif isinstance(value, uuid.UUID):
|
893
|
+
return f"{delimiter}{value}{delimiter}"
|
894
|
+
elif isinstance(value, list):
|
895
|
+
# Convert to the array syntax.
|
896
|
+
return (
|
897
|
+
delimiter
|
898
|
+
+ "{"
|
899
|
+
+ ",".join(
|
900
|
+
self.get_sql_value(
|
901
|
+
i,
|
902
|
+
delimiter="" if isinstance(i, list) else '"',
|
903
|
+
)
|
904
|
+
for i in value
|
875
905
|
)
|
876
|
-
|
906
|
+
+ "}"
|
907
|
+
+ delimiter
|
877
908
|
)
|
878
|
-
|
879
|
-
|
880
|
-
return value
|
909
|
+
|
910
|
+
return str(value)
|
881
911
|
|
882
912
|
@property
|
883
913
|
def column_type(self):
|
piccolo/columns/defaults/base.py
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import typing as t
|
4
|
-
from abc import ABC, abstractmethod
|
4
|
+
from abc import ABC, abstractmethod
|
5
5
|
|
6
6
|
from piccolo.utils.repr import repr_class_instance
|
7
7
|
|
8
8
|
|
9
9
|
class Default(ABC):
|
10
|
-
@
|
10
|
+
@property
|
11
|
+
@abstractmethod
|
11
12
|
def postgres(self) -> str:
|
12
13
|
pass
|
13
14
|
|
14
|
-
@
|
15
|
+
@property
|
16
|
+
@abstractmethod
|
15
17
|
def sqlite(self) -> str:
|
16
18
|
pass
|
17
19
|
|
@@ -1,15 +1,22 @@
|
|
1
1
|
from .aggregate import Avg, Count, Max, Min, Sum
|
2
|
+
from .math import Abs, Ceil, Floor, Round
|
2
3
|
from .string import Length, Lower, Ltrim, Reverse, Rtrim, Upper
|
4
|
+
from .type_conversion import Cast
|
3
5
|
|
4
6
|
__all__ = (
|
7
|
+
"Abs",
|
5
8
|
"Avg",
|
9
|
+
"Cast",
|
10
|
+
"Ceil",
|
6
11
|
"Count",
|
12
|
+
"Floor",
|
7
13
|
"Length",
|
8
14
|
"Lower",
|
9
15
|
"Ltrim",
|
10
16
|
"Max",
|
11
17
|
"Min",
|
12
18
|
"Reverse",
|
19
|
+
"Round",
|
13
20
|
"Rtrim",
|
14
21
|
"Sum",
|
15
22
|
"Upper",
|
@@ -12,17 +12,17 @@ class Avg(Function):
|
|
12
12
|
|
13
13
|
.. code-block:: python
|
14
14
|
|
15
|
-
await Band.select(Avg(Band.popularity))
|
15
|
+
await Band.select(Avg(Band.popularity))
|
16
16
|
|
17
17
|
# We can use an alias. These two are equivalent:
|
18
18
|
|
19
19
|
await Band.select(
|
20
20
|
Avg(Band.popularity, alias="popularity_avg")
|
21
|
-
)
|
21
|
+
)
|
22
22
|
|
23
23
|
await Band.select(
|
24
24
|
Avg(Band.popularity).as_alias("popularity_avg")
|
25
|
-
)
|
25
|
+
)
|
26
26
|
|
27
27
|
"""
|
28
28
|
|
@@ -103,17 +103,17 @@ class Min(Function):
|
|
103
103
|
|
104
104
|
.. code-block:: python
|
105
105
|
|
106
|
-
await Band.select(Min(Band.popularity))
|
106
|
+
await Band.select(Min(Band.popularity))
|
107
107
|
|
108
108
|
# We can use an alias. These two are equivalent:
|
109
109
|
|
110
110
|
await Band.select(
|
111
111
|
Min(Band.popularity, alias="popularity_min")
|
112
|
-
)
|
112
|
+
)
|
113
113
|
|
114
114
|
await Band.select(
|
115
115
|
Min(Band.popularity).as_alias("popularity_min")
|
116
|
-
)
|
116
|
+
)
|
117
117
|
|
118
118
|
"""
|
119
119
|
|
@@ -128,17 +128,17 @@ class Max(Function):
|
|
128
128
|
|
129
129
|
await Band.select(
|
130
130
|
Max(Band.popularity)
|
131
|
-
)
|
131
|
+
)
|
132
132
|
|
133
133
|
# We can use an alias. These two are equivalent:
|
134
134
|
|
135
135
|
await Band.select(
|
136
136
|
Max(Band.popularity, alias="popularity_max")
|
137
|
-
)
|
137
|
+
)
|
138
138
|
|
139
139
|
await Band.select(
|
140
140
|
Max(Band.popularity).as_alias("popularity_max")
|
141
|
-
)
|
141
|
+
)
|
142
142
|
|
143
143
|
"""
|
144
144
|
|
@@ -153,17 +153,17 @@ class Sum(Function):
|
|
153
153
|
|
154
154
|
await Band.select(
|
155
155
|
Sum(Band.popularity)
|
156
|
-
)
|
156
|
+
)
|
157
157
|
|
158
158
|
# We can use an alias. These two are equivalent:
|
159
159
|
|
160
160
|
await Band.select(
|
161
161
|
Sum(Band.popularity, alias="popularity_sum")
|
162
|
-
)
|
162
|
+
)
|
163
163
|
|
164
164
|
await Band.select(
|
165
165
|
Sum(Band.popularity).as_alias("popularity_sum")
|
166
|
-
)
|
166
|
+
)
|
167
167
|
|
168
168
|
"""
|
169
169
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"""
|
2
|
+
These functions mirror their counterparts in the Postgresql docs:
|
3
|
+
|
4
|
+
https://www.postgresql.org/docs/current/functions-math.html
|
5
|
+
|
6
|
+
"""
|
7
|
+
|
8
|
+
from .base import Function
|
9
|
+
|
10
|
+
|
11
|
+
class Abs(Function):
|
12
|
+
"""
|
13
|
+
Absolute value.
|
14
|
+
"""
|
15
|
+
|
16
|
+
function_name = "ABS"
|
17
|
+
|
18
|
+
|
19
|
+
class Ceil(Function):
|
20
|
+
"""
|
21
|
+
Nearest integer greater than or equal to argument.
|
22
|
+
"""
|
23
|
+
|
24
|
+
function_name = "CEIL"
|
25
|
+
|
26
|
+
|
27
|
+
class Floor(Function):
|
28
|
+
"""
|
29
|
+
Nearest integer less than or equal to argument.
|
30
|
+
"""
|
31
|
+
|
32
|
+
function_name = "FLOOR"
|
33
|
+
|
34
|
+
|
35
|
+
class Round(Function):
|
36
|
+
"""
|
37
|
+
Rounds to nearest integer.
|
38
|
+
"""
|
39
|
+
|
40
|
+
function_name = "ROUND"
|
41
|
+
|
42
|
+
|
43
|
+
__all__ = (
|
44
|
+
"Abs",
|
45
|
+
"Ceil",
|
46
|
+
"Floor",
|
47
|
+
"Round",
|
48
|
+
)
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import typing as t
|
2
|
+
|
3
|
+
from piccolo.columns.base import Column
|
4
|
+
from piccolo.querystring import QueryString
|
5
|
+
|
6
|
+
|
7
|
+
class Cast(QueryString):
|
8
|
+
def __init__(
|
9
|
+
self,
|
10
|
+
identifier: t.Union[Column, QueryString],
|
11
|
+
as_type: Column,
|
12
|
+
alias: t.Optional[str] = None,
|
13
|
+
):
|
14
|
+
"""
|
15
|
+
Cast a value to a different type. For example::
|
16
|
+
|
17
|
+
>>> from piccolo.query.functions import Cast
|
18
|
+
|
19
|
+
>>> await Concert.select(
|
20
|
+
... Cast(Concert.starts, Time(), "start_time")
|
21
|
+
... )
|
22
|
+
[{"start_time": datetime.time(19, 0)}]
|
23
|
+
|
24
|
+
:param identifier:
|
25
|
+
Identifies what is being converted (e.g. a column).
|
26
|
+
:param as_type:
|
27
|
+
The type to be converted to.
|
28
|
+
|
29
|
+
"""
|
30
|
+
# Make sure the identifier is a supported type.
|
31
|
+
|
32
|
+
if not isinstance(identifier, (Column, QueryString)):
|
33
|
+
raise ValueError(
|
34
|
+
"The identifier is an unsupported type - only Column and "
|
35
|
+
"QueryString instances are allowed."
|
36
|
+
)
|
37
|
+
|
38
|
+
#######################################################################
|
39
|
+
# Convert `as_type` to a string which can be used in the query.
|
40
|
+
|
41
|
+
if not isinstance(as_type, Column):
|
42
|
+
raise ValueError("The `as_type` value must be a Column instance.")
|
43
|
+
|
44
|
+
# We need to give the column a reference to a table, and hence
|
45
|
+
# the database engine, as the column type is sometimes dependent
|
46
|
+
# on which database is being used.
|
47
|
+
from piccolo.table import Table, create_table_class
|
48
|
+
|
49
|
+
table: t.Optional[t.Type[Table]] = None
|
50
|
+
|
51
|
+
if isinstance(identifier, Column):
|
52
|
+
table = identifier._meta.table
|
53
|
+
elif isinstance(identifier, QueryString):
|
54
|
+
table = (
|
55
|
+
identifier.columns[0]._meta.table
|
56
|
+
if identifier.columns
|
57
|
+
else None
|
58
|
+
)
|
59
|
+
|
60
|
+
as_type._meta.table = table or create_table_class("Table")
|
61
|
+
as_type_string = as_type.column_type
|
62
|
+
|
63
|
+
#######################################################################
|
64
|
+
# Preserve the original alias from the column.
|
65
|
+
|
66
|
+
if isinstance(identifier, Column):
|
67
|
+
alias = (
|
68
|
+
alias
|
69
|
+
or identifier._alias
|
70
|
+
or identifier._meta.get_default_alias()
|
71
|
+
)
|
72
|
+
|
73
|
+
#######################################################################
|
74
|
+
|
75
|
+
super().__init__(
|
76
|
+
f"CAST({{}} AS {as_type_string})",
|
77
|
+
identifier,
|
78
|
+
alias=alias,
|
79
|
+
)
|
80
|
+
|
81
|
+
|
82
|
+
__all__ = ("Cast",)
|
piccolo/querystring.py
CHANGED
@@ -270,12 +270,42 @@ class QueryString(Selectable):
|
|
270
270
|
def __sub__(self, value) -> QueryString:
|
271
271
|
return QueryString("{} - {}", self, value)
|
272
272
|
|
273
|
+
def __gt__(self, value) -> QueryString:
|
274
|
+
return QueryString("{} > {}", self, value)
|
275
|
+
|
276
|
+
def __ge__(self, value) -> QueryString:
|
277
|
+
return QueryString("{} >= {}", self, value)
|
278
|
+
|
279
|
+
def __lt__(self, value) -> QueryString:
|
280
|
+
return QueryString("{} < {}", self, value)
|
281
|
+
|
282
|
+
def __le__(self, value) -> QueryString:
|
283
|
+
return QueryString("{} <= {}", self, value)
|
284
|
+
|
285
|
+
def __truediv__(self, value) -> QueryString:
|
286
|
+
return QueryString("{} / {}", self, value)
|
287
|
+
|
288
|
+
def __mul__(self, value) -> QueryString:
|
289
|
+
return QueryString("{} * {}", self, value)
|
290
|
+
|
291
|
+
def __pow__(self, value) -> QueryString:
|
292
|
+
return QueryString("{} ^ {}", self, value)
|
293
|
+
|
294
|
+
def __mod__(self, value) -> QueryString:
|
295
|
+
return QueryString("{} % {}", self, value)
|
296
|
+
|
273
297
|
def is_in(self, value) -> QueryString:
|
274
298
|
return QueryString("{} IN {}", self, value)
|
275
299
|
|
276
300
|
def not_in(self, value) -> QueryString:
|
277
301
|
return QueryString("{} NOT IN {}", self, value)
|
278
302
|
|
303
|
+
def like(self, value: str) -> QueryString:
|
304
|
+
return QueryString("{} LIKE {}", self, value)
|
305
|
+
|
306
|
+
def ilike(self, value: str) -> QueryString:
|
307
|
+
return QueryString("{} ILIKE {}", self, value)
|
308
|
+
|
279
309
|
|
280
310
|
class Unquoted(QueryString):
|
281
311
|
"""
|
piccolo/schema.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
piccolo/__init__.py,sha256=
|
1
|
+
piccolo/__init__.py,sha256=Gh6i3k_DUgCHpLwjrSRIPrDHNQum_zcZ2tZi3wiqRkU,22
|
2
2
|
piccolo/custom_types.py,sha256=7HMQAze-5mieNLfbQ5QgbRQgR2abR7ol0qehv2SqROY,604
|
3
3
|
piccolo/main.py,sha256=1VsFV67FWTUikPTysp64Fmgd9QBVa_9wcwKfwj2UCEA,5117
|
4
4
|
piccolo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
piccolo/querystring.py,sha256=
|
6
|
-
piccolo/schema.py,sha256=
|
5
|
+
piccolo/querystring.py,sha256=_3enTH0oBx77LfpS9UG_5OGp5fMxmu50Dod5s1Gn9mY,9655
|
6
|
+
piccolo/schema.py,sha256=S_0dwyOVPx90wWbCOP_Y9YHWtb-2JCuAJWAoLkTbFbU,7743
|
7
7
|
piccolo/table.py,sha256=DJT8jTgirPpzkydjSzaCgcG0DiC75XRtW_xtFqTyg80,49457
|
8
8
|
piccolo/table_reflection.py,sha256=jrN1nHerDJ4tU09GtNN3hz7ap-7rXnSUjljFO6LB2H0,7094
|
9
9
|
piccolo/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -115,7 +115,7 @@ piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py,sha256=JG_LFPrEljnSE
|
|
115
115
|
piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py,sha256=Y_Dj4ROSxjnPsRDqcnpWeyk8UpF8c80T08_O2uq-GoA,1219
|
116
116
|
piccolo/apps/user/piccolo_migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
117
|
piccolo/columns/__init__.py,sha256=OYhO_n9anMiU9nL-K6ATq9FhAtm8RyMpqYQ7fTVbhxI,1120
|
118
|
-
piccolo/columns/base.py,sha256=
|
118
|
+
piccolo/columns/base.py,sha256=sgMiBvq-xLW6_W86g6XZTMc_3cskyeoMF6yIvIlnXsA,32487
|
119
119
|
piccolo/columns/choices.py,sha256=-HNQuk9vMmVZIPZ5PMeXGTfr23o4nzKPSAkvcG1k0y8,723
|
120
120
|
piccolo/columns/column_types.py,sha256=CzbNnP_VWvz6_r4aaRcMHiHZOaWHeq5IGaN8WJ7JGPA,81685
|
121
121
|
piccolo/columns/combination.py,sha256=vMXC2dfY7pvnCFhsT71XFVyb4gdQzfRsCMaiduu04Ss,6900
|
@@ -124,7 +124,7 @@ piccolo/columns/m2m.py,sha256=vRJZqBcBP3TQ9Mmb7UEqTgg0QoxIIjIu6JfGLAi4X8Q,14595
|
|
124
124
|
piccolo/columns/readable.py,sha256=hganxUPfIK5ZXn-qgteBxsOJfBJucgr9U0QLsLFYcuI,1562
|
125
125
|
piccolo/columns/reference.py,sha256=FqE9rpMBMwNNkKXR3Wi4ce-fyT2Vh4KM8YpdC21s6gg,3574
|
126
126
|
piccolo/columns/defaults/__init__.py,sha256=7hpB13baEJgc1zbZjRKDFr-5hltxM2VGj8KnKfOiS8c,145
|
127
|
-
piccolo/columns/defaults/base.py,sha256=
|
127
|
+
piccolo/columns/defaults/base.py,sha256=kZ63QVI5nacQdVj2oZ_0Kr5KKtEZTkotKrFibUS6axk,1860
|
128
128
|
piccolo/columns/defaults/date.py,sha256=7tW_tTfsnzU8LXn9Qkrtk8OPyi80SESa-dY_UMlNTp0,2455
|
129
129
|
piccolo/columns/defaults/interval.py,sha256=QTx-iW0J5Eogv72_xXg8hWHEqbRx7jyTxrrV-eIq9HI,1947
|
130
130
|
piccolo/columns/defaults/time.py,sha256=UEtfdMkn8YdlzyEmqO6DrVnuwZrYUrvG_gTJ-SOMmwk,2355
|
@@ -149,10 +149,12 @@ piccolo/query/__init__.py,sha256=bcsMV4813rMRAIqGv4DxI4eyO4FmpXkDv9dfTk5pt3A,699
|
|
149
149
|
piccolo/query/base.py,sha256=G8Mwz0GcHY4Xs5Co9ubCNMI-3orfOsDdRDOnFRws7TU,15212
|
150
150
|
piccolo/query/mixins.py,sha256=1RyhORDRwTZF9m_2uEgc6sOSd2uViXivBAaFN8geq5g,21982
|
151
151
|
piccolo/query/proxy.py,sha256=Yq4jNc7IWJvdeO3u7_7iPyRy2WhVj8KsIUcIYHBIi9Q,1839
|
152
|
-
piccolo/query/functions/__init__.py,sha256=
|
153
|
-
piccolo/query/functions/aggregate.py,sha256=
|
152
|
+
piccolo/query/functions/__init__.py,sha256=e-BEHlGR3JhE2efWG_rmXdURKL4Fa8tjdGmPsvH4kWo,403
|
153
|
+
piccolo/query/functions/aggregate.py,sha256=OdjDjr_zyD4S9UbrZ2C3V5mz4OT2sIfAFAdTGr4WL54,4248
|
154
154
|
piccolo/query/functions/base.py,sha256=Go2bg2r7GaVoyyX-wTb80WEQmtiU4OFYWQlq9eQ6Zcc,478
|
155
|
+
piccolo/query/functions/math.py,sha256=2Wapq0lpXZh77z0uzXUhnOfmUkbkM0xjQ4tiyuCsbiE,661
|
155
156
|
piccolo/query/functions/string.py,sha256=srxsQJFS6L4gPvFjvuAFQj7QtnCF7X6YoJNKARR2XP0,1236
|
157
|
+
piccolo/query/functions/type_conversion.py,sha256=OYbZc6TEk6b5yTwCMw2rmZ-UiQiUiWZOyxwMLzUjXwE,2583
|
156
158
|
piccolo/query/methods/__init__.py,sha256=tm4gLeV_obDqpgnouVjFbGubbaoJcqm_cbNd4LPo48Q,622
|
157
159
|
piccolo/query/methods/alter.py,sha256=AI9YkJeip2EitrWJN_TDExXhA8HGAG3XuDz1NR-KirQ,16728
|
158
160
|
piccolo/query/methods/count.py,sha256=Vxn_7Ry-rleC6OGRxh-cLbuEMsy1DNjAZJThGED-_do,1748
|
@@ -208,12 +210,12 @@ tests/apps/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
208
210
|
tests/apps/migrations/test_migration.py,sha256=JmPLtf2BCWX3Yofe0GQe40m8I_yWa_-3vk1lDfFDfIo,308
|
209
211
|
tests/apps/migrations/auto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
210
212
|
tests/apps/migrations/auto/test_diffable_table.py,sha256=bok3G9pwEYnE3AL6UG4iEHrVBZJQ_ovYCdKC3we5JVQ,2932
|
211
|
-
tests/apps/migrations/auto/test_migration_manager.py,sha256=
|
213
|
+
tests/apps/migrations/auto/test_migration_manager.py,sha256=NTNx4y5B0bMVLUR9BybX3zS4jxFI3_weLej8zOn3BkI,34798
|
212
214
|
tests/apps/migrations/auto/test_schema_differ.py,sha256=UdsaZisA02j15wr1bXkXD6Cqu3p0A23NwFQLXsJdQL4,19391
|
213
215
|
tests/apps/migrations/auto/test_schema_snapshot.py,sha256=ZyvGZqn3N3cwd-3S-FME5AJ8buDSHesw7yPIvY6mE5k,6196
|
214
216
|
tests/apps/migrations/auto/test_serialisation.py,sha256=EFkhES1w9h51UCamWrhxs3mf4I718ggeP7Yl5J_UID4,13548
|
215
217
|
tests/apps/migrations/auto/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
216
|
-
tests/apps/migrations/auto/integration/test_migrations.py,sha256=
|
218
|
+
tests/apps/migrations/auto/integration/test_migrations.py,sha256=7rmATPGZNuchabUb2y5C9QMmv6XFChn5EHlYoRVChd4,46744
|
217
219
|
tests/apps/migrations/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
218
220
|
tests/apps/migrations/commands/test_base.py,sha256=NgHgVjNd3Hil9eODvW7Ic2D9muTa_grNaH3YpRFfR8I,1829
|
219
221
|
tests/apps/migrations/commands/test_check.py,sha256=hOX_sVk1nfCRfbQ8tJoFEUBFhih9O4QuQLHTp5TQaiY,630
|
@@ -241,7 +243,7 @@ tests/apps/user/commands/test_change_permissions.py,sha256=uVKEiT1EKot3VA2TDETdQ
|
|
241
243
|
tests/apps/user/commands/test_create.py,sha256=iJ3Tti62rHwvdcTwNXrc5JPam6vR1qxKRdMN456vm3o,2250
|
242
244
|
tests/apps/user/commands/test_list.py,sha256=ipPfGdW6fH7q-Jc7JcYUvlioGmH9GQU0WImZGC2m-XQ,2840
|
243
245
|
tests/columns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
244
|
-
tests/columns/test_array.py,sha256=
|
246
|
+
tests/columns/test_array.py,sha256=uElfAcJhuB0m9_O1qTgURbrwE2Php5Bc7IB9hyXoQ_Q,10772
|
245
247
|
tests/columns/test_base.py,sha256=CTqCNcrqAJTjLXe3MCZgTczrmB3jcVRcOpU4FilpLoQ,3918
|
246
248
|
tests/columns/test_bigint.py,sha256=a0B4y1H02ww5qaW574X2lyenbY6o29ztOhiaqybPC0c,1149
|
247
249
|
tests/columns/test_boolean.py,sha256=kDESp6FnRtSZhuqIu0dBRwKMSpS5TFbbs3sz2MyZSs8,1720
|
@@ -252,6 +254,7 @@ tests/columns/test_date.py,sha256=lz3AF64CkQzulfniGs0fxuvbH2grR3pF2sxipXiyvHU,12
|
|
252
254
|
tests/columns/test_db_column_name.py,sha256=v0QFOQp_atqzMB1n40simVwHeBDi5nyN1N2bSPX5k6w,7670
|
253
255
|
tests/columns/test_defaults.py,sha256=rwlU1fXt3cCl7C51eLlZXqgWkE-K5W0pHvTrwkAKyCo,2896
|
254
256
|
tests/columns/test_double_precision.py,sha256=CuobfnQnuwqAIuuOPoh2mKHnY9A7gZosoMIGpY-ubfE,639
|
257
|
+
tests/columns/test_get_sql_value.py,sha256=mKgsInN374jzV99y9mg_ZiG-AvnJgz36SZi89xL7RZM,1768
|
255
258
|
tests/columns/test_interval.py,sha256=SbeRgTBWPBL5_LYQUdaP3qyN6eTNtTJtu8JXWollhQw,2993
|
256
259
|
tests/columns/test_json.py,sha256=ErGytVqMVO86YiqGmQIcqb2zUcAUY_ya-cY9tSKKXhQ,3920
|
257
260
|
tests/columns/test_jsonb.py,sha256=7MeH0h2SJt_uCUL6D5-6DLTBPlaz6qKSJcnyhuwvzHg,6914
|
@@ -295,10 +298,15 @@ tests/query/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
295
298
|
tests/query/test_await.py,sha256=imGazmG0l4qilveNPwsxvYQogFJtos4YB8N9iggPEFU,412
|
296
299
|
tests/query/test_camelcase.py,sha256=AcL2gZera1GfpVJNpuKuh5ZBosNCY_ezPWh6-duU5vU,1765
|
297
300
|
tests/query/test_freeze.py,sha256=p3iXqHzgV39YWlqzXtZvaDa7iKZaaaelOGX3UZ8CMf0,3887
|
298
|
-
tests/query/test_functions.py,sha256=_dYGLqsrYkWMxjb3MIlpsCbY1nC9n39IiRsrGhhrYJs,3182
|
299
301
|
tests/query/test_gather.py,sha256=okWANrBoh0Ut1RomWoffiWNpFqiITF6qti-Aa3uYtRk,730
|
300
|
-
tests/query/test_querystring.py,sha256=
|
302
|
+
tests/query/test_querystring.py,sha256=QrqyjwUlFlf5LrsJ7DgjCruq811I0UvrDFPud6rfZNI,5019
|
301
303
|
tests/query/test_slots.py,sha256=I9ZjAYqAJNSFAWg9UyAqy7bm-Z52KiyQ2C_yHk2qqqI,1010
|
304
|
+
tests/query/functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
305
|
+
tests/query/functions/base.py,sha256=RLCzLT7iN_Z5DtIFZqVESTJGES2JKb8VDU25sv5OtN4,811
|
306
|
+
tests/query/functions/test_functions.py,sha256=510fqRrOrAZ9NyFoZtlF6lIdiiLriWhZ7vvveWZ8rsc,1984
|
307
|
+
tests/query/functions/test_math.py,sha256=Qw2MXqgY_y7vGd0bLtPhWW7HB3tJkot1o-Rh9nCmmBk,1273
|
308
|
+
tests/query/functions/test_string.py,sha256=7yNkpWNBaIowzXTP_qbmQg-mJZLWrTk0lx2mgY1NIfA,825
|
309
|
+
tests/query/functions/test_type_conversion.py,sha256=WeYR9UfJnbidle07-akQ1g9hFCd93qT8xUhDF3c58n4,3235
|
302
310
|
tests/query/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
303
311
|
tests/query/mixins/test_columns_delegate.py,sha256=Zw9uaqOEb7kpPQzzO9yz0jhQEeCfoPSjsy-BCLg_8XU,2032
|
304
312
|
tests/query/mixins/test_order_by_delegate.py,sha256=mOV3Gxs0XeliONxjWSOniI1z6lbZ_xTfcGYd53JLnaY,507
|
@@ -355,9 +363,9 @@ tests/utils/test_sql_values.py,sha256=vzxRmy16FfLZPH-sAQexBvsF9MXB8n4smr14qoEOS5
|
|
355
363
|
tests/utils/test_sync.py,sha256=9ytVo56y2vPQePvTeIi9lHIouEhWJbodl1TmzkGFrSo,799
|
356
364
|
tests/utils/test_table_reflection.py,sha256=SIzuat-IpcVj1GCFyOWKShI8YkhdOPPFH7qVrvfyPNE,3794
|
357
365
|
tests/utils/test_warnings.py,sha256=NvSC_cvJ6uZcwAGf1m-hLzETXCqprXELL8zg3TNLVMw,269
|
358
|
-
piccolo-1.
|
359
|
-
piccolo-1.
|
360
|
-
piccolo-1.
|
361
|
-
piccolo-1.
|
362
|
-
piccolo-1.
|
363
|
-
piccolo-1.
|
366
|
+
piccolo-1.9.0.dist-info/LICENSE,sha256=zFIpi-16uIJ420UMIG75NU0JbDBykvrdnXcj5U_EYBI,1059
|
367
|
+
piccolo-1.9.0.dist-info/METADATA,sha256=DPQmRGRjgG1-6bHmApuUOwew9PIbDzX1KOEbnyxqW20,5177
|
368
|
+
piccolo-1.9.0.dist-info/WHEEL,sha256=00yskusixUoUt5ob_CiUp6LsnN5lqzTJpoqOFg_FVIc,92
|
369
|
+
piccolo-1.9.0.dist-info/entry_points.txt,sha256=SJPHET4Fi1bN5F3WqcKkv9SClK3_F1I7m4eQjk6AFh0,46
|
370
|
+
piccolo-1.9.0.dist-info/top_level.txt,sha256=-SR74VGbk43VoPy1HH-mHm97yoGukLK87HE5kdBW6qM,24
|
371
|
+
piccolo-1.9.0.dist-info/RECORD,,
|
@@ -288,7 +288,12 @@ class TestMigrations(MigrationTestCase):
|
|
288
288
|
[
|
289
289
|
x.data_type == "text",
|
290
290
|
x.is_nullable == "NO",
|
291
|
-
x.column_default
|
291
|
+
x.column_default
|
292
|
+
in (
|
293
|
+
"''",
|
294
|
+
"''::text",
|
295
|
+
"'':::STRING",
|
296
|
+
),
|
292
297
|
]
|
293
298
|
),
|
294
299
|
)
|
@@ -461,6 +466,7 @@ class TestMigrations(MigrationTestCase):
|
|
461
466
|
in (
|
462
467
|
"now()",
|
463
468
|
"CURRENT_TIMESTAMP",
|
469
|
+
"current_timestamp()::TIMESTAMP",
|
464
470
|
"current_timestamp():::TIMESTAMPTZ::TIMESTAMP",
|
465
471
|
),
|
466
472
|
]
|
@@ -541,7 +547,11 @@ class TestMigrations(MigrationTestCase):
|
|
541
547
|
x.data_type == "interval",
|
542
548
|
x.is_nullable == "NO",
|
543
549
|
x.column_default
|
544
|
-
in (
|
550
|
+
in (
|
551
|
+
"'00:00:00'",
|
552
|
+
"'00:00:00'::interval",
|
553
|
+
"'00:00:00':::INTERVAL",
|
554
|
+
),
|
545
555
|
]
|
546
556
|
),
|
547
557
|
)
|
@@ -743,7 +753,12 @@ class TestMigrations(MigrationTestCase):
|
|
743
753
|
[
|
744
754
|
x.data_type == "jsonb",
|
745
755
|
x.is_nullable == "NO",
|
746
|
-
x.column_default
|
756
|
+
x.column_default
|
757
|
+
in (
|
758
|
+
"'{}'",
|
759
|
+
"'{}'::jsonb",
|
760
|
+
"'{}':::JSONB",
|
761
|
+
),
|
747
762
|
]
|
748
763
|
),
|
749
764
|
)
|
@@ -766,7 +781,11 @@ class TestMigrations(MigrationTestCase):
|
|
766
781
|
x.data_type == "character varying",
|
767
782
|
x.is_nullable == "NO",
|
768
783
|
x.column_default
|
769
|
-
in (
|
784
|
+
in (
|
785
|
+
"''",
|
786
|
+
"''::character varying",
|
787
|
+
"'':::STRING",
|
788
|
+
),
|
770
789
|
]
|
771
790
|
),
|
772
791
|
)
|
@@ -788,7 +807,11 @@ class TestMigrations(MigrationTestCase):
|
|
788
807
|
x.data_type == "character varying",
|
789
808
|
x.is_nullable == "NO",
|
790
809
|
x.column_default
|
791
|
-
in (
|
810
|
+
in (
|
811
|
+
"''",
|
812
|
+
"''::character varying",
|
813
|
+
"'':::STRING",
|
814
|
+
),
|
792
815
|
]
|
793
816
|
),
|
794
817
|
)
|