ormlambda 3.34.5__tar.gz → 3.34.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.
- {ormlambda-3.34.5 → ormlambda-3.34.7}/PKG-INFO +1 -1
- {ormlambda-3.34.5 → ormlambda-3.34.7}/pyproject.toml +1 -1
- ormlambda-3.34.7/src/ormlambda/dialects/mysql/__init__.py +84 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/mysql/base.py +1 -0
- ormlambda-3.34.7/src/ormlambda/sql/clauses/new_join.py +119 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/sqltypes.py +6 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/table/table.py +4 -8
- ormlambda-3.34.5/src/ormlambda/dialects/mysql/__init__.py +0 -8
- {ormlambda-3.34.5 → ormlambda-3.34.7}/AUTHORS +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/LICENSE +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/README.md +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/caster/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/caster/base_caster.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/caster/caster.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/caster/interfaces/ICaster.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/caster/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/clause_info_converter.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/decomposition_query.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/non_query_base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/query_base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/enums/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/enums/condition_types.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/enums/join_type.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/errors/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/global_checker.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/ICustomAlias.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/IDecompositionQuery.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/IJoinSelector.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/INonQueryCommand.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/IQueryCommand.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/caster.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/boolean.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/bytes.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/date.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/datetime.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/decimal.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/float.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/int.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/iterable.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/none.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/point.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/string.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/ST_AsText.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/ST_Contains.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/count.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/delete.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/drop_table.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/group_by.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/having.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/insert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/joins.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/limit.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/offset.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/order.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/update.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/upsert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/clauses/where.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/pool_types.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/repository.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/default/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/default/base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/interface/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/interface/dialect.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/mysql/mysqlconnector.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/mysql/types.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/sqlite/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/sqlite/base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/dialects/sqlite/pysqlite.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/engine/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/engine/base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/engine/create.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/engine/url.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/engine/utils.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/env.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/errors.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/model/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/model/base_model.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/base_repository.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/interfaces/IDatabaseConnection.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/interfaces/IRepositoryBase.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/response.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/aggregate_function_base.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/clause_info.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/clause_info_context.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/interface/IAggregate.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/interface/IClauseInfo.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/interface/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/alias.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/count.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/delete.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/group_by.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/having.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/insert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/IDelete.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/IInsert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/ISelect.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/IUpdate.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/IUpsert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/join/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/join/join_context.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/joins.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/limit.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/offset.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/order.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/select.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/update.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/upsert.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clauses/where.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/column/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/column/column.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/comparer.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/compiler.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/ddl.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/elements.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/foreign_key.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/functions/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/functions/concat.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/functions/max.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/functions/min.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/functions/sum.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/table/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/table/fields.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/table/table_constructor.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/type_api.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/types.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/visitors.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/base_statement.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/interfaces/IStatements.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/interfaces/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/query_builder.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/statements.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/statements/types.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/types/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/types/metadata.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/load_module.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/module_tree/__init__.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/module_tree/dfs_traversal.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/module_tree/dynamic_module.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/plugin_loader.py +0 -0
- {ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/util/typing.py +0 -0
@@ -3,7 +3,7 @@ line-length = 320
|
|
3
3
|
|
4
4
|
[tool.poetry]
|
5
5
|
name = "ormlambda"
|
6
|
-
version = "3.34.
|
6
|
+
version = "3.34.7"
|
7
7
|
description = "ORM designed to interact with the database (currently with MySQL) using lambda functions and nested functions"
|
8
8
|
authors = ["p-hzamora <p.hzamora@icloud.com>"]
|
9
9
|
readme = "README.md"
|
@@ -0,0 +1,84 @@
|
|
1
|
+
from . import base
|
2
|
+
from . import mysqlconnector
|
3
|
+
|
4
|
+
from .base import BIGINT
|
5
|
+
from .base import BINARY
|
6
|
+
from .base import BIT
|
7
|
+
from .base import BLOB
|
8
|
+
from .base import BOOLEAN
|
9
|
+
from .base import CHAR
|
10
|
+
from .base import DATE
|
11
|
+
from .base import DATETIME
|
12
|
+
from .base import DECIMAL
|
13
|
+
from .base import DOUBLE
|
14
|
+
from .base import FLOAT
|
15
|
+
from .base import INTEGER
|
16
|
+
from .base import LONGBLOB
|
17
|
+
from .base import LONGTEXT
|
18
|
+
from .base import MEDIUMBLOB
|
19
|
+
from .base import MEDIUMINT
|
20
|
+
from .base import MEDIUMTEXT
|
21
|
+
from .base import NCHAR
|
22
|
+
from .base import NUMERIC
|
23
|
+
from .base import NVARCHAR
|
24
|
+
from .base import REAL
|
25
|
+
from .base import SMALLINT
|
26
|
+
from .base import TEXT
|
27
|
+
from .base import TIME
|
28
|
+
from .base import TIMESTAMP
|
29
|
+
from .base import TINYBLOB
|
30
|
+
from .base import TINYINT
|
31
|
+
from .base import TINYTEXT
|
32
|
+
from .base import VARBINARY
|
33
|
+
from .base import VARCHAR
|
34
|
+
from .base import YEAR
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
__all__ = (
|
39
|
+
"BIGINT",
|
40
|
+
"BINARY",
|
41
|
+
"BIT",
|
42
|
+
"BLOB",
|
43
|
+
"BOOLEAN",
|
44
|
+
"CHAR",
|
45
|
+
"DATE",
|
46
|
+
"DATETIME",
|
47
|
+
"DECIMAL",
|
48
|
+
"DOUBLE",
|
49
|
+
"ENUM",
|
50
|
+
"FLOAT",
|
51
|
+
"INET4",
|
52
|
+
"INET6",
|
53
|
+
"INTEGER",
|
54
|
+
"INTEGER",
|
55
|
+
"JSON",
|
56
|
+
"LONGBLOB",
|
57
|
+
"LONGTEXT",
|
58
|
+
"MEDIUMBLOB",
|
59
|
+
"MEDIUMINT",
|
60
|
+
"MEDIUMTEXT",
|
61
|
+
"NCHAR",
|
62
|
+
"NVARCHAR",
|
63
|
+
"NUMERIC",
|
64
|
+
"SET",
|
65
|
+
"SMALLINT",
|
66
|
+
"REAL",
|
67
|
+
"TEXT",
|
68
|
+
"TIME",
|
69
|
+
"TIMESTAMP",
|
70
|
+
"TINYBLOB",
|
71
|
+
"TINYINT",
|
72
|
+
"TINYTEXT",
|
73
|
+
"VARBINARY",
|
74
|
+
"VARCHAR",
|
75
|
+
"YEAR",
|
76
|
+
"dialect",
|
77
|
+
"insert",
|
78
|
+
"Insert",
|
79
|
+
"match",
|
80
|
+
)
|
81
|
+
|
82
|
+
|
83
|
+
# default dialect
|
84
|
+
base.dialect = dialect = mysqlconnector.dialect
|
@@ -0,0 +1,119 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
from collections import defaultdict
|
3
|
+
from typing import override, Optional, TYPE_CHECKING, Type
|
4
|
+
|
5
|
+
|
6
|
+
from ormlambda.util.module_tree.dfs_traversal import DFSTraversal
|
7
|
+
from ormlambda.common.interfaces.IQueryCommand import IQuery
|
8
|
+
from ormlambda import JoinType
|
9
|
+
from ormlambda.sql.clause_info import ClauseInfo
|
10
|
+
from ormlambda.sql.comparer import Comparer
|
11
|
+
from ormlambda.sql.elements import ClauseElement
|
12
|
+
|
13
|
+
|
14
|
+
# TODOL [x]: Try to import Table module without circular import Error
|
15
|
+
if TYPE_CHECKING:
|
16
|
+
from ormlambda.dialects import Dialect
|
17
|
+
|
18
|
+
|
19
|
+
class Join(ClauseElement):
|
20
|
+
__visit_name__ = "join"
|
21
|
+
__slots__: tuple = (
|
22
|
+
"comparer",
|
23
|
+
"alias",
|
24
|
+
"from_clause",
|
25
|
+
"left_clause",
|
26
|
+
"right_clause",
|
27
|
+
"by",
|
28
|
+
"_dialect",
|
29
|
+
)
|
30
|
+
|
31
|
+
DEFAULT_TABLE: str = "{table}"
|
32
|
+
|
33
|
+
@override
|
34
|
+
def __repr__(self) -> str:
|
35
|
+
return f"{IQuery.__name__}: {self.query(self._dialect)}"
|
36
|
+
|
37
|
+
def __init__(
|
38
|
+
self,
|
39
|
+
comparer: Comparer,
|
40
|
+
right_alias: Optional[str] = DEFAULT_TABLE,
|
41
|
+
left_alias: Optional[str] = DEFAULT_TABLE,
|
42
|
+
by: JoinType = JoinType.LEFT_EXCLUSIVE,
|
43
|
+
*,
|
44
|
+
dialect: Dialect,
|
45
|
+
**kw,
|
46
|
+
) -> None:
|
47
|
+
self.comparer = comparer
|
48
|
+
self._dialect = dialect
|
49
|
+
self.by = by
|
50
|
+
|
51
|
+
# COMMENT: When multiple columns reference the same table, we need to create an alias to maintain clear references.
|
52
|
+
self.alias: Optional[str] = right_alias
|
53
|
+
self.left_clause: ClauseInfo = comparer.left_condition(dialect)
|
54
|
+
self.left_clause.alias_table = left_alias if left_alias is not None else self.DEFAULT_TABLE
|
55
|
+
|
56
|
+
self.right_clause: ClauseInfo = comparer.right_condition(dialect)
|
57
|
+
self.right_clause.alias_table = right_alias if right_alias is not None else self.DEFAULT_TABLE
|
58
|
+
self.from_clause = ClauseInfo(self.right_clause.table, None, alias_table=self.alias, dialect=dialect)
|
59
|
+
|
60
|
+
def __eq__(self, __value: Join) -> bool:
|
61
|
+
return isinstance(__value, Join) and self.__hash__() == __value.__hash__()
|
62
|
+
|
63
|
+
def __hash__(self) -> int:
|
64
|
+
return hash(
|
65
|
+
(
|
66
|
+
self.by,
|
67
|
+
self.left_clause.query(self._dialect),
|
68
|
+
self.right_clause.query(self._dialect),
|
69
|
+
self.from_clause.query(self._dialect),
|
70
|
+
)
|
71
|
+
)
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def join_selectors(cls, dialect: Dialect, *args: Join) -> str:
|
75
|
+
return "\n".join([x.query(dialect) for x in args])
|
76
|
+
|
77
|
+
def query(self, dialect: Dialect) -> str:
|
78
|
+
list_ = [
|
79
|
+
self.by.value, # inner join
|
80
|
+
self.from_clause.query(dialect),
|
81
|
+
"ON",
|
82
|
+
self.left_clause.query(dialect),
|
83
|
+
"=",
|
84
|
+
self.right_clause.query(dialect),
|
85
|
+
]
|
86
|
+
return " ".join([x for x in list_ if x is not None])
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def sort_join_selectors(cls, joins: set[Join]) -> tuple[Join]:
|
90
|
+
# FIXME [x]: How to sort when needed because it's not necessary at this point. It is for testing purpouse
|
91
|
+
if len(joins) == 1:
|
92
|
+
return tuple(joins)
|
93
|
+
|
94
|
+
# create graph and sort it using 'Depth First Search' algorithm
|
95
|
+
graph: dict[str, list[str]] = defaultdict(list)
|
96
|
+
for join in joins:
|
97
|
+
graph[join.left_clause.alias_table].append(join.right_clause.alias_table)
|
98
|
+
|
99
|
+
sorted_graph = DFSTraversal.sort(graph)[::-1]
|
100
|
+
|
101
|
+
if not sorted_graph:
|
102
|
+
return tuple(joins)
|
103
|
+
|
104
|
+
# Mapped Join class using his unique alias
|
105
|
+
join_object_map: dict[str, Join] = {}
|
106
|
+
for obj in joins:
|
107
|
+
join_object_map[obj.alias] = obj
|
108
|
+
|
109
|
+
res = []
|
110
|
+
for table in sorted_graph:
|
111
|
+
tables = join_object_map.get(table, None)
|
112
|
+
|
113
|
+
if not tables:
|
114
|
+
continue
|
115
|
+
res.append(tables)
|
116
|
+
return res
|
117
|
+
|
118
|
+
|
119
|
+
__all__ = ["Join"]
|
@@ -159,14 +159,10 @@ class Table(metaclass=TableMeta):
|
|
159
159
|
return [ForeignKey.MAPPED[x].table_object for x in order_table]
|
160
160
|
|
161
161
|
def __eq__(self, __value: Any) -> bool:
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
tuple(self.to_dict().items()),
|
167
|
-
)
|
168
|
-
)
|
169
|
-
return False
|
162
|
+
return hash(self) == hash(__value)
|
163
|
+
|
164
|
+
def __hash__(self):
|
165
|
+
return hash((self.__table_name__, *list(self.to_dict().items())))
|
170
166
|
|
171
167
|
@classmethod
|
172
168
|
def table_alias(cls, column: Optional[str] = None) -> str:
|
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
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/clause_info_converter.py
RENAMED
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/decomposition_query.py
RENAMED
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/abstract_classes/non_query_base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/common/interfaces/IDecompositionQuery.py
RENAMED
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
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/__init__.py
RENAMED
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/boolean.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/datetime.py
RENAMED
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/decimal.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/databases/my_sql/caster/types/iterable.py
RENAMED
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
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/interfaces/IDatabaseConnection.py
RENAMED
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/repository/interfaces/IRepositoryBase.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/aggregate_function_base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ormlambda-3.34.5 → ormlambda-3.34.7}/src/ormlambda/sql/clause_info/interface/IClauseInfo.py
RENAMED
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
|
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
|