ormlambda 3.35.3__py3-none-any.whl → 4.0.4__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 (130) hide show
  1. ormlambda/__init__.py +79 -51
  2. ormlambda/caster/caster.py +6 -1
  3. ormlambda/common/abstract_classes/__init__.py +0 -2
  4. ormlambda/common/enums/__init__.py +1 -0
  5. ormlambda/common/enums/order_type.py +9 -0
  6. ormlambda/common/errors/__init__.py +13 -3
  7. ormlambda/common/global_checker.py +86 -8
  8. ormlambda/common/interfaces/IQueryCommand.py +2 -2
  9. ormlambda/common/interfaces/__init__.py +0 -2
  10. ormlambda/dialects/__init__.py +75 -3
  11. ormlambda/dialects/default/base.py +1 -1
  12. ormlambda/dialects/mysql/__init__.py +35 -78
  13. ormlambda/dialects/mysql/base.py +226 -40
  14. ormlambda/dialects/mysql/clauses/ST_AsText.py +26 -0
  15. ormlambda/dialects/mysql/clauses/ST_Contains.py +30 -0
  16. ormlambda/dialects/mysql/clauses/__init__.py +1 -0
  17. ormlambda/dialects/mysql/repository/__init__.py +1 -0
  18. ormlambda/{databases/my_sql → dialects/mysql/repository}/repository.py +0 -5
  19. ormlambda/dialects/mysql/types.py +6 -0
  20. ormlambda/engine/base.py +26 -4
  21. ormlambda/errors.py +9 -0
  22. ormlambda/model/base_model.py +3 -10
  23. ormlambda/repository/base_repository.py +1 -1
  24. ormlambda/repository/interfaces/IRepositoryBase.py +0 -7
  25. ormlambda/repository/response.py +21 -8
  26. ormlambda/sql/__init__.py +12 -3
  27. ormlambda/sql/clause_info/__init__.py +0 -2
  28. ormlambda/sql/clause_info/clause_info.py +94 -76
  29. ormlambda/sql/clause_info/interface/IAggregate.py +14 -4
  30. ormlambda/sql/clause_info/interface/IClauseInfo.py +6 -11
  31. ormlambda/sql/clauses/alias.py +6 -37
  32. ormlambda/sql/clauses/count.py +21 -36
  33. ormlambda/sql/clauses/group_by.py +13 -19
  34. ormlambda/sql/clauses/having.py +2 -6
  35. ormlambda/sql/clauses/insert.py +3 -3
  36. ormlambda/sql/clauses/interfaces/__init__.py +0 -1
  37. ormlambda/sql/clauses/join/join_context.py +5 -12
  38. ormlambda/sql/clauses/joins.py +34 -52
  39. ormlambda/sql/clauses/limit.py +1 -2
  40. ormlambda/sql/clauses/offset.py +1 -2
  41. ormlambda/sql/clauses/order.py +17 -21
  42. ormlambda/sql/clauses/select.py +56 -28
  43. ormlambda/sql/clauses/update.py +13 -10
  44. ormlambda/sql/clauses/where.py +20 -39
  45. ormlambda/sql/column/__init__.py +1 -0
  46. ormlambda/sql/column/column.py +19 -12
  47. ormlambda/sql/column/column_proxy.py +117 -0
  48. ormlambda/sql/column_table_proxy.py +23 -0
  49. ormlambda/sql/comparer.py +31 -65
  50. ormlambda/sql/compiler.py +248 -58
  51. ormlambda/sql/context/__init__.py +304 -0
  52. ormlambda/sql/ddl.py +19 -5
  53. ormlambda/sql/elements.py +3 -0
  54. ormlambda/sql/foreign_key.py +42 -64
  55. ormlambda/sql/functions/__init__.py +0 -1
  56. ormlambda/sql/functions/concat.py +35 -38
  57. ormlambda/sql/functions/max.py +12 -36
  58. ormlambda/sql/functions/min.py +13 -28
  59. ormlambda/sql/functions/sum.py +17 -33
  60. ormlambda/sql/sqltypes.py +2 -0
  61. ormlambda/sql/table/__init__.py +1 -0
  62. ormlambda/sql/table/table.py +31 -45
  63. ormlambda/sql/table/table_proxy.py +88 -0
  64. ormlambda/sql/type_api.py +4 -1
  65. ormlambda/sql/types.py +15 -12
  66. ormlambda/statements/__init__.py +0 -2
  67. ormlambda/statements/base_statement.py +53 -91
  68. ormlambda/statements/interfaces/IStatements.py +77 -123
  69. ormlambda/statements/interfaces/__init__.py +1 -1
  70. ormlambda/statements/query_builder.py +296 -128
  71. ormlambda/statements/statements.py +122 -115
  72. ormlambda/statements/types.py +5 -25
  73. ormlambda/util/__init__.py +7 -100
  74. ormlambda/util/langhelpers.py +102 -0
  75. ormlambda/util/module_tree/dynamic_module.py +1 -1
  76. ormlambda/util/preloaded.py +80 -0
  77. ormlambda/util/typing.py +12 -3
  78. {ormlambda-3.35.3.dist-info → ormlambda-4.0.4.dist-info}/METADATA +56 -79
  79. ormlambda-4.0.4.dist-info/RECORD +139 -0
  80. ormlambda/common/abstract_classes/clause_info_converter.py +0 -65
  81. ormlambda/common/abstract_classes/decomposition_query.py +0 -141
  82. ormlambda/common/abstract_classes/query_base.py +0 -15
  83. ormlambda/common/interfaces/ICustomAlias.py +0 -7
  84. ormlambda/common/interfaces/IDecompositionQuery.py +0 -33
  85. ormlambda/databases/__init__.py +0 -4
  86. ormlambda/databases/my_sql/__init__.py +0 -3
  87. ormlambda/databases/my_sql/clauses/ST_AsText.py +0 -37
  88. ormlambda/databases/my_sql/clauses/ST_Contains.py +0 -36
  89. ormlambda/databases/my_sql/clauses/__init__.py +0 -14
  90. ormlambda/databases/my_sql/clauses/count.py +0 -33
  91. ormlambda/databases/my_sql/clauses/delete.py +0 -9
  92. ormlambda/databases/my_sql/clauses/drop_table.py +0 -26
  93. ormlambda/databases/my_sql/clauses/group_by.py +0 -17
  94. ormlambda/databases/my_sql/clauses/having.py +0 -12
  95. ormlambda/databases/my_sql/clauses/insert.py +0 -9
  96. ormlambda/databases/my_sql/clauses/joins.py +0 -14
  97. ormlambda/databases/my_sql/clauses/limit.py +0 -6
  98. ormlambda/databases/my_sql/clauses/offset.py +0 -6
  99. ormlambda/databases/my_sql/clauses/order.py +0 -8
  100. ormlambda/databases/my_sql/clauses/update.py +0 -8
  101. ormlambda/databases/my_sql/clauses/upsert.py +0 -9
  102. ormlambda/databases/my_sql/clauses/where.py +0 -7
  103. ormlambda/dialects/interface/__init__.py +0 -1
  104. ormlambda/dialects/interface/dialect.py +0 -78
  105. ormlambda/sql/clause_info/aggregate_function_base.py +0 -96
  106. ormlambda/sql/clause_info/clause_info_context.py +0 -87
  107. ormlambda/sql/clauses/interfaces/ISelect.py +0 -17
  108. ormlambda/sql/clauses/new_join.py +0 -119
  109. ormlambda/util/load_module.py +0 -21
  110. ormlambda/util/plugin_loader.py +0 -32
  111. ormlambda-3.35.3.dist-info/RECORD +0 -159
  112. /ormlambda/{databases/my_sql → dialects/mysql}/caster/__init__.py +0 -0
  113. /ormlambda/{databases/my_sql → dialects/mysql}/caster/caster.py +0 -0
  114. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/__init__.py +0 -0
  115. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/boolean.py +0 -0
  116. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/bytes.py +0 -0
  117. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/date.py +0 -0
  118. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/datetime.py +0 -0
  119. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/decimal.py +0 -0
  120. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/float.py +0 -0
  121. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/int.py +0 -0
  122. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/iterable.py +0 -0
  123. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/json.py +0 -0
  124. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/none.py +0 -0
  125. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/point.py +0 -0
  126. /ormlambda/{databases/my_sql → dialects/mysql}/caster/types/string.py +0 -0
  127. /ormlambda/{databases/my_sql → dialects/mysql/repository}/pool_types.py +0 -0
  128. {ormlambda-3.35.3.dist-info → ormlambda-4.0.4.dist-info}/AUTHORS +0 -0
  129. {ormlambda-3.35.3.dist-info → ormlambda-4.0.4.dist-info}/LICENSE +0 -0
  130. {ormlambda-3.35.3.dist-info → ormlambda-4.0.4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,80 @@
1
+ from typing import Callable, TYPE_CHECKING
2
+ import importlib
3
+
4
+ type FuncType[T] = Callable[..., T]
5
+
6
+
7
+ if TYPE_CHECKING:
8
+ from ormlambda.sql import table as _sql_table
9
+ from ormlambda.sql import column as _sql_column
10
+ from ormlambda.sql import comparer as _sql_comparer
11
+ from ormlambda.sql import column_table_proxy as _sql_column_table_proxy
12
+ from ormlambda.sql import foreign_key as _sql_foreign_key
13
+ from ormlambda.sql import clause_info as _sql_clause_info
14
+ from ormlambda.sql import sqltypes as _sql_sqltypes
15
+ from ormlambda.sql import clauses as _sql_clauses
16
+ from ormlambda.sql import type_api as _sql_type_api
17
+
18
+ sql_column = _sql_column
19
+ sql_table = _sql_table
20
+ sql_comparer = _sql_comparer
21
+ sql_column_table_proxy = _sql_column_table_proxy
22
+ sql_foreign_key = _sql_foreign_key
23
+ sql_clause_info = _sql_clause_info
24
+ sql_types = _sql_sqltypes
25
+ sql_clauses = _sql_clauses
26
+
27
+ sql_type_api = _sql_type_api
28
+
29
+ class ModuleRegistry:
30
+ """Registry of modules to load in a package init file.
31
+
32
+ To avoid potential thread safety issues for imports that are deferred
33
+ in a function, like https://bugs.python.org/issue38884, these modules
34
+ are added to the system module cache by importing them after the packages
35
+ has finished initialization.
36
+
37
+ A global instance is provided under the name :attr:`.preloaded`. Use
38
+ the function :func:`.preload_module` to register modules to load and
39
+ :meth:`.import_prefix` to load all the modules that start with the
40
+ given path.
41
+
42
+ While the modules are loaded in the global module cache, it's advisable
43
+ to access them using :attr:`.preloaded` to ensure that it was actually
44
+ registered. Each registered module is added to the instance ``__dict__``
45
+ in the form `<package>_<module>`, omitting ``sqlalchemy`` from the package
46
+ name. Example: ``sqlalchemy.sql.util`` becomes ``preloaded.sql_util``.
47
+ """
48
+
49
+ def __init__(self, prefix="ormlambda."):
50
+ self.module_registry: set[str] = set()
51
+ self.prefix: str = prefix
52
+
53
+ def preload_module[T, **P](self, *deps: str) -> Callable[P, T]:
54
+ """Adds the specified modules to the list to load.
55
+
56
+ This method can be used both as a normal function and as a decorator.
57
+ No change is performed to the decorated object.
58
+ """
59
+ self.module_registry.update(deps)
60
+ return lambda fn: fn
61
+
62
+ def import_prefix(self, path: str) -> None:
63
+ """Resolve all the modules in the registry that start with the
64
+ specified path.
65
+ """
66
+ for module in self.module_registry:
67
+ if self.prefix:
68
+ key = module.split(self.prefix)[-1].replace(".", "_")
69
+ else:
70
+ key = module
71
+
72
+ if (not path or module.startswith(path)) and key not in self.__dict__:
73
+ _module = importlib.import_module(module)
74
+ self.__dict__[key] = globals()[key] = _module
75
+ return None
76
+
77
+
78
+ _reg = ModuleRegistry()
79
+ preload_module = _reg.preload_module
80
+ import_prefix = _reg.import_prefix
ormlambda/util/typing.py CHANGED
@@ -1,6 +1,15 @@
1
- import typing as tp
2
1
  import typing_extensions as tpe
2
+ from typing import Any, Literal, Type, NewType, get_origin, TypeGuard, TypeAliasType
3
3
 
4
- LITERAL_TYPES = frozenset([tp.Literal, tpe.Literal])
5
4
 
6
- type _AnnotationScanType = tp.Type[tp.Any] | str | tp.NewType
5
+ LITERAL_TYPES = frozenset([Literal, tpe.Literal])
6
+
7
+ type _AnnotationScanType = Type[Any] | str | NewType
8
+
9
+
10
+ def is_literal(type_: Any) -> bool:
11
+ return get_origin(type) in LITERAL_TYPES
12
+
13
+
14
+ def is_pep695(type_: _AnnotationScanType) -> TypeGuard[TypeAliasType]:
15
+ return isinstance(type_, TypeAliasType)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ormlambda
3
- Version: 3.35.3
3
+ Version: 4.0.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
@@ -90,16 +90,7 @@ If we were used `select_one` method, we retrieved `tuple[Address, City, Country]
90
90
 
91
91
  ## Filter by `where` condition
92
92
 
93
- we can use only the Original Table to pass the variables like
94
- ```python
95
- result = AddressModel.where(
96
- [
97
- Address.address_id >= 10,
98
- Address.address_id <= 30,
99
- ]
100
- ).select()
101
- ```
102
- Or by using a lambda function that returns an iterable for tables where the name is unusually long.
93
+ We can use lambda function that returns an iterable to pass the iterable like.
103
94
 
104
95
  ```python
105
96
  result = AddressModel.where(
@@ -119,7 +110,7 @@ result = AddressModel.where(Address.City.Country.country_id == 87).select()
119
110
  We can also return `Address`, `City` or `Country` if needed.
120
111
 
121
112
  ```python
122
- result = AddressModel.where(Address.City.Country.country_id == 87).select(lambda x: (x, x.City, x.City.Country))
113
+ result = AddressModel.where(lambda x: x.City.Country.country_id == 87).select(lambda x: (x, x.City, x.City.Country))
123
114
  ```
124
115
 
125
116
  ### Pass variables to the `where` method
@@ -127,10 +118,10 @@ result = AddressModel.where(Address.City.Country.country_id == 87).select(lambda
127
118
  LOWER = 10
128
119
  UPPER = 30
129
120
 
130
- AddressModel.where(
121
+ AddressModel.where(lambda x:
131
122
  [
132
- Address.address_id >= LOWER,
133
- Address.address_id <= UPPER,
123
+ x.address_id >= LOWER,
124
+ x.address_id <= UPPER,
134
125
  ]
135
126
  ).select()
136
127
  ```
@@ -238,7 +229,7 @@ result = (
238
229
  AddressModel
239
230
  .order(lambda a: a.address_id, order_type="DESC")
240
231
  .where(lambda x: x.City.Country.country_id >= 50)
241
- .select(Address)
232
+ .select()
242
233
  )
243
234
 
244
235
  ```
@@ -246,13 +237,12 @@ Also you can use `ConditionType` enum for `regular expressions` and get, for exa
246
237
 
247
238
 
248
239
  ```python
249
- address, city, country = (
240
+ response = (
250
241
  AddressModel
251
- .order(Address.address_id, order_type="DESC")
252
- .where(Address.City.Country.country.regex(r"^[A]"))
242
+ .order(lambda x: x.address_id, order_type="DESC")
243
+ .where(lambda x: x.City.Country.country.regex(r"^[A]"))
253
244
  .limit(100)
254
- .select(
255
- lambda a: (
245
+ .select(lambda a: (
256
246
  a,
257
247
  a.City,
258
248
  a.City.Country,
@@ -261,13 +251,9 @@ address, city, country = (
261
251
  )
262
252
 
263
253
 
264
- for a in address:
254
+ for a,c,co in response:
265
255
  print(a.address_id)
266
-
267
- for c in city:
268
256
  print(c.city_id)
269
-
270
- for co in country:
271
257
  print(co.country)
272
258
  ```
273
259
 
@@ -276,10 +262,9 @@ In the example above, we see that the `result` var returns a tuple of tuples. Ho
276
262
 
277
263
  ```python
278
264
  result = (
279
- AddressModel.where(Address.City.Country.country.regex(r"^[A]"))
265
+ AddressModel.where(lambda x: x.City.Country.country.regex(r"^[A]"))
280
266
  .limit(100)
281
- .select(
282
- lambda a: (
267
+ .select(lambda a: (
283
268
  a.address_id,
284
269
  a.City.city_id,
285
270
  a.City.Country.country_id,
@@ -296,19 +281,19 @@ with this approach, we will obtain a dictionary where the key will be the concat
296
281
 
297
282
  ## max
298
283
  ```python
299
- res = AddressModel.max(Address.address_id, execute=True)
284
+ res = AddressModel.max(lambda x: x.address_id)
300
285
  ```
301
286
  ## min
302
287
  ```python
303
- res = AddressModel.min(Address.address_id, execute=True)
288
+ res = AddressModel.min(lambda x: x.address_id)
304
289
  ```
305
290
  ## sum
306
291
  ```python
307
- res = AddressModel.sum(Address.address_id, execute=True)
292
+ res = AddressModel.sum(lambda x: x.address_id)
308
293
  ```
309
294
  ## count
310
295
  ```python
311
- res = AddressModel.count(Address.address_id, execute=True)
296
+ res = AddressModel.count(lambda x: x.address_id)
312
297
  ```
313
298
 
314
299
  ## 1. Concat
@@ -318,28 +303,23 @@ The `concat` method allows you to concatenate multiple columns or values into a
318
303
  ### Usage
319
304
 
320
305
  ```python
321
- response = ORM(Address, db).where(Address.City.Country.country.regex(r"^Spain")).first(
322
- (
323
- Address.address,
324
- Address.City.city,
325
- self.tmodel.concat(
326
- (
327
- "Address: ",
328
- Address.address,
329
- " - city: ",
330
- Address.City.city,
331
- " - country: ",
332
- Address.City.Country.country,
333
- )
334
- ),
335
- ),
336
- flavour=dict,
337
- )
306
+ response = (
307
+ ORM(Address, db)
308
+ .where(lambda x: x.City.Country.country.regex(r"^Spain"))
309
+ .first(
310
+ lambda x: (
311
+ x.address,
312
+ x.City.city,
313
+ Concat(("Address: ", x.address, " - city: ", x.City.city, " - country: ", x.City.Country.country)),
314
+ ),
315
+ flavour=dict,
316
+ )
317
+ )
338
318
 
339
319
  {
340
- "address_address": "939 Probolinggo Loop",
341
- "city_city": "A Coruña (La Coruña)",
342
- "CONCAT": "Address: 939 Probolinggo Loop - city: A Coruña (La Coruña) - country: Spain",
320
+ "address": "939 Probolinggo Loop",
321
+ "city": "A Coruña (La Coruña)",
322
+ "concat": "Address: 939 Probolinggo Loop - city: A Coruña (La Coruña) - country: Spain",
343
323
  }
344
324
  ```
345
325
  As you can see in the response, the result is a dictionary where the keys are a combination of the table name and the column name. This is done to avoid collisions with columns from other tables that might have the same name.
@@ -364,15 +344,13 @@ class Response(BaseModel):
364
344
  engine= create_engine(DATABASE_URL)
365
345
  model = ORM(Address,engine)
366
346
 
367
- count_name = Column(column_name="count")
368
-
369
347
  res = (
370
348
  self.model
371
- .groupby(Address.district)
372
- .select(
349
+ .groupby(lambda x: x.district)
350
+ .select(lambda x:
373
351
  (
374
- Address.district,
375
- self.model.count(Address.address),
352
+ x.district,
353
+ Count(x.address),
376
354
  ),
377
355
  flavour=Response,
378
356
  )
@@ -387,12 +365,12 @@ The `having` method is used to filter results based on aggregate functions. It i
387
365
  ```python
388
366
  res = (
389
367
  model
390
- .groupby(Address.district)
391
- .having(count_name > 4)
392
- .select(
368
+ .groupby(lambda x: x.district)
369
+ .having(lambda x: x.count > 4)
370
+ .select(lambda x:
393
371
  (
394
- Address.district,
395
- model.count(Address.address),
372
+ x.district,
373
+ Count(x.address,alias="count"),
396
374
  ),
397
375
  flavour=Response,
398
376
  )
@@ -422,9 +400,9 @@ select = (
422
400
  ORM(Address, db)
423
401
  .order(lambda x: x.City.Country.country, "DESC")
424
402
  .limit(10)
425
- .where(Address.City.Country.country == "Spain")
426
- .first(
427
- lambda x: (
403
+ .where(lambda x: x.City.Country.country == "Spain")
404
+ .first(lambda x:
405
+ (
428
406
  x.address,
429
407
  x.City.city,
430
408
  x.City.Country.country,
@@ -444,14 +422,13 @@ print(select.city)
444
422
  print(select.country)
445
423
  ```
446
424
 
447
- ## Combine aggregation method
448
- As shown in the previous examples, setting the `execute` attribute to `True` allows us to perform the corresponding query in a single line. However, if you're looking to improve efficiency, you can combine all of them into one query.
425
+ ## Aggregation method
426
+ You can also use `aggregation methods` to create more informative queries.
449
427
  ```python
450
- result = AddressModel.select_one(
451
- lambda x: (
452
- AddressModel.min(x.address_id),
453
- AddressModel.max(x.address_id),
454
- AddressModel.count(x.address_id),
428
+ result = AddressModel.select_one(lambda x: (
429
+ Min(x.address_id),
430
+ Max(x.address_id),
431
+ Count(x.address_id),
455
432
  ),flavour=dict
456
433
  )
457
434
  ```
@@ -468,11 +445,11 @@ Getting something like
468
445
  You also can use custom alias for each method
469
446
 
470
447
  ```python
471
- AddressModel.select_one(
472
- lambda x: (
473
- AddressModel.min(x.address_id),
474
- AddressModel.max(x.address_id, alias="custom-max"),
475
- AddressModel.count(x.address_id),
448
+ AddressModel.select_one(lambda x:
449
+ (
450
+ Min(x.address_id),
451
+ Max(x.address_id, alias="custom-max"),
452
+ Count(x.address_id),
476
453
  ),
477
454
  flavour=dict,
478
455
  )
@@ -0,0 +1,139 @@
1
+ ormlambda/__init__.py,sha256=RmBuEDu4a6i8JcShsG-CWFVFhruc-YKz4_Fo5VYrcPQ,3053
2
+ ormlambda/caster/__init__.py,sha256=lXzW6TJwgtyFTaBhKBETyGIxEje005S3SPg7PXnYEVQ,137
3
+ ormlambda/caster/base_caster.py,sha256=c3vCGoKDyJ39kfUiS7sNKhKdjBRYSK1Ie88lwDIXqgE,1774
4
+ ormlambda/caster/caster.py,sha256=qOKgNkoZQqTruNfSGLU0h7V-mZA19KY0uhRzjS6EGxc,2616
5
+ ormlambda/caster/interfaces/ICaster.py,sha256=MCBBVBho9KH67vCcUk8nclY0a7QoqxgdyVJJR0-QDT0,759
6
+ ormlambda/caster/interfaces/__init__.py,sha256=TRoIxxgxuhUhCJq2ldLS3UEa1THrMXEIyTH5K46vyGw,43
7
+ ormlambda/common/__init__.py,sha256=g4yGxH4WEgvQ7Rix4lpp3FQ-3SeRhptNd5sabgZLQNk,59
8
+ ormlambda/common/abstract_classes/__init__.py,sha256=iXhV9U5e8HIis4IhiF_w5fyAAdJclZDUGRJBkZA_AyM,57
9
+ ormlambda/common/abstract_classes/non_query_base.py,sha256=eLXAprXVjVk2sFF8X8EK0UKoOQpgxBlDRn8prLzjr30,1201
10
+ ormlambda/common/enums/__init__.py,sha256=daxD_1Xmrg3txPpzkvdy_VLEbiGPgnD336hMz4nvd0E,151
11
+ ormlambda/common/enums/condition_types.py,sha256=QZnhhlTwzLcZ9kkmG6a08fQjUUJsJ5XGAH7QCiJRL1A,330
12
+ ormlambda/common/enums/join_type.py,sha256=EosZVnvAc72LlZHuICIgoKWwUJzhvWOIIAohcbDYPQo,354
13
+ ormlambda/common/enums/order_type.py,sha256=MOwMIUWn8H-3_BmMpEHcxUK7KNkVlmxrTBfp6etdF44,138
14
+ ormlambda/common/errors/__init__.py,sha256=27NGxp4I4wqhn-TIT9e97IlGb7Blx9RTCFrY8CgACRM,2316
15
+ ormlambda/common/global_checker.py,sha256=l_kN9mejC9kz5xyTEnrJ6adXDLW47cDofJfS9ATHFTI,3634
16
+ ormlambda/common/interfaces/IJoinSelector.py,sha256=-w-MJmwq65tpDLtigWSLgvAqeOl75DA-EyWIugNkfCs,490
17
+ ormlambda/common/interfaces/INonQueryCommand.py,sha256=7CjLW4sKqkR5zUIGvhRXOtzTs6vypJW1a9EJHlgCw2c,260
18
+ ormlambda/common/interfaces/IQueryCommand.py,sha256=PKkAI1SE6U7kcbqFgQsdTQ3asIx-gIp5RDXYlBfANJk,461
19
+ ormlambda/common/interfaces/__init__.py,sha256=-qIJf5fBX0y0vq_O7YjImWFimbj5pqONzK8udH2CMX4,169
20
+ ormlambda/dialects/__init__.py,sha256=-WM-PqZXgZ_-3KWWLSNrPV12FhvVbo_v8Ul3XCUjs0o,3536
21
+ ormlambda/dialects/default/__init__.py,sha256=N1B0LKEDu7r2-mTF9mBA4ReyhYeDuJDnbQCiH4hJvFQ,33
22
+ ormlambda/dialects/default/base.py,sha256=Xle5kD_wi94NiPnkShi5LJbe5M1k8hq_XhU_PZ-iFbs,1078
23
+ ormlambda/dialects/mysql/__init__.py,sha256=DwoefrtyJUivg7z4QS4K2k0DrUu04ItC5LJcDQEYZWg,1398
24
+ ormlambda/dialects/mysql/base.py,sha256=BDEoWUpGB7ss6ZpzZzu8gMUCM33N_pwYgNbh5tmQ30A,21493
25
+ ormlambda/dialects/mysql/caster/__init__.py,sha256=Df2sdZaAJ1Mi5Ego0sILMk5pF1NbK-nlV0hbpzd0PWE,47
26
+ ormlambda/dialects/mysql/caster/caster.py,sha256=G2CDqkrmsxFrHe_nDOmqqrTA_3O2o6gIIfukqPeHmJs,1021
27
+ ormlambda/dialects/mysql/caster/types/__init__.py,sha256=BmtHuVvKGPIOCjVuqQZgtGBMnx15YnGBaBi4r3Hd-3U,587
28
+ ormlambda/dialects/mysql/caster/types/boolean.py,sha256=EYOxnR7-XU30UYZbBbMH4pyynTw5CPU1G8V5xpCthg4,1100
29
+ ormlambda/dialects/mysql/caster/types/bytes.py,sha256=Mzl5oI2q6hGL9TFrTS-Ae1olQlAVtvNoxTSLUSBb5v8,1026
30
+ ormlambda/dialects/mysql/caster/types/date.py,sha256=8usP1Af7WUzEC8BHOBL16Zjg9j-ipMlb42p0UTFELmg,1176
31
+ ormlambda/dialects/mysql/caster/types/datetime.py,sha256=ISzcsbwijTa2wC9ZD8zy5piRm9BdnT9GxkMNf4FQYug,1189
32
+ ormlambda/dialects/mysql/caster/types/decimal.py,sha256=ycQnSqO-aFkrcsa8JKVPdnfjotNL_BUFeScYRcueOWM,1068
33
+ ormlambda/dialects/mysql/caster/types/float.py,sha256=EbU6J3yoL5_naLowfibkfUC9Bk9WzDaWks7lJ2pNhyA,1026
34
+ ormlambda/dialects/mysql/caster/types/int.py,sha256=a30xbe0LNj2BvbtLNZhUXFvT3WJ115MFsHC19Y3NLTk,1016
35
+ ormlambda/dialects/mysql/caster/types/iterable.py,sha256=S7pEAJ_NaxZqYhJAXwaJBS_zrbSz9J2yiYPpmDHATso,1057
36
+ ormlambda/dialects/mysql/caster/types/json.py,sha256=AR7D6CEgyK3zAEijyNO1AuWtLBgC7KTj-YNEWkyilkg,1042
37
+ ormlambda/dialects/mysql/caster/types/none.py,sha256=Bl4jpVVyoLG7ehoCAYj9lFBZbRWbyDN8QsQeWmIb84I,948
38
+ ormlambda/dialects/mysql/caster/types/point.py,sha256=GHAf51kE0AS7wOlCYM9YW-z2ZbmY8hXwcHs979ZCeaY,1442
39
+ ormlambda/dialects/mysql/caster/types/string.py,sha256=WFjTC5phuJ_-ShuokndFbqGuFgGZZx9GbpozH4rlB2g,1017
40
+ ormlambda/dialects/mysql/clauses/ST_AsText.py,sha256=CC9mAAWtU8Vw79Un1ZjQHljsFqaBIW2GHAsoZfn6RO8,726
41
+ ormlambda/dialects/mysql/clauses/ST_Contains.py,sha256=Oexez4rYLTlmWb1sKj4ZVolUqK8BRvgdj2sX3ROVIOc,737
42
+ ormlambda/dialects/mysql/clauses/__init__.py,sha256=n5MMwLhDypwXIJyZd-ggPt8GbTxozIAUfzu5wObbQn0,46
43
+ ormlambda/dialects/mysql/mysqlconnector.py,sha256=DOjK7U7LOhjuVQJULzAV8xaRGX0OlBU8APUeRiTcbDY,1378
44
+ ormlambda/dialects/mysql/repository/__init__.py,sha256=yX1XIaVD8U2JT0nliQpcDQGPutXyhmeJnpI_4ZUxapM,53
45
+ ormlambda/dialects/mysql/repository/pool_types.py,sha256=6c7LMS1VGR8ko1LB1T8DQzn1l10Mzk8PfIeYEOb9w30,1839
46
+ ormlambda/dialects/mysql/repository/repository.py,sha256=-LwEWRvyq6_DDmWD2sWiH9x12x0RUDmH94ZID1Xyvac,7067
47
+ ormlambda/dialects/mysql/types.py,sha256=oQUQiriHhmubmfBdJvhRhcq5zyFqJshbqSktvmxlGR8,23671
48
+ ormlambda/dialects/sqlite/__init__.py,sha256=2EMmxD7ORtGoD18GJ_9aC_tPutAq9ormMZJmaJ5nkYA,103
49
+ ormlambda/dialects/sqlite/base.py,sha256=24LSB461yQDEnXa-TsQt_srJmBCAR6M6419pa40CL_4,1503
50
+ ormlambda/dialects/sqlite/pysqlite.py,sha256=dZY0NV2IvSTk3DNEDyncstmIABKj3M2xfmhf2dc2zQs,680
51
+ ormlambda/engine/__init__.py,sha256=JpCLfuW1zcJi4ki97ajXh0aQxMSvWBKzDlBZx9ZVF9o,132
52
+ ormlambda/engine/base.py,sha256=f60O6CLzB7rFBtw7XNxaEw0BccruROzRR-vXBUMcYgQ,2621
53
+ ormlambda/engine/create.py,sha256=caDYXX4BP5uODSrdJXRZvWWjbliDgH1TiSvhtHP3RNY,533
54
+ ormlambda/engine/url.py,sha256=ZzdgZU_Cnjhonbbr5OfBvq_ThUPnDj9v-3-7O54ENm0,26137
55
+ ormlambda/engine/utils.py,sha256=fFoiKsiFuLcjcBVYNebVoYnMrEj3aZdoxEVSNfCY-GM,522
56
+ ormlambda/env.py,sha256=rCZKT2rpvRF3hPtkLmtiaVAIxQ0xj8tF7ZKJpFp7BkA,736
57
+ ormlambda/errors.py,sha256=ltLR52g3fnUTjrDC_x_R9-b5LlLjC6bVACnOoc9-OZg,839
58
+ ormlambda/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ ormlambda/model/base_model.py,sha256=lhtJWiGXiRWLOxsuPg0PPr53shhreMy69Ps2-7dYU7U,739
60
+ ormlambda/repository/__init__.py,sha256=4KAhKn6vWV7bslewvGMNqbbbUnz1DLnH4yy-M5QNAQA,112
61
+ ormlambda/repository/base_repository.py,sha256=SW7VsbNddIY8-ALIGYcLlj4tFAoPSepeQpFvDNMOWpg,1252
62
+ ormlambda/repository/interfaces/IDatabaseConnection.py,sha256=pxczjx0b53yjjg5hvVDloMgUTFDahVC3HlJLQjo9_1w,283
63
+ ormlambda/repository/interfaces/IRepositoryBase.py,sha256=jTlViARH5SWIcYXstmXhttvNOShJ5mmAbTEmfGLiRuA,3527
64
+ ormlambda/repository/interfaces/__init__.py,sha256=t8Mn0aRZm8uF4MGaqjEANTTADCdOwNF0THZ_qebyzwo,126
65
+ ormlambda/repository/response.py,sha256=ZCV3joh_IMtcAHR_JIhbOudRT5ejPyXBFrHsTJoTz9o,4729
66
+ ormlambda/sql/__init__.py,sha256=C5tpRVPZFnk8h1GSUkAM83u0M-IiOWtxrQSzD5DFZYU,211
67
+ ormlambda/sql/clause_info/__init__.py,sha256=tbDXMGPjIc1e4YpBycjmyh8gRFgqZLva6sH-9awsni4,98
68
+ ormlambda/sql/clause_info/clause_info.py,sha256=OnVyjDcisJK7-exFCgk7xqyXFGMTBMxzIXEg8RF56DI,14107
69
+ ormlambda/sql/clause_info/interface/IAggregate.py,sha256=wdaNxhRYrHqwknljvTEus5PDkt9MD0eufBmphFqsH-8,429
70
+ ormlambda/sql/clause_info/interface/IClauseInfo.py,sha256=vPJWSi6ojSIc931Z8BTYFHkFbSYpEiD5oIdtLby3fBc,820
71
+ ormlambda/sql/clause_info/interface/__init__.py,sha256=bTNYVMPuJebEvQpPa5LBQaAesGnfljQ8BKsj1UxN09k,100
72
+ ormlambda/sql/clauses/__init__.py,sha256=9bkgw3jbd2HdB-WGQtpyHLr0K-SbCZcBU7KmHur7k1c,572
73
+ ormlambda/sql/clauses/alias.py,sha256=EywUwSYTWFOptTEnJ3O6UqLw4IJyd7XXumPM4djbegU,340
74
+ ormlambda/sql/clauses/count.py,sha256=MpbnfNRiylDlL93d25s6XEqCMfgME6lZwF9H4A5iRv0,1034
75
+ ormlambda/sql/clauses/delete.py,sha256=tTSCcSD_F-z9rl4HwfJOeb_M_XJlg-LkyU3f6vVQNTc,2289
76
+ ormlambda/sql/clauses/group_by.py,sha256=wCPCBnre_XR93L_8_alnxOh8PqXyxr8hbZom373EiFo,569
77
+ ormlambda/sql/clauses/having.py,sha256=yvWKUxLPVBzbmI0D-dAkbRXkkEPa365TKQuAmov91XI,360
78
+ ormlambda/sql/clauses/insert.py,sha256=QwY_-StS7yzwoFLvvJQAG2mTx7luxyFk6j26Kwv9HCA,3832
79
+ ormlambda/sql/clauses/interfaces/IDelete.py,sha256=06ZEdbKBxsHSwsGMBu0E1om4WJjojZAm-L3b95eQrcc,139
80
+ ormlambda/sql/clauses/interfaces/IInsert.py,sha256=YIfMPlKu7UGgnVpZuhpr0Mtnefe-O85hqk8-GZrVK7w,139
81
+ ormlambda/sql/clauses/interfaces/IUpdate.py,sha256=U-3Wx8lyCglhxf9gCXWO3MVgydG6gfRpzp00_MHC5cU,168
82
+ ormlambda/sql/clauses/interfaces/IUpsert.py,sha256=2m6Bcwa0X80IDLnf0QErqr01uYEydOnRta9_T1nxjK4,139
83
+ ormlambda/sql/clauses/interfaces/__init__.py,sha256=amGsD84C2torwyZMMknv2GBuA2W16DB3HTuhAGIpYds,172
84
+ ormlambda/sql/clauses/join/__init__.py,sha256=7hwAB-nKaMirTT6uNZ1JtYNkkIx5zMSa6jaqr28d8Cg,67
85
+ ormlambda/sql/clauses/join/join_context.py,sha256=I3Z8l0EoDwVb6EnFacm7o2lkAPgzuYxP5mNhih78aSQ,3096
86
+ ormlambda/sql/clauses/joins.py,sha256=Lt0KbKC7aOFPzkerB2TUHsUKOdIsbCkIJCMktEn_XaA,4295
87
+ ormlambda/sql/clauses/limit.py,sha256=h3WuF4QV5_Pns3r7MzfZn_QtINdq6CEiCh30LLaeWKY,315
88
+ ormlambda/sql/clauses/offset.py,sha256=dGUVDUvvaLQJov8vYwImhwKgHjwud5eViRYs-kcvAtA,318
89
+ ormlambda/sql/clauses/order.py,sha256=Zpl_XxVViURrwl4LFw3ldvCh0OeGVjvGIPYurHQ8S9Q,1438
90
+ ormlambda/sql/clauses/select.py,sha256=-tViA_6Z-7WFJaILnUdX8AUmcwEarrO2e2HkGeIzRTg,2193
91
+ ormlambda/sql/clauses/update.py,sha256=LM6Cb9A31O93IvOxL80NLZuKPr9xFt65BpYejbqQKj8,3072
92
+ ormlambda/sql/clauses/upsert.py,sha256=1MlHSzIVXSnCnXx_0HqX_-JT1FAxaIKHImrv-OKjnWU,2250
93
+ ormlambda/sql/clauses/where.py,sha256=QRYuBstzVG0nlI87USE_hJyCqzSkZSwq7aSA0OAItbE,1255
94
+ ormlambda/sql/column/__init__.py,sha256=v5zXftkrFqpZeXVu_jtHKWHdmDYALVQelmxt52Fvs5E,93
95
+ ormlambda/sql/column/column.py,sha256=DLmfInvrdqMESy3C3zA_nY2-SSfk5iXzxtncy_lX-Pw,8352
96
+ ormlambda/sql/column/column_proxy.py,sha256=lyNmMIo-1j-bmwOofWas03H7_LKTzcYxEZyqsbR7WCM,4006
97
+ ormlambda/sql/column_table_proxy.py,sha256=h-cCakQjtHnrnO9NY_6oq0xOMH3fnNAvMeIDfd29ci8,450
98
+ ormlambda/sql/comparer.py,sha256=VUaS81ikBrK_R5rk5GgVqjWg_JzYgXtWmfGip1NFMzk,3967
99
+ ormlambda/sql/compiler.py,sha256=KaKiuAmuCluqWGQ69vYnm9laMBn1gmoIBtUULqNUuHA,22233
100
+ ormlambda/sql/context/__init__.py,sha256=0PkoZ0nk4dxw1275cyAEhlOHHE6jgyg7BrJJ_P1hG4E,10256
101
+ ormlambda/sql/ddl.py,sha256=LqIOLl5bfyyw07U96e6FQMbyQBbv7SjLd0uDc1gJpf8,1916
102
+ ormlambda/sql/elements.py,sha256=ijZiwi_CxSvr4LlgUJwTcyCDy28SZOsquNAQh6XKpd4,1016
103
+ ormlambda/sql/foreign_key.py,sha256=yaL8E7IOTm3OFChoWTsA4cQcMux6SdNiUzoGFaKy0Sk,4242
104
+ ormlambda/sql/functions/__init__.py,sha256=IDXpolE397LcpyYBvQ_r7QOa69cE5sk7FXPykt7XQk4,121
105
+ ormlambda/sql/functions/concat.py,sha256=78PhV9PBzlo7vRTOhZgZUoOR8-1aI_dexc_DFphHOtI,1291
106
+ ormlambda/sql/functions/max.py,sha256=TAoFIwfdA9m_Ml5xknDhDayHpnwAw5yxxGVIlEV6v0o,570
107
+ ormlambda/sql/functions/min.py,sha256=Q4_ZiyKOPdmE8pbBxO-EoCKTrqpc6cQk3yiWVw1pUzc,570
108
+ ormlambda/sql/functions/sum.py,sha256=pEN_Qxs5O9ANZlrYA0nN7qOZG7lUAWMu-jvYQSYGwLM,571
109
+ ormlambda/sql/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
+ ormlambda/sql/sqltypes.py,sha256=17ed054oGuDW9xvoA9fUggkcIj6z7XBWGRwkNI95nxo,14503
111
+ ormlambda/sql/table/__init__.py,sha256=ArH07tGHpC6uS4A4p63FdxbWufGQ0aM6TVnWLvTK62M,100
112
+ ormlambda/sql/table/fields.py,sha256=ovNR3bJ473aKW-2NhbKr0iJlVpgW06jurHLob2IyZU8,2116
113
+ ormlambda/sql/table/table.py,sha256=V0l1sCfqER-f4wEqGtLQdRld_MJ6fCU9vyP_KdWYOC4,5980
114
+ ormlambda/sql/table/table_constructor.py,sha256=c3Z-1El0onSClYBmAatoUBYUOT70tITVqtsDJMxZ9QU,1092
115
+ ormlambda/sql/table/table_proxy.py,sha256=pYASl4GOUcJRrdhEDCo1wFRMvPWZS8Fg43qWfBV0qQo,2931
116
+ ormlambda/sql/type_api.py,sha256=nR5NruI6kUHefcyjqmV_uxy3dM3McCWv3THg2NxXJH8,1217
117
+ ormlambda/sql/types.py,sha256=A1HI8HrANruuAPIfl7dbbTYx3l-SvuUbPrhlzK5SZ6w,1019
118
+ ormlambda/sql/visitors.py,sha256=AHXxCEOME8-b_-YhFEzBv-Jd15vSoX5F-jEGrPPNRLE,2052
119
+ ormlambda/statements/__init__.py,sha256=9IzRSVl-ZXD4D4RrrPIifOhyO0iXSpRS5ZwvVJeAW_0,49
120
+ ormlambda/statements/base_statement.py,sha256=M8h2IqMl3vQWGzjHftx0zMzp12FfOFktu1GLsj1KLpI,2741
121
+ ormlambda/statements/interfaces/IStatements.py,sha256=wTYEj8mBR21sU60ZMlHzaQehTy-knrqp3GT6n6l6HMU,9875
122
+ ormlambda/statements/interfaces/__init__.py,sha256=1EAWwBueWJ1lBG7pOAEae_Bqw6ww8s7Dnvq6LTUgUJM,51
123
+ ormlambda/statements/query_builder.py,sha256=MUTBvdlHuX6ZScyEjk4-bc6KtmpCht31NcBM1ATTyzI,10730
124
+ ormlambda/statements/statements.py,sha256=U638djJtOu8qIMNlNOhJXktkFaV-cIhTsaBqy_S19h8,12091
125
+ ormlambda/statements/types.py,sha256=Qh91CB3tzrqsxsPixib7w6KLRr6zY26pHXAna6MaDm8,885
126
+ ormlambda/types/__init__.py,sha256=xVFaIMcfJvbbXs8BAvmBh8FwSiLn2R6yjZs9o-h08XM,323
127
+ ormlambda/types/metadata.py,sha256=93eJItdVDOItf7YRJUVmN_m79WLa3Ge6I414ewYnKeM,624
128
+ ormlambda/util/__init__.py,sha256=qWD74xQtWGxa5HCuRX1VxUnRrJ8Q5WxGo3R4_xpuRM8,349
129
+ ormlambda/util/langhelpers.py,sha256=84JqxrH6fEE3FbQxy-Vc-C1TofIc5yuIkZT8HxS94o8,3284
130
+ ormlambda/util/module_tree/__init__.py,sha256=LNQtqkwO1ul49Th3aHAIiyt0Wt899GmXCc44Uz1eDyY,53
131
+ ormlambda/util/module_tree/dfs_traversal.py,sha256=lSF03G63XtJFLp03ueAmsHMBvhUkjptDbK3IugXm8iU,1425
132
+ ormlambda/util/module_tree/dynamic_module.py,sha256=SQ1FZW2Es5CdACD0VS8v_UZQTuFYbUWs6diAtMbKMoA,8699
133
+ ormlambda/util/preloaded.py,sha256=1D7t25qPjhW44nRez4Sd40gLjrl6BctLhPfPsK6Dx5g,3064
134
+ ormlambda/util/typing.py,sha256=py6FbOLvnuByR8IHgKIIReFM0efX6Bzz-Ick9fx-nuw,423
135
+ ormlambda-4.0.4.dist-info/AUTHORS,sha256=uWpOHaCPTOLbVkk5x9McoLwbgzSeCg7yILeDRyMGWGM,606
136
+ ormlambda-4.0.4.dist-info/LICENSE,sha256=xBprFw8GJLdHMOoUqDk0427EvjIcbEREvXXVFULuuXU,1080
137
+ ormlambda-4.0.4.dist-info/METADATA,sha256=q-8Wzvr-9NpPcQKKsrh4-QBaxSIHDtpygG8bgmcZhxo,12466
138
+ ormlambda-4.0.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
139
+ ormlambda-4.0.4.dist-info/RECORD,,
@@ -1,65 +0,0 @@
1
- from __future__ import annotations
2
- import typing as tp
3
- from ormlambda import Table
4
-
5
- from ormlambda.sql.clause_info import ClauseInfo, AggregateFunctionBase
6
- from ormlambda.sql.clause_info.clause_info_context import ClauseContextType
7
- from ormlambda import ForeignKey
8
-
9
- from ormlambda.sql.types import AliasType, TableType, ColumnType
10
-
11
-
12
- class ClauseInfoConverter[T, TProp](tp.Protocol):
13
- @classmethod
14
- def convert(cls, data: T, alias_table: AliasType[ColumnType[TProp]] = "{table}", context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[T]]: ...
15
-
16
-
17
- class ConvertFromAnyType(ClauseInfoConverter[None, None]):
18
- @classmethod
19
- def convert(cls, data: tp.Any, alias_table: AliasType = "{table}", context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[None]]:
20
- return [ClauseInfo[None](table=None, column=data, alias_table=alias_table, alias_clause=kwargs.get("alias", None), context=context, **kwargs)]
21
-
22
-
23
- class ConvertFromForeignKey[LT: Table, RT: Table](ClauseInfoConverter[RT, None]):
24
- @classmethod
25
- def convert(cls, data: ForeignKey[LT, RT], alias_table=None, context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[RT]]:
26
- return ConvertFromTable[RT].convert(data.tright, data.get_alias(kwargs["dialect"]), context, **kwargs)
27
-
28
-
29
- class ConvertFromColumn[TProp](ClauseInfoConverter[None, TProp]):
30
- @classmethod
31
- def convert(cls, data: ColumnType[TProp], alias_table: AliasType[ColumnType[TProp]] = "{table}", context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[None]]:
32
- # COMMENT: if the property belongs to the main class, the columnn name in not prefixed. This only done if the property comes from any join.
33
- attributes = {
34
- "table": data.table,
35
- "column": data,
36
- "alias_table": alias_table,
37
- "alias_clause": "{table}_{column}",
38
- "context": context,
39
- }
40
- attributes.update(**kwargs)
41
- clause_info = ClauseInfo(**attributes)
42
- return [clause_info]
43
-
44
-
45
- class ConvertFromIAggregate(ClauseInfoConverter[None, None]):
46
- @classmethod
47
- def convert(cls, data: AggregateFunctionBase, alias_table=None, context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[None]]:
48
- return [data]
49
-
50
-
51
- class ConvertFromTable[T: Table](ClauseInfoConverter[T, None]):
52
- @classmethod
53
- def convert(cls, data: T, alias_table: AliasType[ColumnType] = "{table}", context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[T]]:
54
- """
55
- if the data is Table, means that we want to retrieve all columns
56
- """
57
- return cls._extract_all_clauses(data, alias_table, context, **kwargs)
58
-
59
- @staticmethod
60
- def _extract_all_clauses(table: TableType[T], alias_table: AliasType[ColumnType], context: ClauseContextType = None, **kwargs) -> list[ClauseInfo[TableType[T]]]:
61
- # all columns
62
- column_clauses = []
63
- for column in table.get_columns():
64
- column_clauses.extend(ConvertFromColumn.convert(column, alias_table=alias_table, context=context, **kwargs))
65
- return column_clauses