sqlakit 0.22.6__tar.gz → 0.22.7__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.
Files changed (34) hide show
  1. {sqlakit-0.22.6 → sqlakit-0.22.7}/PKG-INFO +1 -1
  2. {sqlakit-0.22.6 → sqlakit-0.22.7}/pyproject.toml +1 -1
  3. {sqlakit-0.22.6 → sqlakit-0.22.7}/pyproject.toml.orig +1 -1
  4. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_sql.py +10 -6
  5. {sqlakit-0.22.6 → sqlakit-0.22.7}/LICENSE +0 -0
  6. {sqlakit-0.22.6 → sqlakit-0.22.7}/README.md +0 -0
  7. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/__init__.py +0 -0
  8. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_base.py +0 -0
  9. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_cli.py +0 -0
  10. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_db.py +0 -0
  11. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_discovery.py +0 -0
  12. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_linters.py +0 -0
  13. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_model.py +0 -0
  14. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_project.py +0 -0
  15. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_pycharm.py +0 -0
  16. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_query.py +0 -0
  17. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_recording.py +0 -0
  18. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_registry.py +0 -0
  19. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_render.py +0 -0
  20. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_routing.py +0 -0
  21. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_sql_formatter.py +0 -0
  22. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/_static.py +0 -0
  23. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/asyncio/__init__.py +0 -0
  24. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/asyncio/_db.py +0 -0
  25. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/asyncio/_registry.py +0 -0
  26. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/asyncio/orm.py +0 -0
  27. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/asyncio/sql.py +0 -0
  28. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/exceptions.py +0 -0
  29. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/orm.py +0 -0
  30. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/py.typed +0 -0
  31. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/pytest_plugin.py +0 -0
  32. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/sql.py +0 -0
  33. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/testing.py +0 -0
  34. {sqlakit-0.22.6 → sqlakit-0.22.7}/sqlakit/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlakit
3
- Version: 0.22.6
3
+ Version: 0.22.7
4
4
  Summary: A toolkit for SQLAlchemy applications.
5
5
  Keywords: sqlalchemy,database,orm,sql,asyncio
6
6
  Author: Anton Ruhlov
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlakit"
3
- version = "0.22.6"
3
+ version = "0.22.7"
4
4
  description = "A toolkit for SQLAlchemy applications."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlakit"
3
- version = "0.22.6"
3
+ version = "0.22.7"
4
4
  description = "A toolkit for SQLAlchemy applications."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -328,12 +328,15 @@ class Context:
328
328
  self.values: dict[str, Any] = dict(values)
329
329
  self._bound = 0
330
330
 
331
- no_order = "(SELECT NULL)"
332
- """An `ORDER BY` term that orders by nothing, for a macro with nothing to sort by.
331
+ @property
332
+ def no_order(self) -> str:
333
+ """An `ORDER BY` term that orders by nothing, for a macro with nothing to sort by.
333
334
 
334
- Every database takes it after `ORDER BY`, and a direction after it: `NULL`
335
- and `NULL DESC` are refused by PostgreSQL, and `0` is a column's position.
336
- """
335
+ PostgreSQL and SQL Server refuse a bare `NULL` there, and take
336
+ `(SELECT NULL)`. Snowflake refuses a subquery there, and takes `NULL`,
337
+ as MySQL, SQLite and Oracle do. `0` would be a column's position.
338
+ """
339
+ return "(SELECT NULL)" if self.dialect in ("postgresql", "mssql") else "NULL"
337
340
 
338
341
  def __repr__(self) -> str:
339
342
  return f"{type(self).__name__}({self.dialect!r})"
@@ -2074,7 +2077,8 @@ def order_by(ctx: Context, sort: Param, column: Sql, *columns: Sql) -> str:
2074
2077
  the nulls of every term whose sort string does not say, and MySQL, which
2075
2078
  has no `NULLS LAST`, sorts by `IS NULL` first. Any other string is the sort
2076
2079
  when the call passes none, `'name.asc'` above. With neither, the rows come
2077
- in no order: `(SELECT NULL)`, since PostgreSQL refuses a bare `NULL`.
2080
+ in no order: `NULL`, or `(SELECT NULL)` on PostgreSQL and SQL Server, which
2081
+ refuse a bare `NULL`.
2078
2082
  """
2079
2083
  written = [one.strip() for one in (column, *columns)]
2080
2084
  options = [one.strip("'") for one in written if one.startswith("'")]
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