ormlambda 2.9.4__tar.gz → 2.10.0__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-2.9.4 → ormlambda-2.10.0}/PKG-INFO +1 -1
- {ormlambda-2.9.4 → ormlambda-2.10.0}/pyproject.toml +1 -1
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/IStatements.py +16 -9
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/statements.py +17 -6
- {ormlambda-2.9.4 → ormlambda-2.10.0}/LICENSE +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/README.md +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/abstract_model.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/decomposition_query.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/non_query_base.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/query_base.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/enums/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/enums/condition_types.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/enums/join_type.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/errors/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/IAggregate.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/ICustomAlias.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/IDecompositionQuery.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/INonQueryCommand.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/IQueryCommand.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/IRepositoryBase.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/interfaces/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/delete/IDelete.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/delete/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/delete/abstract_delete.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/insert/IInsert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/insert/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/insert/abstract_insert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/update/IUpdate.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/update/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/update/abstract_update.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/upsert/IUpsert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/upsert/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/upsert/abstract_upsert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/where/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/components/where/abstract_where.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/alias.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/count.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/create_database.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/delete.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/drop_database.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/drop_table.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/group_by.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/insert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/joins.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/limit.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/offset.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/order.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/select.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/update.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/upsert.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/where_condition.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/functions/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/functions/concat.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/functions/max.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/functions/min.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/functions/sum.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/repository.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/model_base.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/column.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/dtypes.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/fields.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/foreign_key.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/dis_types.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/disassembler.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/dtypes.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/name_of.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/nested_element.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/tree_instruction.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/module_tree/__init__.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/module_tree/dfs_traversal.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/module_tree/dynamic_module.py +0 -0
- {ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/table_constructor.py +0 -0
@@ -3,7 +3,7 @@ line-length = 320
|
|
3
3
|
|
4
4
|
[tool.poetry]
|
5
5
|
name = "ormlambda"
|
6
|
-
version = "2.
|
6
|
+
version = "2.10.0"
|
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"
|
@@ -35,7 +35,7 @@ type SelectRes10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] = tuple[*SelectRes9[T1
|
|
35
35
|
|
36
36
|
|
37
37
|
type WhereCondition[T, T1] = Callable[[T, T1], bool]
|
38
|
-
type JoinCondition[T, T1] = tuple[T1, WhereCondition[T, T1]]
|
38
|
+
type JoinCondition[T, T1] = tuple[T1, WhereCondition[T, T1], Optional[JoinType]]
|
39
39
|
|
40
40
|
type TupleJoins1[T, T1] = tuple[JoinCondition[T, T1]]
|
41
41
|
type TupleJoins2[T, T1, T2] = tuple[*TupleJoins1[T, T1], JoinCondition[T, T2]]
|
@@ -227,22 +227,29 @@ class IStatements[T, *Ts](ABC):
|
|
227
227
|
# region join
|
228
228
|
|
229
229
|
@overload
|
230
|
-
def join[T1](self,
|
230
|
+
def join[T1](self, table: T1, relation: WhereCondition[T, T1], join_type: Optional[JoinType]) -> IStatements[T, T1]: ...
|
231
231
|
@overload
|
232
|
-
def join[T1](self,
|
232
|
+
def join[T1](self, table: JoinCondition[T, T1]) -> IStatements[T, T1]: ...
|
233
233
|
@overload
|
234
|
-
def join[T1
|
234
|
+
def join[T1](self, table: TupleJoins1[T, T1]) -> IStatements[T, T1]: ...
|
235
235
|
@overload
|
236
|
-
def join[T1, T2
|
236
|
+
def join[T1, T2](self, table: TupleJoins2[T, T1, T2]) -> IStatements[T, T1, T2]: ...
|
237
237
|
@overload
|
238
|
-
def join[T1, T2, T3
|
238
|
+
def join[T1, T2, T3](self, table: TupleJoins3[T, T1, T2, T3]) -> IStatements[T, T1, T2, T3]: ...
|
239
239
|
@overload
|
240
|
-
def join[T1, T2, T3, T4
|
240
|
+
def join[T1, T2, T3, T4](self, table: TupleJoins4[T, T1, T2, T3, T4]) -> IStatements[T, T1, T2, T3, T4]: ...
|
241
241
|
@overload
|
242
|
-
def join[T1, T2, T3, T4, T5
|
242
|
+
def join[T1, T2, T3, T4, T5](self, table: TupleJoins5[T, T1, T2, T3, T4, T5]) -> IStatements[T, T1, T2, T3, T4, T5]: ...
|
243
|
+
@overload
|
244
|
+
def join[T1, T2, T3, T4, T5, T6](self, table: TupleJoins6[T, T1, T2, T3, T4, T5, T6]) -> IStatements[T, T1, T2, T3, T4, T5, T6]: ...
|
243
245
|
|
244
246
|
@abstractmethod
|
245
|
-
def join[*FKTables](
|
247
|
+
def join[*FKTables](
|
248
|
+
self,
|
249
|
+
table: Optional[T] = ...,
|
250
|
+
relation: Optional[WhereCondition[T, FKTables]] = ...,
|
251
|
+
join_type: Optional[JoinType] = ...,
|
252
|
+
) -> IStatements[T, *FKTables]: ...
|
246
253
|
|
247
254
|
# endregion
|
248
255
|
# region select
|
@@ -184,13 +184,24 @@ class MySQLStatements[T: Table, *Ts](AbstractSQLStatements[T, *Ts, MySQLConnecti
|
|
184
184
|
return func.Sum[T](self._model, column=column, alias=alias, alias_name=alias_name)
|
185
185
|
|
186
186
|
@override
|
187
|
-
def join[*FKTables](
|
188
|
-
|
189
|
-
|
187
|
+
def join[*FKTables](
|
188
|
+
self,
|
189
|
+
table: Optional[T] = None,
|
190
|
+
relation: Optional[WhereCondition[T, *FKTables]] = None,
|
191
|
+
join_type: Optional[JoinType] = None,
|
192
|
+
) -> IStatements_two_generic[T, *FKTables, MySQLConnection]:
|
193
|
+
if isinstance(table, type) and issubclass(table, Table):
|
194
|
+
joins = ((table, relation, join_type),)
|
195
|
+
else:
|
196
|
+
if any(len(x) != 3 for x in table):
|
197
|
+
raise ValueError("Each tuple inside of 'join' method must contain the referenced table, relation between columns and join type")
|
198
|
+
joins = table
|
199
|
+
|
190
200
|
new_tables: list[Type[Table]] = [self._model]
|
191
|
-
|
201
|
+
|
202
|
+
for table, where, by in joins:
|
192
203
|
new_tables.append(table)
|
193
|
-
join_query = JoinSelector[T, type(table)](self._model, table, by=
|
204
|
+
join_query = JoinSelector[T, type(table)](self._model, table, by=by, where=where)
|
194
205
|
self._query_list["join"].append(join_query)
|
195
206
|
self._models = new_tables
|
196
207
|
return self
|
@@ -217,7 +228,7 @@ class MySQLStatements[T: Table, *Ts](AbstractSQLStatements[T, *Ts, MySQLConnecti
|
|
217
228
|
self._query_list["select"].append(select)
|
218
229
|
|
219
230
|
self._query: str = self._build()
|
220
|
-
|
231
|
+
|
221
232
|
if flavour:
|
222
233
|
result = self._return_flavour(self.query, flavour, select, **kwargs)
|
223
234
|
if issubclass(flavour, tuple) and isinstance(selector(*self._models), property):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/abstract_model.py
RENAMED
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/common/abstract_classes/decomposition_query.py
RENAMED
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/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
|
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-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/create_database.py
RENAMED
File without changes
|
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/drop_database.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
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/databases/my_sql/clauses/where_condition.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
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/disassembler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/nested_element.py
RENAMED
File without changes
|
{ormlambda-2.9.4 → ormlambda-2.10.0}/src/ormlambda/utils/lambda_disassembler/tree_instruction.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|