piccolo 1.21.0__py3-none-any.whl → 1.23.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.
Files changed (31) hide show
  1. piccolo/__init__.py +1 -1
  2. piccolo/apps/asgi/commands/new.py +3 -0
  3. piccolo/apps/asgi/commands/templates/app/_falcon_app.py.jinja +60 -0
  4. piccolo/apps/asgi/commands/templates/app/_quart_app.py.jinja +119 -0
  5. piccolo/apps/asgi/commands/templates/app/_sanic_app.py.jinja +121 -0
  6. piccolo/apps/asgi/commands/templates/app/app.py.jinja +6 -0
  7. piccolo/apps/asgi/commands/templates/app/home/_falcon_endpoints.py.jinja +19 -0
  8. piccolo/apps/asgi/commands/templates/app/home/_quart_endpoints.py.jinja +18 -0
  9. piccolo/apps/asgi/commands/templates/app/home/_sanic_endpoints.py.jinja +17 -0
  10. piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +6 -0
  11. piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +15 -0
  12. piccolo/apps/playground/commands/run.py +9 -0
  13. piccolo/columns/column_types.py +78 -39
  14. piccolo/columns/defaults/timestamptz.py +1 -0
  15. piccolo/engine/sqlite.py +14 -2
  16. piccolo/query/base.py +11 -6
  17. piccolo/query/operators/__init__.py +0 -0
  18. piccolo/query/operators/json.py +111 -0
  19. piccolo/querystring.py +14 -2
  20. piccolo/table_reflection.py +17 -5
  21. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/METADATA +34 -22
  22. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/RECORD +31 -20
  23. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/WHEEL +1 -1
  24. tests/columns/test_integer.py +32 -0
  25. tests/columns/test_jsonb.py +100 -43
  26. tests/query/operators/__init__.py +0 -0
  27. tests/query/operators/test_json.py +52 -0
  28. tests/table/test_insert.py +1 -1
  29. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/LICENSE +0 -0
  30. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/entry_points.txt +0 -0
  31. {piccolo-1.21.0.dist-info → piccolo-1.23.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,111 @@
1
+ from __future__ import annotations
2
+
3
+ import typing as t
4
+
5
+ from piccolo.querystring import QueryString
6
+ from piccolo.utils.encoding import dump_json
7
+
8
+ if t.TYPE_CHECKING:
9
+ from piccolo.columns.column_types import JSON
10
+
11
+
12
+ class JSONQueryString(QueryString):
13
+
14
+ def clean_value(self, value: t.Any):
15
+ if not isinstance(value, (str, QueryString)):
16
+ value = dump_json(value)
17
+ return value
18
+
19
+ def __eq__(self, value) -> QueryString: # type: ignore[override]
20
+ value = self.clean_value(value)
21
+ return QueryString("{} = {}", self, value)
22
+
23
+ def __ne__(self, value) -> QueryString: # type: ignore[override]
24
+ value = self.clean_value(value)
25
+ return QueryString("{} != {}", self, value)
26
+
27
+ def eq(self, value) -> QueryString:
28
+ return self.__eq__(value)
29
+
30
+ def ne(self, value) -> QueryString:
31
+ return self.__ne__(value)
32
+
33
+
34
+ class GetChildElement(JSONQueryString):
35
+ """
36
+ Allows you to get a child element from a JSON object.
37
+
38
+ You can access this via the ``arrow`` function on ``JSON`` and ``JSONB``
39
+ columns.
40
+
41
+ """
42
+
43
+ def __init__(
44
+ self,
45
+ identifier: t.Union[JSON, QueryString],
46
+ key: t.Union[str, int, QueryString],
47
+ alias: t.Optional[str] = None,
48
+ ):
49
+ if isinstance(key, int):
50
+ # asyncpg only accepts integer keys if we explicitly mark it as an
51
+ # int.
52
+ key = QueryString("{}::int", key)
53
+
54
+ super().__init__("{} -> {}", identifier, key, alias=alias)
55
+
56
+ def arrow(self, key: t.Union[str, int, QueryString]) -> GetChildElement:
57
+ """
58
+ This allows you to drill multiple levels deep into a JSON object if
59
+ needed.
60
+
61
+ For example::
62
+
63
+ >>> await RecordingStudio.select(
64
+ ... RecordingStudio.name,
65
+ ... RecordingStudio.facilities.arrow(
66
+ ... "instruments"
67
+ ... ).arrow(
68
+ ... "drum_kits"
69
+ ... ).as_alias("drum_kits")
70
+ ... ).output(load_json=True)
71
+ [
72
+ {'name': 'Abbey Road', 'drum_kits': 2},
73
+ {'name': 'Electric Lady', 'drum_kits': 3}
74
+ ]
75
+
76
+ """
77
+ return GetChildElement(identifier=self, key=key, alias=self._alias)
78
+
79
+ def __getitem__(
80
+ self, value: t.Union[str, int, QueryString]
81
+ ) -> GetChildElement:
82
+ return GetChildElement(identifier=self, key=value, alias=self._alias)
83
+
84
+
85
+ class GetElementFromPath(JSONQueryString):
86
+ """
87
+ Allows you to retrieve an element from a JSON object by specifying a path.
88
+ It can be several levels deep.
89
+
90
+ You can access this via the ``from_path`` function on ``JSON`` and
91
+ ``JSONB`` columns.
92
+
93
+ """
94
+
95
+ def __init__(
96
+ self,
97
+ identifier: t.Union[JSON, QueryString],
98
+ path: t.List[t.Union[str, int]],
99
+ alias: t.Optional[str] = None,
100
+ ):
101
+ """
102
+ :param path:
103
+ For example: ``["technician", 0, "name"]``.
104
+
105
+ """
106
+ super().__init__(
107
+ "{} #> {}",
108
+ identifier,
109
+ [str(i) if isinstance(i, int) else i for i in path],
110
+ alias=alias,
111
+ )
piccolo/querystring.py CHANGED
@@ -259,10 +259,22 @@ class QueryString(Selectable):
259
259
  # Basic logic
260
260
 
261
261
  def __eq__(self, value) -> QueryString: # type: ignore[override]
262
- return QueryString("{} = {}", self, value)
262
+ if value is None:
263
+ return QueryString("{} IS NULL", self)
264
+ else:
265
+ return QueryString("{} = {}", self, value)
263
266
 
264
267
  def __ne__(self, value) -> QueryString: # type: ignore[override]
265
- return QueryString("{} != {}", self, value)
268
+ if value is None:
269
+ return QueryString("{} IS NOT NULL", self, value)
270
+ else:
271
+ return QueryString("{} != {}", self, value)
272
+
273
+ def eq(self, value) -> QueryString:
274
+ return self.__eq__(value)
275
+
276
+ def ne(self, value) -> QueryString:
277
+ return self.__ne__(value)
266
278
 
267
279
  def __add__(self, value) -> QueryString:
268
280
  return QueryString("{} + {}", self, value)
@@ -8,6 +8,8 @@ import typing as t
8
8
  from dataclasses import dataclass
9
9
 
10
10
  from piccolo.apps.schema.commands.generate import get_output_schema
11
+ from piccolo.engine import engine_finder
12
+ from piccolo.engine.base import Engine
11
13
  from piccolo.table import Table
12
14
 
13
15
 
@@ -78,9 +80,16 @@ class TableStorage(metaclass=Singleton):
78
80
  works with Postgres.
79
81
  """
80
82
 
81
- def __init__(self):
83
+ def __init__(self, engine: t.Optional[Engine] = None):
84
+ """
85
+ :param engine:
86
+ Which engine to use to make the database queries. If not specified,
87
+ we try importing an engine from ``piccolo_conf.py``.
88
+
89
+ """
90
+ self.engine = engine or engine_finder()
82
91
  self.tables = ImmutableDict()
83
- self._schema_tables = {}
92
+ self._schema_tables: t.Dict[str, t.List[str]] = {}
84
93
 
85
94
  async def reflect(
86
95
  self,
@@ -120,10 +129,13 @@ class TableStorage(metaclass=Singleton):
120
129
  exclude_list = self._to_list(exclude)
121
130
 
122
131
  if keep_existing:
123
- exclude += self._schema_tables.get(schema_name, [])
132
+ exclude_list += self._schema_tables.get(schema_name, [])
124
133
 
125
134
  output_schema = await get_output_schema(
126
- schema_name=schema_name, include=include_list, exclude=exclude_list
135
+ schema_name=schema_name,
136
+ include=include_list,
137
+ exclude=exclude_list,
138
+ engine=self.engine,
127
139
  )
128
140
  add_tables = [
129
141
  self._add_table(schema_name=schema_name, table=table)
@@ -177,7 +189,7 @@ class TableStorage(metaclass=Singleton):
177
189
 
178
190
  def _add_to_schema_tables(self, schema_name: str, table_name: str) -> None:
179
191
  """
180
- We keep record of schemas and their tables for easy use. This method
192
+ We keep a record of schemas and their tables for easy use. This method
181
193
  adds a table to its schema.
182
194
 
183
195
  """
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: piccolo
3
- Version: 1.21.0
3
+ Version: 1.23.0
4
4
  Summary: A fast, user friendly ORM and query builder which supports asyncio.
5
5
  Home-page: https://github.com/piccolo-orm/piccolo
6
6
  Author: Daniel Townsend
@@ -12,41 +12,53 @@ Project-URL: Tracker, https://github.com/piccolo-orm/piccolo/issues
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
21
  Classifier: Framework :: AsyncIO
22
22
  Classifier: Typing :: Typed
23
23
  Classifier: Topic :: Database
24
- Requires-Python: >=3.8.0
24
+ Requires-Python: >=3.9.0
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: black
28
- Requires-Dist: colorama (>=0.4.0)
29
- Requires-Dist: Jinja2 (>=2.11.0)
30
- Requires-Dist: targ (>=0.3.7)
31
- Requires-Dist: inflection (>=0.5.1)
32
- Requires-Dist: typing-extensions (>=4.3.0)
33
- Requires-Dist: pydantic[email] (==2.*)
34
- Provides-Extra: all
35
- Requires-Dist: orjson (>=3.5.1) ; extra == 'all'
36
- Requires-Dist: ipython ; extra == 'all'
37
- Requires-Dist: asyncpg (>=0.21.0) ; extra == 'all'
38
- Requires-Dist: aiosqlite (>=0.16.0) ; extra == 'all'
39
- Requires-Dist: uvloop (>=0.12.0) ; (sys_platform != "win32") and extra == 'all'
28
+ Requires-Dist: colorama>=0.4.0
29
+ Requires-Dist: Jinja2>=2.11.0
30
+ Requires-Dist: targ>=0.3.7
31
+ Requires-Dist: inflection>=0.5.1
32
+ Requires-Dist: typing-extensions>=4.3.0
33
+ Requires-Dist: pydantic[email]==2.*
40
34
  Provides-Extra: orjson
41
- Requires-Dist: orjson (>=3.5.1) ; extra == 'orjson'
35
+ Requires-Dist: orjson>=3.5.1; extra == "orjson"
42
36
  Provides-Extra: playground
43
- Requires-Dist: ipython ; extra == 'playground'
37
+ Requires-Dist: ipython; extra == "playground"
44
38
  Provides-Extra: postgres
45
- Requires-Dist: asyncpg (>=0.21.0) ; extra == 'postgres'
39
+ Requires-Dist: asyncpg>=0.30.0; extra == "postgres"
46
40
  Provides-Extra: sqlite
47
- Requires-Dist: aiosqlite (>=0.16.0) ; extra == 'sqlite'
41
+ Requires-Dist: aiosqlite>=0.16.0; extra == "sqlite"
48
42
  Provides-Extra: uvloop
49
- Requires-Dist: uvloop (>=0.12.0) ; (sys_platform != "win32") and extra == 'uvloop'
43
+ Requires-Dist: uvloop>=0.12.0; sys_platform != "win32" and extra == "uvloop"
44
+ Provides-Extra: all
45
+ Requires-Dist: orjson>=3.5.1; extra == "all"
46
+ Requires-Dist: ipython; extra == "all"
47
+ Requires-Dist: asyncpg>=0.30.0; extra == "all"
48
+ Requires-Dist: aiosqlite>=0.16.0; extra == "all"
49
+ Requires-Dist: uvloop>=0.12.0; sys_platform != "win32" and extra == "all"
50
+ Dynamic: author
51
+ Dynamic: author-email
52
+ Dynamic: classifier
53
+ Dynamic: description
54
+ Dynamic: description-content-type
55
+ Dynamic: home-page
56
+ Dynamic: license
57
+ Dynamic: project-url
58
+ Dynamic: provides-extra
59
+ Dynamic: requires-dist
60
+ Dynamic: requires-python
61
+ Dynamic: summary
50
62
 
51
63
  ![Logo](https://raw.githubusercontent.com/piccolo-orm/piccolo/master/docs/logo_hero.png "Piccolo Logo")
52
64
 
@@ -144,7 +156,7 @@ Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
144
156
  piccolo asgi new
145
157
  ```
146
158
 
147
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/), [Esmerald](https://esmerald.dev/) and [Lilya](https://lilya.dev) are currently supported.
159
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/), [Esmerald](https://esmerald.dev/), [Lilya](https://lilya.dev), [Quart](https://quart.palletsprojects.com/en/latest/), [Falcon](https://falconframework.org/) and [Sanic](https://sanic.dev/en/) are currently supported.
148
160
 
149
161
  ## Are you a Django user?
150
162
 
@@ -1,11 +1,11 @@
1
- piccolo/__init__.py,sha256=lfg4osIcO7gnlgKb0zY1KT8t1Ngd2pATD-6YnBkIDcU,23
1
+ piccolo/__init__.py,sha256=GQnDEg6DEILG11IPb7zmEaAIEhC_p4YXBMT2yPZ7TN4,23
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=yZdURtiVSlxkkEVJoFKAmL2OfNxrUr8xfsfuBBB7IuY,9662
5
+ piccolo/querystring.py,sha256=kb7RYTvQZEyPsC4GH8vR2b_w35wnM-ita242S0_eyvQ,10013
6
6
  piccolo/schema.py,sha256=qNNy4tG_HqnXR9t3hHMgYXtGxHabwQAhUpc6RKLJ_gE,7960
7
7
  piccolo/table.py,sha256=UvEbagMYRkTbyFHTUwUshZlL_dC4UKDP7vUOwF8OXmg,50593
8
- piccolo/table_reflection.py,sha256=jrN1nHerDJ4tU09GtNN3hz7ap-7rXnSUjljFO6LB2H0,7094
8
+ piccolo/table_reflection.py,sha256=02baOSLX6f2LEo0kruFZYF_nPPTbIvaCTH_KPGe0DKw,7540
9
9
  piccolo/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  piccolo/apps/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  piccolo/apps/app/piccolo_app.py,sha256=8z2ITpxQQ-McxSYwQ5H_vyEnRXbY6cyAh2JSqhiylYk,340
@@ -17,15 +17,18 @@ piccolo/apps/app/commands/templates/tables.py.jinja,sha256=revzdrvDDwe78VedBKz0z
17
17
  piccolo/apps/asgi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  piccolo/apps/asgi/piccolo_app.py,sha256=7VUvqQJbB-ScO0A62S6MiJmQL9F5DS-SdlqlDLbAblE,217
19
19
  piccolo/apps/asgi/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- piccolo/apps/asgi/commands/new.py,sha256=xrN9RJ0Lnz54qY_rxqA9Z2SS4kC_0RXdYYW7tXmGgIo,4232
20
+ piccolo/apps/asgi/commands/new.py,sha256=718mXx7XdDTN0CKK0ZB1WVMkOrQtVfqT5bqO1kDKnRk,4335
21
21
  piccolo/apps/asgi/commands/templates/app/README.md.jinja,sha256=As3gNEZt9qcRmTVkjCzNtXJ8r4-3g0fCSe7Q-P39ezI,214
22
22
  piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja,sha256=IKOql1G5wrEKm5qErlizOmrwYKlnxkm-d8NY5uVg9KA,3186
23
23
  piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja,sha256=nTzXc5IJLl_al1FuzG5AnaA1vSn-ipMurpPK7BibmB8,2710
24
+ piccolo/apps/asgi/commands/templates/app/_falcon_app.py.jinja,sha256=LOn3auJFeXNW48rtHzRbH3MzxWbRNhFib6Fm6wDS53E,1684
24
25
  piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja,sha256=mKnYfUOnYyWJA1jFoRLCUOGQlK6imaxx_1qaauGjeeQ,2627
25
26
  piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja,sha256=PUph5Jj_AXVpxXZmpUzzHXogUchU8vjKBL_7WvgrfCU,1260
26
27
  piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja,sha256=VCY4FoA7YlEhtjWB09XWQqi8GgL36VQwGGBpSXUDO5o,3349
28
+ piccolo/apps/asgi/commands/templates/app/_quart_app.py.jinja,sha256=3LoQJ6LWRB0NFIcfQtPUdNWb10csyDGgCIa2zx8w4e8,2837
29
+ piccolo/apps/asgi/commands/templates/app/_sanic_app.py.jinja,sha256=qza84-aV6wnPlPQ9bpcD5DLO-pvkmoSnb_lXmcymv6c,3159
27
30
  piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja,sha256=vHcAzsS9I3OevYoznwZp8zucI4OEyUjj-EOAtscmlSE,1443
28
- piccolo/apps/asgi/commands/templates/app/app.py.jinja,sha256=gROY-LbHl8NtHDM_ntkI7Rjcbtg2ypDZ1FunBvpdjE4,458
31
+ piccolo/apps/asgi/commands/templates/app/app.py.jinja,sha256=n2KriWxCnq65vdEvX1USTqZPDbNkYXQqTJT5EmespT8,667
29
32
  piccolo/apps/asgi/commands/templates/app/conftest.py.jinja,sha256=ZG1pRVMv3LhIfOsO3_08c_fF3EV4_EApuDHiIFFPJdk,497
30
33
  piccolo/apps/asgi/commands/templates/app/main.py.jinja,sha256=QxMpsevsxGQdL_xwfvcNalGLXGswgqiVvApitkP1TuQ,533
31
34
  piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja,sha256=f9Nb08_yipi0_mDUYrUvVoGCz7MRRS5QjCdUGBHN760,379
@@ -34,15 +37,18 @@ piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja,sha256=w4FXnehMN
34
37
  piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
38
  piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja,sha256=Rri_xzDkl87G5ME74qTxY25cwKIKufuzgkRsy__mNts,510
36
39
  piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja,sha256=D_Slfc3IfTyBgq_VUIG5_AW5pVvvSqn-YGQspxMJNsE,499
40
+ piccolo/apps/asgi/commands/templates/app/home/_falcon_endpoints.py.jinja,sha256=Fv3MQnCF7oK752yjpJp35ONpj6wlu2Kld1kxYphdcOs,479
37
41
  piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja,sha256=nKSJ9VPTUTaLD9oDqAUseNuQkcPLBxShPAEfZK15rSE,490
38
42
  piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja,sha256=zXbYXDXFeeOCXmWBa_QK0kWGlBnv6T_A2jOHuvp9oCs,553
43
+ piccolo/apps/asgi/commands/templates/app/home/_quart_endpoints.py.jinja,sha256=V92EMVnQusgov_i2KC4wa4GiSIDxBLezgKUrT2YPiuc,365
44
+ piccolo/apps/asgi/commands/templates/app/home/_sanic_endpoints.py.jinja,sha256=8Bcq1uVxme8hfDlnenyBS19d0EzwBK2BZ64C91k_F50,368
39
45
  piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja,sha256=KEjNEUKiZNBIWYAt9EgPHe4yCbkKLtlhaCBce9YI-RQ,498
40
- piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja,sha256=Vc7pllhzKeNyj1XPzqdRH1AUpv7D4pooBIrUMt6gK7I,428
46
+ piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja,sha256=9S8oXL2I67BLhFehvYU6Ce5pbCeqhwVHhT0SQW5ZMOw,655
41
47
  piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja,sha256=4gETiW9ukTNsomeJOvrRkqPbToZ_FU0b3LsNIaEYyP8,505
42
48
  piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja,sha256=wk34RAsuoFn5iJ4OHlQzUqgatq6QB2G9tFE0BYkaers,197
43
49
  piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md,sha256=ji6UOtHvzHX-eS_qhhKTN36ZXNZ7QwtjwjdE4Qgm35A,59
44
50
  piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw,sha256=3RqiNuyAap_P-xNK3uhNaQQ6rC365VzPmRqmmXSLO8o,451
45
- piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw,sha256=QJI0MY0hydMdqPg9YcW7XmmccJ1PyHvOSRIvMJX3ij0,2637
51
+ piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw,sha256=dD6OAlzfJV_fZktv5b9ek3lJcqDMxTdAkRJzmRDIH0g,3166
46
52
  piccolo/apps/asgi/commands/templates/app/static/favicon.ico,sha256=IvcgeJHObd9kj2mNIXkJdXYxMU8OaOymyYQWnWfbtHo,7406
47
53
  piccolo/apps/asgi/commands/templates/app/static/main.css,sha256=vudarPLglQ6NOgJiNeU2x0yQl0DiWScqb09QZv2wAzM,1056
48
54
  piccolo/apps/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -77,7 +83,7 @@ piccolo/apps/migrations/commands/templates/migration.py.jinja,sha256=wMC8RTIcQj3
77
83
  piccolo/apps/playground/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
84
  piccolo/apps/playground/piccolo_app.py,sha256=zs6nGxt-lgUF8nEwI0uDTNZDKQqjZaNDH8le5RqrMNE,222
79
85
  piccolo/apps/playground/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
- piccolo/apps/playground/commands/run.py,sha256=S8osLV4s_mWdvvVYGn-49wel-d1SFRB17fO3ZtMcv8Y,8629
86
+ piccolo/apps/playground/commands/run.py,sha256=lpCbVmXabWBlsgwE-8cK4woIK_78E3nq9CTfA5hEJFI,9014
81
87
  piccolo/apps/project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
88
  piccolo/apps/project/piccolo_app.py,sha256=mT3O0m3QcCfS0oOr3jt0QZ9TX6gUavGPjJeNn2C_fdM,220
83
89
  piccolo/apps/project/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -117,7 +123,7 @@ piccolo/apps/user/piccolo_migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
117
123
  piccolo/columns/__init__.py,sha256=OYhO_n9anMiU9nL-K6ATq9FhAtm8RyMpqYQ7fTVbhxI,1120
118
124
  piccolo/columns/base.py,sha256=_bg9yMWjMwE76Z7RDqi9iYSmtRuFx5bkx9uYJsFHKjQ,32487
119
125
  piccolo/columns/choices.py,sha256=-HNQuk9vMmVZIPZ5PMeXGTfr23o4nzKPSAkvcG1k0y8,723
120
- piccolo/columns/column_types.py,sha256=X_ZsA0C4WBNVonV2OsizRdt1osMshgtQ3Ob6JN-amfg,83485
126
+ piccolo/columns/column_types.py,sha256=XVI6qA_qsP1BD6bqVqQdj7a8dldoYz4VgOPI-wW696I,84747
121
127
  piccolo/columns/combination.py,sha256=vMXC2dfY7pvnCFhsT71XFVyb4gdQzfRsCMaiduu04Ss,6900
122
128
  piccolo/columns/indexes.py,sha256=NfNok3v_791jgDlN28KmhP9ZCjl6031BXmjxV3ovXJk,372
123
129
  piccolo/columns/m2m.py,sha256=QMeSOnm4DT2cG9U5jC6sOZ6z9DxCWwDyZMSqk0wR2q4,14682
@@ -129,7 +135,7 @@ piccolo/columns/defaults/date.py,sha256=Duuyi-QJ9Rr72aJkCNnjyO1CJBE-inZNGKnyV8tb
129
135
  piccolo/columns/defaults/interval.py,sha256=ypaQpgDm1AL0WTMFEgKCt0I-e9ADUYdRRSBl65IJdiw,1987
130
136
  piccolo/columns/defaults/time.py,sha256=2e0SDjl9_Mrw2YUeLFXDDYhmlC9Qjek3MkhvmWKQFH0,2417
131
137
  piccolo/columns/defaults/timestamp.py,sha256=3Ng_LJ76nic-3j_AIzZfUvj3djIFRVkps98w1b_2lUM,3565
132
- piccolo/columns/defaults/timestamptz.py,sha256=zN945oderS5HU22LMFLcT0iHlYt2wur99w-6lkbmWAI,2057
138
+ piccolo/columns/defaults/timestamptz.py,sha256=RMw9wW20NbvaG_HY-0amBRuD-OLde4at_xQCf0D8NE4,2096
133
139
  piccolo/columns/defaults/uuid.py,sha256=zBBaXlUsDTKcxRFDWwqgpiDRrYd7ptxC_hf7UqYhRjY,470
134
140
  piccolo/columns/operators/__init__.py,sha256=fIIm309C7ddqrP-M9oLlfhcZEM4Fx5B203QMzBm0OpM,310
135
141
  piccolo/columns/operators/base.py,sha256=UfaqPd-ieqydrjhvcGYiwHMOKs199tTiT1gFE15DZzo,34
@@ -144,9 +150,9 @@ piccolo/engine/cockroach.py,sha256=gGnihplotMZMWqHwRnZYnnbKU3jFrwttwOlNtktoeLE,1
144
150
  piccolo/engine/exceptions.py,sha256=X8xZiTF-L9PIqFT-KDXnv1jFIIOZMF8fYK692chttJE,44
145
151
  piccolo/engine/finder.py,sha256=GjzBNtzRzH79fjtRn7OI3nZiOXE8JfoQWAvHVPrPNx4,507
146
152
  piccolo/engine/postgres.py,sha256=DekL3KafCdzSAEQ6_EgOiUB1ERXh2xpePYwI9QvmN-c,18955
147
- piccolo/engine/sqlite.py,sha256=KwJc3UttBP_8qSREbLJshqEfROF17ENf0Ju9BwI5_so,25236
153
+ piccolo/engine/sqlite.py,sha256=Oe0GBrIUSUkutvk5LoXGWC6HFQzKeusfql5-NMssH_s,25735
148
154
  piccolo/query/__init__.py,sha256=bcsMV4813rMRAIqGv4DxI4eyO4FmpXkDv9dfTk5pt3A,699
149
- piccolo/query/base.py,sha256=iI9Fv3oOw7T4ZWZvRKRwdtClvQtSaAepslH24vwxZVA,14616
155
+ piccolo/query/base.py,sha256=sO5VyicbWjgYaQukr6jqUqUUrOctL6QJ1MjcsgDKHXM,14912
150
156
  piccolo/query/mixins.py,sha256=X9HEYnj6uOjgTkGr4vgqTwN_dokJPzVagwbFx385atQ,24468
151
157
  piccolo/query/proxy.py,sha256=Yq4jNc7IWJvdeO3u7_7iPyRy2WhVj8KsIUcIYHBIi9Q,1839
152
158
  piccolo/query/functions/__init__.py,sha256=pZkzOIh7Sg9HPNOeegOwAS46Oxt31ATlSVmwn-lxCbc,605
@@ -172,6 +178,8 @@ piccolo/query/methods/refresh.py,sha256=wg1zghKfwz-VmqK4uWa4GNMiDtK-skTqow591Hb3
172
178
  piccolo/query/methods/select.py,sha256=41OW-DIE_wr5VdxSusMKNT2aUhzQsCwK2Qh1XqgXHg0,22424
173
179
  piccolo/query/methods/table_exists.py,sha256=0yb3n6Jd2ovSBWlZ-gl00K4E7Jnbj7J8qAAX5d7hvNk,1259
174
180
  piccolo/query/methods/update.py,sha256=LfWqIXEl1aecc0rkVssTFmwyD6wXGhlKcTrUVhtlEsw,3705
181
+ piccolo/query/operators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
+ piccolo/query/operators/json.py,sha256=hdo1M6N9qTHJTJ0sRV9Bwt_iQZTgs4VdCKOPH1sXe-k,3168
175
183
  piccolo/testing/__init__.py,sha256=pRFSqRInfx95AakOq54atmvqoB-ue073q2aR8u8zR40,83
176
184
  piccolo/testing/model_builder.py,sha256=lVEiEe71xrH8SSjzFc2l0s-VaCXHeg9Bo5oAYOEbLrI,6545
177
185
  piccolo/testing/random_builder.py,sha256=0LkGpanQ7P1R82gLIMQyK9cm1LdZkPvxbShTEf3jeH4,2128
@@ -257,9 +265,10 @@ tests/columns/test_db_column_name.py,sha256=0wz6y4GNGy4nhMdHmYzEnChQGpK2UhWFFKrn
257
265
  tests/columns/test_defaults.py,sha256=rwlU1fXt3cCl7C51eLlZXqgWkE-K5W0pHvTrwkAKyCo,2896
258
266
  tests/columns/test_double_precision.py,sha256=7rhcSfDkb2fBh_zEG4UGwD_GW1sy6U9-8NooHuCS09Q,544
259
267
  tests/columns/test_get_sql_value.py,sha256=mKgsInN374jzV99y9mg_ZiG-AvnJgz36SZi89xL7RZM,1768
268
+ tests/columns/test_integer.py,sha256=IcIQq0gF29gTxLY3CJuXtE13-20emqisY2wRQsu80F4,772
260
269
  tests/columns/test_interval.py,sha256=2M18pfoGxLLosEvwTmuC4zQkM6jWwU0Nv2fqViW3xOs,2780
261
270
  tests/columns/test_json.py,sha256=_cziJvw2uT8e_4u9lKhmU56lgQeE7bEqCXYf6AzfChA,3482
262
- tests/columns/test_jsonb.py,sha256=eJQoxpyuQ4yrX-GMJhRkZntyd4tX6M6RhAxYn2-ISII,6727
271
+ tests/columns/test_jsonb.py,sha256=KXPgJTchobzHNss86Gb0CeTDlaa5S3pQ8cM3D06-7J8,8592
263
272
  tests/columns/test_numeric.py,sha256=AkTvdvjSsfRsMM79tx4AskUpsTizGBLMY_tC2OII9U4,751
264
273
  tests/columns/test_primary_key.py,sha256=foNG9eTQUJ5yiEVQ7faIEMycW_VuZ7vgzknYXaZ-QXM,4886
265
274
  tests/columns/test_readable.py,sha256=xKVfJuxZcfyncNVKXNryl2WFREX655jwD9DxiLArQiU,758
@@ -313,6 +322,8 @@ tests/query/functions/test_type_conversion.py,sha256=WeYR9UfJnbidle07-akQ1g9hFCd
313
322
  tests/query/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
314
323
  tests/query/mixins/test_columns_delegate.py,sha256=Zw9uaqOEb7kpPQzzO9yz0jhQEeCfoPSjsy-BCLg_8XU,2032
315
324
  tests/query/mixins/test_order_by_delegate.py,sha256=mOV3Gxs0XeliONxjWSOniI1z6lbZ_xTfcGYd53JLnaY,507
325
+ tests/query/operators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
326
+ tests/query/operators/test_json.py,sha256=SEYEdbyF0wB3nvONqyBGFlLe8OhgtSIvxx19P2uJ8Bw,1269
316
327
  tests/table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
328
  tests/table/test_all_columns.py,sha256=wZ7i9mTT9wKWLE2BoQ9jDbPaqnBHfV-ZlsROp7SZq7k,667
318
329
  tests/table/test_alter.py,sha256=pMD38BIFfta1vxFqp8YoaRfMxdwxhQSwcxYO4erpUi8,12394
@@ -329,7 +340,7 @@ tests/table/test_exists.py,sha256=AHvhodkRof7PVd4IDdGQ2nyOj_1Cag1Rpg1H84s4jU0,28
329
340
  tests/table/test_from_dict.py,sha256=I4PMxuzgkgi3-adaw9Gr3u5tQHexc31Vrq7RSPcPcJs,840
330
341
  tests/table/test_indexes.py,sha256=VfM2FqFO8OOaL88QYQRqPX_PPniSBoPFeLPjXZ8jHBk,2073
331
342
  tests/table/test_inheritance.py,sha256=AAkhEhhixVGweGe7ckzj-yypW-cj6D88Cca4-pjkwKw,3110
332
- tests/table/test_insert.py,sha256=-xaoL6wTNB6UImiCk9NQKQ-B21l96H-9tN2_iEgXu5A,13695
343
+ tests/table/test_insert.py,sha256=c7hJ1SsTiW43l_Z5KHSN3894ICzttOAsTfWN9rUOl0k,13696
333
344
  tests/table/test_join.py,sha256=Ukgvjc8NweBGHM7fVFytGQYG9P9thRaMeEvWXYs2Qes,15910
334
345
  tests/table/test_join_on.py,sha256=cdAV39JwHi0kIas2p9cw7mcsUv6mKLZD--_SUA0zLfI,2771
335
346
  tests/table/test_metaclass.py,sha256=pMv0PHh-2a9p74bweQXCXnq1OFsJ7Gk0uWRFdCTMf58,4123
@@ -368,9 +379,9 @@ tests/utils/test_sql_values.py,sha256=vzxRmy16FfLZPH-sAQexBvsF9MXB8n4smr14qoEOS5
368
379
  tests/utils/test_sync.py,sha256=9ytVo56y2vPQePvTeIi9lHIouEhWJbodl1TmzkGFrSo,799
369
380
  tests/utils/test_table_reflection.py,sha256=SIzuat-IpcVj1GCFyOWKShI8YkhdOPPFH7qVrvfyPNE,3794
370
381
  tests/utils/test_warnings.py,sha256=NvSC_cvJ6uZcwAGf1m-hLzETXCqprXELL8zg3TNLVMw,269
371
- piccolo-1.21.0.dist-info/LICENSE,sha256=zFIpi-16uIJ420UMIG75NU0JbDBykvrdnXcj5U_EYBI,1059
372
- piccolo-1.21.0.dist-info/METADATA,sha256=CMfZm7IYerdMTQLFwzuyCPWZMlrGf1G_shqoq2LlnGM,5178
373
- piccolo-1.21.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
374
- piccolo-1.21.0.dist-info/entry_points.txt,sha256=SJPHET4Fi1bN5F3WqcKkv9SClK3_F1I7m4eQjk6AFh0,46
375
- piccolo-1.21.0.dist-info/top_level.txt,sha256=-SR74VGbk43VoPy1HH-mHm97yoGukLK87HE5kdBW6qM,24
376
- piccolo-1.21.0.dist-info/RECORD,,
382
+ piccolo-1.23.0.dist-info/LICENSE,sha256=zFIpi-16uIJ420UMIG75NU0JbDBykvrdnXcj5U_EYBI,1059
383
+ piccolo-1.23.0.dist-info/METADATA,sha256=2b_3SG-OwxwIkYypspgkWfZma9DYegZSfEX7OjdVXQw,5509
384
+ piccolo-1.23.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
385
+ piccolo-1.23.0.dist-info/entry_points.txt,sha256=SJPHET4Fi1bN5F3WqcKkv9SClK3_F1I7m4eQjk6AFh0,46
386
+ piccolo-1.23.0.dist-info/top_level.txt,sha256=-SR74VGbk43VoPy1HH-mHm97yoGukLK87HE5kdBW6qM,24
387
+ piccolo-1.23.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,32 @@
1
+ from piccolo.columns.column_types import Integer
2
+ from piccolo.table import Table
3
+ from piccolo.testing.test_case import AsyncTableTest
4
+ from tests.base import sqlite_only
5
+
6
+
7
+ class MyTable(Table):
8
+ integer = Integer()
9
+
10
+
11
+ @sqlite_only
12
+ class TestInteger(AsyncTableTest):
13
+ tables = [MyTable]
14
+
15
+ async def test_large_integer(self):
16
+ """
17
+ Make sure large integers can be inserted and retrieved correctly.
18
+
19
+ There was a bug with this in SQLite:
20
+
21
+ https://github.com/piccolo-orm/piccolo/issues/1127
22
+
23
+ """
24
+ integer = 625757527765811240
25
+
26
+ row = MyTable(integer=integer)
27
+ await row.save()
28
+
29
+ _row = MyTable.objects().first().run_sync()
30
+ assert _row is not None
31
+
32
+ self.assertEqual(_row.integer, integer)