ormlambda 4.0.5__tar.gz → 4.4.4__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.
- {ormlambda-4.0.5 → ormlambda-4.4.4}/PKG-INFO +2 -3
- {ormlambda-4.0.5 → ormlambda-4.4.4}/pyproject.toml +20 -4
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/__init__.py +14 -6
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/__init__.py +1 -0
- ormlambda-4.4.4/src/ormlambda/common/constants.py +1 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/enums/__init__.py +2 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/enums/condition_types.py +4 -1
- ormlambda-4.4.4/src/ormlambda/common/enums/union_type.py +9 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/errors/__init__.py +51 -9
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/global_checker.py +1 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/interfaces/__init__.py +0 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/base.py +311 -42
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/caster.py +3 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/__init__.py +1 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/iterable.py +5 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/json.py +1 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/clauses/ST_AsText.py +2 -2
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/clauses/ST_Contains.py +2 -2
- ormlambda-4.4.4/src/ormlambda/dialects/mysql/repository/__init__.py +1 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/response.py +14 -3
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clause_info/__init__.py +0 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clause_info/clause_info.py +45 -12
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clause_info/interface/__init__.py +0 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/__init__.py +0 -1
- ormlambda-4.4.4/src/ormlambda/sql/clauses/alias.py +52 -0
- ormlambda-4.4.4/src/ormlambda/sql/clauses/delete.py +25 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/group_by.py +2 -2
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/having.py +2 -2
- ormlambda-4.4.4/src/ormlambda/sql/clauses/insert.py +25 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/joins.py +1 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/order.py +2 -2
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/select.py +7 -5
- ormlambda-4.4.4/src/ormlambda/sql/clauses/update.py +26 -0
- ormlambda-4.4.4/src/ormlambda/sql/clauses/upsert.py +23 -0
- ormlambda-4.4.4/src/ormlambda/sql/clauses/where.py +41 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/column/column.py +38 -50
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/column/column_proxy.py +32 -0
- {ormlambda-4.0.5/src/ormlambda/types → ormlambda-4.4.4/src/ormlambda/sql/column}/metadata.py +10 -7
- ormlambda-4.4.4/src/ormlambda/sql/comparer.py +192 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/__init__.py +87 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate/avg.py +15 -0
- {ormlambda-4.0.5/src/ormlambda/sql/functions → ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate}/concat.py +2 -2
- {ormlambda-4.0.5/src/ormlambda/sql/clauses → ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate}/count.py +2 -2
- ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate/max.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate/min.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate/sum.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/base.py +26 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/datetime/__init__.py +0 -0
- ormlambda-4.0.5/src/ormlambda/sql/clause_info/interface/IAggregate.py → ormlambda-4.4.4/src/ormlambda/sql/functions/interface/__init__.py +6 -4
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/__init__.py +0 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/abs.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/ceil.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/floor.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/mod.py +16 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/pow.py +16 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/rand.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/round.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/sqrt.py +15 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/mathematical/truncate.py +17 -0
- ormlambda-4.4.4/src/ormlambda/sql/functions/string/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/sqltypes.py +17 -2
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/table/fields.py +4 -6
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/table/table.py +34 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/type_api.py +8 -4
- ormlambda-4.4.4/src/ormlambda/sql/types.py +44 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/base_statement.py +8 -5
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/interfaces/IStatements.py +33 -17
- ormlambda-4.4.4/src/ormlambda/statements/query_builder.py +263 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/statements.py +57 -46
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/types.py +1 -1
- ormlambda-4.4.4/src/ormlambda/util/__init__.py +50 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/langhelpers.py +1 -1
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/preloaded.py +4 -1
- ormlambda-4.0.5/src/ormlambda/common/abstract_classes/__init__.py +0 -1
- ormlambda-4.0.5/src/ormlambda/common/abstract_classes/non_query_base.py +0 -37
- ormlambda-4.0.5/src/ormlambda/common/interfaces/INonQueryCommand.py +0 -9
- ormlambda-4.0.5/src/ormlambda/dialects/mysql/repository/__init__.py +0 -1
- ormlambda-4.0.5/src/ormlambda/errors.py +0 -26
- ormlambda-4.0.5/src/ormlambda/sql/clauses/alias.py +0 -14
- ormlambda-4.0.5/src/ormlambda/sql/clauses/delete.py +0 -71
- ormlambda-4.0.5/src/ormlambda/sql/clauses/insert.py +0 -104
- ormlambda-4.0.5/src/ormlambda/sql/clauses/interfaces/IDelete.py +0 -6
- ormlambda-4.0.5/src/ormlambda/sql/clauses/interfaces/IInsert.py +0 -6
- ormlambda-4.0.5/src/ormlambda/sql/clauses/interfaces/IUpdate.py +0 -7
- ormlambda-4.0.5/src/ormlambda/sql/clauses/interfaces/IUpsert.py +0 -6
- ormlambda-4.0.5/src/ormlambda/sql/clauses/interfaces/__init__.py +0 -4
- ormlambda-4.0.5/src/ormlambda/sql/clauses/update.py +0 -87
- ormlambda-4.0.5/src/ormlambda/sql/clauses/upsert.py +0 -77
- ormlambda-4.0.5/src/ormlambda/sql/clauses/where.py +0 -46
- ormlambda-4.0.5/src/ormlambda/sql/comparer.py +0 -136
- ormlambda-4.0.5/src/ormlambda/sql/functions/__init__.py +0 -4
- ormlambda-4.0.5/src/ormlambda/sql/functions/max.py +0 -24
- ormlambda-4.0.5/src/ormlambda/sql/functions/min.py +0 -24
- ormlambda-4.0.5/src/ormlambda/sql/functions/sum.py +0 -25
- ormlambda-4.0.5/src/ormlambda/sql/types.py +0 -30
- ormlambda-4.0.5/src/ormlambda/statements/query_builder.py +0 -331
- ormlambda-4.0.5/src/ormlambda/types/__init__.py +0 -24
- ormlambda-4.0.5/src/ormlambda/util/__init__.py +0 -9
- {ormlambda-4.0.5 → ormlambda-4.4.4}/AUTHORS +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/LICENSE +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/README.md +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/caster/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/caster/base_caster.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/caster/caster.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/caster/interfaces/ICaster.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/caster/interfaces/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/enums/join_type.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/enums/order_type.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/interfaces/IJoinSelector.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/common/interfaces/IQueryCommand.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/default/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/default/base.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/boolean.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/bytes.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/date.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/datetime.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/decimal.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/float.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/int.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/none.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/point.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/caster/types/string.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/clauses/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/mysqlconnector.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/repository/pool_types.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/repository/repository.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/mysql/types.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/sqlite/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/sqlite/base.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/dialects/sqlite/pysqlite.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/engine/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/engine/base.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/engine/create.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/engine/url.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/engine/utils.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/env.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/model/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/model/base_model.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/base_repository.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/interfaces/IDatabaseConnection.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/interfaces/IRepositoryBase.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/repository/interfaces/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clause_info/interface/IClauseInfo.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/join/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/join/join_context.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/limit.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/clauses/offset.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/column/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/column_table_proxy.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/compiler.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/context/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/ddl.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/elements.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/foreign_key.py +0 -0
- {ormlambda-4.0.5/src/ormlambda/sql/interfaces → ormlambda-4.4.4/src/ormlambda/sql/functions/aggregate}/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/table/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/table/table_constructor.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/table/table_proxy.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/sql/visitors.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/statements/interfaces/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/module_tree/__init__.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/module_tree/dfs_traversal.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/module_tree/dynamic_module.py +0 -0
- {ormlambda-4.0.5 → ormlambda-4.4.4}/src/ormlambda/util/typing.py +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: ormlambda
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.4.4
|
|
4
4
|
Summary: ORM designed to interact with the database (currently with MySQL) using lambda functions and nested functions
|
|
5
5
|
Author: p-hzamora
|
|
6
6
|
Author-email: p.hzamora@icloud.com
|
|
7
7
|
Requires-Python: >=3.12,<4.0
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
11
10
|
Requires-Dist: mysql-connector-python (>=9.0.0,<10.0.0)
|
|
12
11
|
Requires-Dist: shapely (>=2.0.6,<3.0.0)
|
|
13
12
|
Description-Content-Type: text/markdown
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
[tool.ruff]
|
|
2
|
-
line-length = 320
|
|
3
|
-
|
|
4
1
|
[tool.poetry]
|
|
5
2
|
name = "ormlambda"
|
|
6
|
-
version = "4.
|
|
3
|
+
version = "4.4.4"
|
|
7
4
|
description = "ORM designed to interact with the database (currently with MySQL) using lambda functions and nested functions"
|
|
8
5
|
authors = ["p-hzamora <p.hzamora@icloud.com>"]
|
|
9
6
|
readme = "README.md"
|
|
@@ -21,8 +18,27 @@ ruff = "^0.4.5"
|
|
|
21
18
|
parameterized = "^0.9.0"
|
|
22
19
|
pydantic = "^2.11.1"
|
|
23
20
|
sqlserver = "^0.0.17.1"
|
|
21
|
+
pytest = "^8.4.2"
|
|
22
|
+
|
|
23
|
+
[tool.ruff]
|
|
24
|
+
line-length = 320
|
|
24
25
|
|
|
26
|
+
[tool.pytest.ini_options]
|
|
27
|
+
testpaths = ["src/test"]
|
|
28
|
+
python_files = ["test_*.py"]
|
|
29
|
+
python_classes = ["Test*"]
|
|
30
|
+
python_functions = ["test_*"]
|
|
31
|
+
addopts = [
|
|
32
|
+
"-v", # verbose output
|
|
33
|
+
"--strict-markers", # error on unknown markers
|
|
34
|
+
"--tb=short", # shorter traceback format
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
markers = [
|
|
38
|
+
"slow: Slow test (deselect with '-m \"not slow\"')",
|
|
39
|
+
]
|
|
25
40
|
|
|
26
41
|
[build-system]
|
|
27
42
|
requires = ["poetry-core"]
|
|
28
43
|
build-backend = "poetry.core.masonry.api"
|
|
44
|
+
|
|
@@ -62,7 +62,6 @@ from .sql.sqltypes import POINT as POINT
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
from .sql.clauses import Alias as Alias
|
|
65
|
-
from .sql.clauses import Count as Count
|
|
66
65
|
from .sql.clauses import Delete as Delete
|
|
67
66
|
from .sql.clauses import GroupBy as GroupBy
|
|
68
67
|
from .sql.clauses import Insert as Insert
|
|
@@ -76,12 +75,21 @@ from .sql.clauses import Having as Having
|
|
|
76
75
|
from .sql.clauses import Update as Update
|
|
77
76
|
from .sql.clauses import Upsert as Upsert
|
|
78
77
|
|
|
79
|
-
from .sql
|
|
80
|
-
from .sql.functions import Min as Min
|
|
81
|
-
from .sql.functions import Concat as Concat
|
|
82
|
-
from .sql.functions import Sum as Sum
|
|
83
|
-
|
|
78
|
+
from .sql import functions as functions
|
|
84
79
|
|
|
80
|
+
from .sql.functions import * # noqa: F403
|
|
85
81
|
from . import util as _util
|
|
86
82
|
|
|
83
|
+
|
|
84
|
+
from .sql.column.metadata import PrimaryKey as PrimaryKey
|
|
85
|
+
from .sql.column.metadata import AutoGenerated as AutoGenerated
|
|
86
|
+
from .sql.column.metadata import AutoIncrement as AutoIncrement
|
|
87
|
+
from .sql.column.metadata import Unique as Unique
|
|
88
|
+
from .sql.column.metadata import CheckTypes as CheckTypes
|
|
89
|
+
from .sql.column.metadata import Default as Default
|
|
90
|
+
from .sql.column.metadata import NotNull as NotNull
|
|
91
|
+
|
|
92
|
+
from ormlambda.statements.interfaces import IStatements as IStatements
|
|
93
|
+
from ormlambda.engine import Engine as Engine
|
|
94
|
+
|
|
87
95
|
_util.import_prefix("ormlambda")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DOT = '.'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
class ConditionType(Enum):
|
|
4
|
+
class ConditionType(str, Enum):
|
|
5
5
|
EQUAL = "="
|
|
6
6
|
LESS_THAN = "<"
|
|
7
7
|
GREATER_THAN = ">"
|
|
@@ -15,3 +15,6 @@ class ConditionType(Enum):
|
|
|
15
15
|
NOT_IN = "NOT IN"
|
|
16
16
|
IS = "IS"
|
|
17
17
|
IS_NOT = "IS NOT"
|
|
18
|
+
|
|
19
|
+
def __str__(self):
|
|
20
|
+
return super().__str__()
|
|
@@ -6,6 +6,7 @@ from ormlambda import util
|
|
|
6
6
|
|
|
7
7
|
if tp.TYPE_CHECKING:
|
|
8
8
|
from ormlambda.sql.clause_info import ClauseInfo
|
|
9
|
+
from ormlambda.sql import Column
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class UnmatchedLambdaParameterError(Exception):
|
|
@@ -18,16 +19,16 @@ class UnmatchedLambdaParameterError(Exception):
|
|
|
18
19
|
return f"Unmatched number of parameters in lambda function with the number of tables: Expected {self.expected_params} parameters but found {str(self.found_param)}."
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
class
|
|
22
|
+
class NotKeysInIFunctionError(Exception):
|
|
22
23
|
def __init__(self, match_regex: list[str], *args: object) -> None:
|
|
23
24
|
super().__init__(*args)
|
|
24
25
|
self._match_regex: list[str] = match_regex
|
|
25
26
|
|
|
26
27
|
def __str__(self) -> str:
|
|
27
|
-
return f"We cannot use placeholders in
|
|
28
|
+
return f"We cannot use placeholders in IFunction class. You used {self._match_regex}"
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
class
|
|
31
|
+
class FunctionFunctionError[T](Exception):
|
|
31
32
|
def __init__(self, clause: ClauseInfo[T], *args):
|
|
32
33
|
self.clause = clause
|
|
33
34
|
super().__init__(*args)
|
|
@@ -36,18 +37,18 @@ class AggregateFunctionError[T](Exception):
|
|
|
36
37
|
agg_methods = self.__get_all_aggregate_method(self.clause)
|
|
37
38
|
return f"You cannot use aggregation method like '{agg_methods}' to return model objects. Try specifying 'flavour' attribute as 'dict'."
|
|
38
39
|
|
|
39
|
-
@util.preload_module("ormlambda.sql.
|
|
40
|
+
@util.preload_module("ormlambda.sql.functions")
|
|
40
41
|
def __get_all_aggregate_method(self, clauses: list[ClauseInfo]) -> str:
|
|
41
42
|
"""
|
|
42
|
-
Get the class name of those classes that inherit from '
|
|
43
|
+
Get the class name of those classes that inherit from 'IFunction' class in order to create a better error message.
|
|
43
44
|
"""
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
IFunction = util.preloaded.sql_functions.IFunction
|
|
46
47
|
res: set[str] = set()
|
|
47
48
|
if not isinstance(clauses, tp.Iterable):
|
|
48
49
|
return clauses.__class__.__name__
|
|
49
50
|
for clause in clauses:
|
|
50
|
-
if isinstance(clause,
|
|
51
|
+
if isinstance(clause, IFunction):
|
|
51
52
|
res.add(clause.__class__.__name__)
|
|
52
53
|
return ", ".join(res)
|
|
53
54
|
|
|
@@ -56,5 +57,46 @@ class NotCallableError(ValueError):
|
|
|
56
57
|
def __init__(self, *args):
|
|
57
58
|
super().__init__(*args)
|
|
58
59
|
|
|
59
|
-
def __str__(self)->str:
|
|
60
|
-
return f"You must provide a function or callable to proceed with the query creation. Passed '{self.args[0].__class__.__name__}' "
|
|
60
|
+
def __str__(self) -> str:
|
|
61
|
+
return f"You must provide a function or callable to proceed with the query creation. Passed '{self.args[0].__class__.__name__}' "
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class CompileError(Exception):
|
|
65
|
+
"""Exception raised for errors in the compilation process."""
|
|
66
|
+
|
|
67
|
+
def __init__(self, message):
|
|
68
|
+
super().__init__(message)
|
|
69
|
+
self.message = message
|
|
70
|
+
|
|
71
|
+
def __str__(self):
|
|
72
|
+
return f"CompileError: {self.message}"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class NoSuchModuleError(Exception):
|
|
76
|
+
"""Raised when a dynamically-loaded module (usually a database dialect)
|
|
77
|
+
of a particular name cannot be located."""
|
|
78
|
+
|
|
79
|
+
def __str__(self):
|
|
80
|
+
return f"NoSuchModuleError: {self.args[0]}"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class DuplicatedClauseNameError(Exception):
|
|
84
|
+
def __init__(self, names: tuple[str], **kw):
|
|
85
|
+
self.names = names
|
|
86
|
+
super().__init__(**kw)
|
|
87
|
+
|
|
88
|
+
def __str__(self):
|
|
89
|
+
return f"Some clauses has the same alias. {self.names}\nTry wrapping the clause with the 'Alias' class first or setting 'avoid_duplicates' param as 'True'"
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class ColumnError(ValueError):
|
|
93
|
+
def __init__(self, column: Column, *args):
|
|
94
|
+
super().__init__(*args)
|
|
95
|
+
self.column = column
|
|
96
|
+
self.clause: str = ""
|
|
97
|
+
|
|
98
|
+
def set_clause(self, value: str) -> None:
|
|
99
|
+
self.clause = value
|
|
100
|
+
|
|
101
|
+
def __str__(self):
|
|
102
|
+
return f"The column '{self.column.column_name}' does not exist. Check the name you used inside of '{self.clause}' clause."
|