ormlambda 3.35.2__tar.gz → 4.0.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-3.35.2 → ormlambda-4.0.0}/PKG-INFO +29 -31
- {ormlambda-3.35.2 → ormlambda-4.0.0}/README.md +28 -30
- {ormlambda-3.35.2 → ormlambda-4.0.0}/pyproject.toml +1 -1
- ormlambda-4.0.0/src/ormlambda/__init__.py +87 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/caster/caster.py +6 -1
- ormlambda-4.0.0/src/ormlambda/common/abstract_classes/__init__.py +1 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/enums/__init__.py +1 -0
- ormlambda-4.0.0/src/ormlambda/common/enums/order_type.py +9 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/errors/__init__.py +13 -3
- ormlambda-4.0.0/src/ormlambda/common/global_checker.py +106 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/interfaces/IQueryCommand.py +2 -2
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/interfaces/__init__.py +0 -2
- ormlambda-3.35.2/src/ormlambda/dialects/interface/dialect.py → ormlambda-4.0.0/src/ormlambda/dialects/__init__.py +34 -1
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/default/base.py +1 -1
- ormlambda-4.0.0/src/ormlambda/dialects/mysql/__init__.py +41 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/mysql/base.py +226 -40
- ormlambda-4.0.0/src/ormlambda/dialects/mysql/clauses/ST_AsText.py +26 -0
- ormlambda-4.0.0/src/ormlambda/dialects/mysql/clauses/ST_Contains.py +30 -0
- ormlambda-4.0.0/src/ormlambda/dialects/mysql/clauses/__init__.py +1 -0
- ormlambda-4.0.0/src/ormlambda/dialects/mysql/repository/__init__.py +1 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql/repository}/repository.py +0 -5
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/mysql/types.py +6 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/engine/base.py +26 -4
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/errors.py +9 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/model/base_model.py +3 -10
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/base_repository.py +1 -1
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/interfaces/IRepositoryBase.py +0 -7
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/response.py +12 -7
- ormlambda-4.0.0/src/ormlambda/sql/__init__.py +12 -0
- ormlambda-4.0.0/src/ormlambda/sql/clause_info/__init__.py +2 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clause_info/clause_info.py +94 -76
- ormlambda-4.0.0/src/ormlambda/sql/clause_info/interface/IAggregate.py +20 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clause_info/interface/IClauseInfo.py +6 -11
- ormlambda-4.0.0/src/ormlambda/sql/clauses/alias.py +14 -0
- ormlambda-4.0.0/src/ormlambda/sql/clauses/count.py +42 -0
- ormlambda-4.0.0/src/ormlambda/sql/clauses/group_by.py +24 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/having.py +2 -6
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/insert.py +3 -3
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/interfaces/__init__.py +0 -1
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/join/join_context.py +5 -12
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/joins.py +34 -52
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/limit.py +1 -2
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/offset.py +1 -2
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/order.py +17 -21
- ormlambda-4.0.0/src/ormlambda/sql/clauses/select.py +79 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/update.py +13 -10
- ormlambda-4.0.0/src/ormlambda/sql/clauses/where.py +46 -0
- ormlambda-4.0.0/src/ormlambda/sql/column/__init__.py +2 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/column/column.py +19 -12
- ormlambda-4.0.0/src/ormlambda/sql/column/column_proxy.py +117 -0
- ormlambda-4.0.0/src/ormlambda/sql/column_table_proxy.py +23 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/comparer.py +31 -65
- ormlambda-4.0.0/src/ormlambda/sql/compiler.py +617 -0
- ormlambda-4.0.0/src/ormlambda/sql/context/__init__.py +304 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/ddl.py +19 -5
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/elements.py +3 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/foreign_key.py +42 -64
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/functions/__init__.py +0 -1
- ormlambda-4.0.0/src/ormlambda/sql/functions/concat.py +45 -0
- ormlambda-4.0.0/src/ormlambda/sql/functions/max.py +24 -0
- ormlambda-4.0.0/src/ormlambda/sql/functions/min.py +24 -0
- ormlambda-4.0.0/src/ormlambda/sql/functions/sum.py +25 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/sqltypes.py +2 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/table/__init__.py +1 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/table/table.py +32 -49
- ormlambda-4.0.0/src/ormlambda/sql/table/table_proxy.py +88 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/type_api.py +4 -1
- ormlambda-4.0.0/src/ormlambda/sql/types.py +30 -0
- ormlambda-4.0.0/src/ormlambda/statements/__init__.py +1 -0
- ormlambda-4.0.0/src/ormlambda/statements/base_statement.py +90 -0
- ormlambda-4.0.0/src/ormlambda/statements/interfaces/IStatements.py +299 -0
- ormlambda-4.0.0/src/ormlambda/statements/interfaces/__init__.py +1 -0
- ormlambda-4.0.0/src/ormlambda/statements/query_builder.py +331 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/statements/statements.py +120 -110
- ormlambda-4.0.0/src/ormlambda/statements/types.py +37 -0
- ormlambda-4.0.0/src/ormlambda/util/__init__.py +9 -0
- ormlambda-3.35.2/src/ormlambda/util/__init__.py → ormlambda-4.0.0/src/ormlambda/util/langhelpers.py +30 -16
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/util/module_tree/dynamic_module.py +1 -1
- ormlambda-4.0.0/src/ormlambda/util/preloaded.py +80 -0
- ormlambda-4.0.0/src/ormlambda/util/typing.py +15 -0
- ormlambda-3.35.2/src/ormlambda/__init__.py +0 -59
- ormlambda-3.35.2/src/ormlambda/common/abstract_classes/__init__.py +0 -3
- ormlambda-3.35.2/src/ormlambda/common/abstract_classes/clause_info_converter.py +0 -65
- ormlambda-3.35.2/src/ormlambda/common/abstract_classes/decomposition_query.py +0 -141
- ormlambda-3.35.2/src/ormlambda/common/abstract_classes/query_base.py +0 -15
- ormlambda-3.35.2/src/ormlambda/common/global_checker.py +0 -28
- ormlambda-3.35.2/src/ormlambda/common/interfaces/ICustomAlias.py +0 -7
- ormlambda-3.35.2/src/ormlambda/common/interfaces/IDecompositionQuery.py +0 -33
- ormlambda-3.35.2/src/ormlambda/databases/__init__.py +0 -4
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/__init__.py +0 -3
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/ST_AsText.py +0 -37
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/ST_Contains.py +0 -36
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/__init__.py +0 -14
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/count.py +0 -33
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/delete.py +0 -9
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/drop_table.py +0 -26
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/group_by.py +0 -17
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/having.py +0 -12
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/insert.py +0 -9
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/joins.py +0 -14
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/limit.py +0 -6
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/offset.py +0 -6
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/order.py +0 -8
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/update.py +0 -8
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/upsert.py +0 -9
- ormlambda-3.35.2/src/ormlambda/databases/my_sql/clauses/where.py +0 -7
- ormlambda-3.35.2/src/ormlambda/dialects/__init__.py +0 -39
- ormlambda-3.35.2/src/ormlambda/dialects/interface/__init__.py +0 -1
- ormlambda-3.35.2/src/ormlambda/dialects/mysql/__init__.py +0 -84
- ormlambda-3.35.2/src/ormlambda/sql/__init__.py +0 -3
- ormlambda-3.35.2/src/ormlambda/sql/clause_info/__init__.py +0 -4
- ormlambda-3.35.2/src/ormlambda/sql/clause_info/aggregate_function_base.py +0 -96
- ormlambda-3.35.2/src/ormlambda/sql/clause_info/clause_info_context.py +0 -87
- ormlambda-3.35.2/src/ormlambda/sql/clause_info/interface/IAggregate.py +0 -10
- ormlambda-3.35.2/src/ormlambda/sql/clauses/alias.py +0 -45
- ormlambda-3.35.2/src/ormlambda/sql/clauses/count.py +0 -57
- ormlambda-3.35.2/src/ormlambda/sql/clauses/group_by.py +0 -30
- ormlambda-3.35.2/src/ormlambda/sql/clauses/interfaces/ISelect.py +0 -17
- ormlambda-3.35.2/src/ormlambda/sql/clauses/new_join.py +0 -119
- ormlambda-3.35.2/src/ormlambda/sql/clauses/select.py +0 -51
- ormlambda-3.35.2/src/ormlambda/sql/clauses/where.py +0 -65
- ormlambda-3.35.2/src/ormlambda/sql/column/__init__.py +0 -1
- ormlambda-3.35.2/src/ormlambda/sql/compiler.py +0 -427
- ormlambda-3.35.2/src/ormlambda/sql/functions/concat.py +0 -48
- ormlambda-3.35.2/src/ormlambda/sql/functions/max.py +0 -48
- ormlambda-3.35.2/src/ormlambda/sql/functions/min.py +0 -39
- ormlambda-3.35.2/src/ormlambda/sql/functions/sum.py +0 -41
- ormlambda-3.35.2/src/ormlambda/sql/types.py +0 -27
- ormlambda-3.35.2/src/ormlambda/statements/__init__.py +0 -3
- ormlambda-3.35.2/src/ormlambda/statements/base_statement.py +0 -123
- ormlambda-3.35.2/src/ormlambda/statements/interfaces/IStatements.py +0 -345
- ormlambda-3.35.2/src/ormlambda/statements/interfaces/__init__.py +0 -1
- ormlambda-3.35.2/src/ormlambda/statements/query_builder.py +0 -163
- ormlambda-3.35.2/src/ormlambda/statements/types.py +0 -57
- ormlambda-3.35.2/src/ormlambda/util/load_module.py +0 -21
- ormlambda-3.35.2/src/ormlambda/util/plugin_loader.py +0 -32
- ormlambda-3.35.2/src/ormlambda/util/typing.py +0 -6
- {ormlambda-3.35.2 → ormlambda-4.0.0}/AUTHORS +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/LICENSE +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/caster/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/caster/base_caster.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/caster/interfaces/ICaster.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/caster/interfaces/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/abstract_classes/non_query_base.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/enums/condition_types.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/enums/join_type.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/interfaces/IJoinSelector.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/common/interfaces/INonQueryCommand.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/default/__init__.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/__init__.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/caster.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/__init__.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/boolean.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/bytes.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/date.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/datetime.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/decimal.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/float.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/int.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/iterable.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/json.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/none.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/point.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql}/caster/types/string.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/mysql/mysqlconnector.py +0 -0
- {ormlambda-3.35.2/src/ormlambda/databases/my_sql → ormlambda-4.0.0/src/ormlambda/dialects/mysql/repository}/pool_types.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/sqlite/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/sqlite/base.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/dialects/sqlite/pysqlite.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/engine/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/engine/create.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/engine/url.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/engine/utils.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/env.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/model/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/interfaces/IDatabaseConnection.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/repository/interfaces/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clause_info/interface/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/delete.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/interfaces/IDelete.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/interfaces/IInsert.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/interfaces/IUpdate.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/interfaces/IUpsert.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/join/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/clauses/upsert.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/interfaces/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/table/fields.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/table/table_constructor.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/sql/visitors.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/types/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/types/metadata.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/util/module_tree/__init__.py +0 -0
- {ormlambda-3.35.2 → ormlambda-4.0.0}/src/ormlambda/util/module_tree/dfs_traversal.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ormlambda
|
3
|
-
Version:
|
3
|
+
Version: 4.0.0
|
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
|
@@ -296,19 +296,19 @@ with this approach, we will obtain a dictionary where the key will be the concat
|
|
296
296
|
|
297
297
|
## max
|
298
298
|
```python
|
299
|
-
res = AddressModel.max(
|
299
|
+
res = AddressModel.max(lambda x: x.address_id)
|
300
300
|
```
|
301
301
|
## min
|
302
302
|
```python
|
303
|
-
res = AddressModel.min(
|
303
|
+
res = AddressModel.min(lambda x: x.address_id)
|
304
304
|
```
|
305
305
|
## sum
|
306
306
|
```python
|
307
|
-
res = AddressModel.sum(
|
307
|
+
res = AddressModel.sum(lambda x: x.address_id)
|
308
308
|
```
|
309
309
|
## count
|
310
310
|
```python
|
311
|
-
res = AddressModel.count(
|
311
|
+
res = AddressModel.count(lambda x: x.address_id)
|
312
312
|
```
|
313
313
|
|
314
314
|
## 1. Concat
|
@@ -322,14 +322,14 @@ response = ORM(Address, db).where(Address.City.Country.country.regex(r"^Spain"))
|
|
322
322
|
(
|
323
323
|
Address.address,
|
324
324
|
Address.City.city,
|
325
|
-
|
325
|
+
Concat(lambda x:
|
326
326
|
(
|
327
327
|
"Address: ",
|
328
|
-
|
328
|
+
x.address,
|
329
329
|
" - city: ",
|
330
|
-
|
330
|
+
x.City.city,
|
331
331
|
" - country: ",
|
332
|
-
|
332
|
+
x.City.Country.country,
|
333
333
|
)
|
334
334
|
),
|
335
335
|
),
|
@@ -364,15 +364,13 @@ class Response(BaseModel):
|
|
364
364
|
engine= create_engine(DATABASE_URL)
|
365
365
|
model = ORM(Address,engine)
|
366
366
|
|
367
|
-
count_name = Column(column_name="count")
|
368
|
-
|
369
367
|
res = (
|
370
368
|
self.model
|
371
|
-
.groupby(
|
372
|
-
.select(
|
369
|
+
.groupby(lambda x: x.district)
|
370
|
+
.select(lambda x:
|
373
371
|
(
|
374
|
-
|
375
|
-
|
372
|
+
x.district,
|
373
|
+
Count(x.address),
|
376
374
|
),
|
377
375
|
flavour=Response,
|
378
376
|
)
|
@@ -387,12 +385,12 @@ The `having` method is used to filter results based on aggregate functions. It i
|
|
387
385
|
```python
|
388
386
|
res = (
|
389
387
|
model
|
390
|
-
.groupby(
|
391
|
-
.having(
|
392
|
-
.select(
|
388
|
+
.groupby(lambda x: x.district)
|
389
|
+
.having(lambda x: x.count > 4)
|
390
|
+
.select(lambda x:
|
393
391
|
(
|
394
|
-
|
395
|
-
|
392
|
+
x.district,
|
393
|
+
Count(x.address),
|
396
394
|
),
|
397
395
|
flavour=Response,
|
398
396
|
)
|
@@ -422,9 +420,9 @@ select = (
|
|
422
420
|
ORM(Address, db)
|
423
421
|
.order(lambda x: x.City.Country.country, "DESC")
|
424
422
|
.limit(10)
|
425
|
-
.where(
|
426
|
-
.first(
|
427
|
-
|
423
|
+
.where(lambda x: x.City.Country.country == "Spain")
|
424
|
+
.first(lambda x:
|
425
|
+
(
|
428
426
|
x.address,
|
429
427
|
x.City.city,
|
430
428
|
x.City.Country.country,
|
@@ -449,9 +447,9 @@ As shown in the previous examples, setting the `execute` attribute to `True` all
|
|
449
447
|
```python
|
450
448
|
result = AddressModel.select_one(
|
451
449
|
lambda x: (
|
452
|
-
|
453
|
-
|
454
|
-
|
450
|
+
Min(x.address_id),
|
451
|
+
Max(x.address_id),
|
452
|
+
Count(x.address_id),
|
455
453
|
),flavour=dict
|
456
454
|
)
|
457
455
|
```
|
@@ -468,11 +466,11 @@ Getting something like
|
|
468
466
|
You also can use custom alias for each method
|
469
467
|
|
470
468
|
```python
|
471
|
-
AddressModel.select_one(
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
469
|
+
AddressModel.select_one(lambda x:
|
470
|
+
(
|
471
|
+
Min(x.address_id),
|
472
|
+
Max(x.address_id, alias="custom-max"),
|
473
|
+
Count(x.address_id),
|
476
474
|
),
|
477
475
|
flavour=dict,
|
478
476
|
)
|
@@ -283,19 +283,19 @@ with this approach, we will obtain a dictionary where the key will be the concat
|
|
283
283
|
|
284
284
|
## max
|
285
285
|
```python
|
286
|
-
res = AddressModel.max(
|
286
|
+
res = AddressModel.max(lambda x: x.address_id)
|
287
287
|
```
|
288
288
|
## min
|
289
289
|
```python
|
290
|
-
res = AddressModel.min(
|
290
|
+
res = AddressModel.min(lambda x: x.address_id)
|
291
291
|
```
|
292
292
|
## sum
|
293
293
|
```python
|
294
|
-
res = AddressModel.sum(
|
294
|
+
res = AddressModel.sum(lambda x: x.address_id)
|
295
295
|
```
|
296
296
|
## count
|
297
297
|
```python
|
298
|
-
res = AddressModel.count(
|
298
|
+
res = AddressModel.count(lambda x: x.address_id)
|
299
299
|
```
|
300
300
|
|
301
301
|
## 1. Concat
|
@@ -309,14 +309,14 @@ response = ORM(Address, db).where(Address.City.Country.country.regex(r"^Spain"))
|
|
309
309
|
(
|
310
310
|
Address.address,
|
311
311
|
Address.City.city,
|
312
|
-
|
312
|
+
Concat(lambda x:
|
313
313
|
(
|
314
314
|
"Address: ",
|
315
|
-
|
315
|
+
x.address,
|
316
316
|
" - city: ",
|
317
|
-
|
317
|
+
x.City.city,
|
318
318
|
" - country: ",
|
319
|
-
|
319
|
+
x.City.Country.country,
|
320
320
|
)
|
321
321
|
),
|
322
322
|
),
|
@@ -351,15 +351,13 @@ class Response(BaseModel):
|
|
351
351
|
engine= create_engine(DATABASE_URL)
|
352
352
|
model = ORM(Address,engine)
|
353
353
|
|
354
|
-
count_name = Column(column_name="count")
|
355
|
-
|
356
354
|
res = (
|
357
355
|
self.model
|
358
|
-
.groupby(
|
359
|
-
.select(
|
356
|
+
.groupby(lambda x: x.district)
|
357
|
+
.select(lambda x:
|
360
358
|
(
|
361
|
-
|
362
|
-
|
359
|
+
x.district,
|
360
|
+
Count(x.address),
|
363
361
|
),
|
364
362
|
flavour=Response,
|
365
363
|
)
|
@@ -374,12 +372,12 @@ The `having` method is used to filter results based on aggregate functions. It i
|
|
374
372
|
```python
|
375
373
|
res = (
|
376
374
|
model
|
377
|
-
.groupby(
|
378
|
-
.having(
|
379
|
-
.select(
|
375
|
+
.groupby(lambda x: x.district)
|
376
|
+
.having(lambda x: x.count > 4)
|
377
|
+
.select(lambda x:
|
380
378
|
(
|
381
|
-
|
382
|
-
|
379
|
+
x.district,
|
380
|
+
Count(x.address),
|
383
381
|
),
|
384
382
|
flavour=Response,
|
385
383
|
)
|
@@ -409,9 +407,9 @@ select = (
|
|
409
407
|
ORM(Address, db)
|
410
408
|
.order(lambda x: x.City.Country.country, "DESC")
|
411
409
|
.limit(10)
|
412
|
-
.where(
|
413
|
-
.first(
|
414
|
-
|
410
|
+
.where(lambda x: x.City.Country.country == "Spain")
|
411
|
+
.first(lambda x:
|
412
|
+
(
|
415
413
|
x.address,
|
416
414
|
x.City.city,
|
417
415
|
x.City.Country.country,
|
@@ -436,9 +434,9 @@ As shown in the previous examples, setting the `execute` attribute to `True` all
|
|
436
434
|
```python
|
437
435
|
result = AddressModel.select_one(
|
438
436
|
lambda x: (
|
439
|
-
|
440
|
-
|
441
|
-
|
437
|
+
Min(x.address_id),
|
438
|
+
Max(x.address_id),
|
439
|
+
Count(x.address_id),
|
442
440
|
),flavour=dict
|
443
441
|
)
|
444
442
|
```
|
@@ -455,11 +453,11 @@ Getting something like
|
|
455
453
|
You also can use custom alias for each method
|
456
454
|
|
457
455
|
```python
|
458
|
-
AddressModel.select_one(
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
456
|
+
AddressModel.select_one(lambda x:
|
457
|
+
(
|
458
|
+
Min(x.address_id),
|
459
|
+
Max(x.address_id, alias="custom-max"),
|
460
|
+
Count(x.address_id),
|
463
461
|
),
|
464
462
|
flavour=dict,
|
465
463
|
)
|
@@ -3,7 +3,7 @@ line-length = 320
|
|
3
3
|
|
4
4
|
[tool.poetry]
|
5
5
|
name = "ormlambda"
|
6
|
-
version = "
|
6
|
+
version = "4.0.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"
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# COMMENT: Necesary to load all variables inside ormalambda.env
|
2
|
+
import ormlambda.env # noqa: F401
|
3
|
+
|
4
|
+
# region enums
|
5
|
+
from .common.enums import JoinType as JoinType
|
6
|
+
from .common.enums import ConditionType as ConditionType
|
7
|
+
from .common.enums import OrderType as OrderType
|
8
|
+
|
9
|
+
|
10
|
+
# endregion
|
11
|
+
|
12
|
+
# region sql
|
13
|
+
from .sql import Column as Column
|
14
|
+
from .sql import ColumnProxy as ColumnProxy
|
15
|
+
from .sql import Table as Table
|
16
|
+
from .sql import ForeignKey as ForeignKey
|
17
|
+
from .sql import TableProxy as TableProxy
|
18
|
+
|
19
|
+
|
20
|
+
# endregion
|
21
|
+
|
22
|
+
from .repository import BaseRepository as BaseRepository
|
23
|
+
|
24
|
+
from .model.base_model import BaseModel as BaseModel
|
25
|
+
from .model.base_model import ORM as ORM
|
26
|
+
# COMMENT: to avoid relative import we need to import BaseModel after import Table,Column, ForeignKey, IRepositoryBase and Disassembler
|
27
|
+
|
28
|
+
from .engine import create_engine as create_engine
|
29
|
+
from .engine import URL as URL
|
30
|
+
from .engine import make_url as make_url
|
31
|
+
|
32
|
+
from .sql.sqltypes import JSON as JSON
|
33
|
+
from .sql.sqltypes import UUID as UUID
|
34
|
+
from .sql.sqltypes import NullType as NullType
|
35
|
+
from .sql.sqltypes import INTEGER as INTEGER
|
36
|
+
from .sql.sqltypes import INT as INT
|
37
|
+
from .sql.sqltypes import SMALLINTEGER as SMALLINTEGER
|
38
|
+
from .sql.sqltypes import BIGINTEGER as BIGINTEGER
|
39
|
+
from .sql.sqltypes import NUMERIC as NUMERIC
|
40
|
+
from .sql.sqltypes import FLOAT as FLOAT
|
41
|
+
from .sql.sqltypes import REAL as REAL
|
42
|
+
from .sql.sqltypes import DOUBLE as DOUBLE
|
43
|
+
from .sql.sqltypes import DECIMAL as DECIMAL
|
44
|
+
from .sql.sqltypes import STRING as STRING
|
45
|
+
from .sql.sqltypes import TEXT as TEXT
|
46
|
+
from .sql.sqltypes import UNICODE as UNICODE
|
47
|
+
from .sql.sqltypes import UNICODETEXT as UNICODETEXT
|
48
|
+
from .sql.sqltypes import CHAR as CHAR
|
49
|
+
from .sql.sqltypes import NCHAR as NCHAR
|
50
|
+
from .sql.sqltypes import BLOB as BLOB
|
51
|
+
from .sql.sqltypes import VARCHAR as VARCHAR
|
52
|
+
from .sql.sqltypes import NVARCHAR as NVARCHAR
|
53
|
+
from .sql.sqltypes import DATE as DATE
|
54
|
+
from .sql.sqltypes import TIME as TIME
|
55
|
+
from .sql.sqltypes import DATETIME as DATETIME
|
56
|
+
from .sql.sqltypes import TIMESTAMP as TIMESTAMP
|
57
|
+
from .sql.sqltypes import BOOLEAN as BOOLEAN
|
58
|
+
from .sql.sqltypes import LARGEBINARY as LARGEBINARY
|
59
|
+
from .sql.sqltypes import VARBINARY as VARBINARY
|
60
|
+
from .sql.sqltypes import ENUM as ENUM
|
61
|
+
from .sql.sqltypes import POINT as POINT
|
62
|
+
|
63
|
+
|
64
|
+
from .sql.clauses import Alias as Alias
|
65
|
+
from .sql.clauses import Count as Count
|
66
|
+
from .sql.clauses import Delete as Delete
|
67
|
+
from .sql.clauses import GroupBy as GroupBy
|
68
|
+
from .sql.clauses import Insert as Insert
|
69
|
+
from .sql.clauses import JoinSelector as JoinSelector
|
70
|
+
from .sql.clauses import Limit as Limit
|
71
|
+
from .sql.clauses import Offset as Offset
|
72
|
+
from .sql.clauses import Order as Order
|
73
|
+
from .sql.clauses import Select as Select
|
74
|
+
from .sql.clauses import Where as Where
|
75
|
+
from .sql.clauses import Having as Having
|
76
|
+
from .sql.clauses import Update as Update
|
77
|
+
from .sql.clauses import Upsert as Upsert
|
78
|
+
|
79
|
+
from .sql.functions import Max as Max
|
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
|
+
|
84
|
+
|
85
|
+
from . import util as _util
|
86
|
+
|
87
|
+
_util.import_prefix("ormlambda")
|
@@ -62,4 +62,9 @@ class Caster(ICaster):
|
|
62
62
|
column_type = type(value)
|
63
63
|
else:
|
64
64
|
column_type = type_value
|
65
|
-
|
65
|
+
|
66
|
+
caster_class = cls.CASTER_SELECTOR().get(column_type, None)
|
67
|
+
if not caster_class:
|
68
|
+
raise ValueError(f"'{column_type}' type has not a Caster class created.")
|
69
|
+
|
70
|
+
return caster_class(value, column_type)
|
@@ -0,0 +1 @@
|
|
1
|
+
from .non_query_base import NonQueryBase as NonQueryBase
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
2
2
|
import inspect
|
3
3
|
import typing as tp
|
4
4
|
|
5
|
+
from ormlambda import util
|
5
6
|
|
6
7
|
if tp.TYPE_CHECKING:
|
7
8
|
from ormlambda.sql.clause_info import ClauseInfo
|
@@ -35,16 +36,25 @@ class AggregateFunctionError[T](Exception):
|
|
35
36
|
agg_methods = self.__get_all_aggregate_method(self.clause)
|
36
37
|
return f"You cannot use aggregation method like '{agg_methods}' to return model objects. Try specifying 'flavour' attribute as 'dict'."
|
37
38
|
|
39
|
+
@util.preload_module("ormlambda.sql.clause_info")
|
38
40
|
def __get_all_aggregate_method(self, clauses: list[ClauseInfo]) -> str:
|
39
41
|
"""
|
40
|
-
Get the class name of those classes that inherit from '
|
42
|
+
Get the class name of those classes that inherit from 'IAggregate' class in order to create a better error message.
|
41
43
|
"""
|
42
|
-
from ormlambda.sql.clause_info import AggregateFunctionBase
|
43
44
|
|
45
|
+
IAggregate = util.preloaded.sql_clause_info.IAggregate
|
44
46
|
res: set[str] = set()
|
45
47
|
if not isinstance(clauses, tp.Iterable):
|
46
48
|
return clauses.__class__.__name__
|
47
49
|
for clause in clauses:
|
48
|
-
if isinstance(clause,
|
50
|
+
if isinstance(clause, IAggregate):
|
49
51
|
res.add(clause.__class__.__name__)
|
50
52
|
return ", ".join(res)
|
53
|
+
|
54
|
+
|
55
|
+
class NotCallableError(ValueError):
|
56
|
+
def __init__(self, *args):
|
57
|
+
super().__init__(*args)
|
58
|
+
|
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__}' "
|
@@ -0,0 +1,106 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
import re
|
3
|
+
from typing import Any, TYPE_CHECKING, Iterable, Callable
|
4
|
+
|
5
|
+
from ormlambda.common.errors import UnmatchedLambdaParameterError
|
6
|
+
from ormlambda.common.errors import NotCallableError
|
7
|
+
from ormlambda import util
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from ormlambda.sql.types import SelectCol # FIXME [ ]: enhance the name
|
11
|
+
from ormlambda import TableProxy
|
12
|
+
from ormlambda.sql.column import ColumnProxy
|
13
|
+
|
14
|
+
|
15
|
+
# type LambdaResponse[T] = TableProxy[T] | ColumnProxy[T] | Comparer
|
16
|
+
class GlobalChecker[T: TableProxy]:
|
17
|
+
FIRST_QUOTE = "`"
|
18
|
+
END_QUOTE = "`"
|
19
|
+
|
20
|
+
@staticmethod
|
21
|
+
def is_lambda_function(obj: Any) -> bool:
|
22
|
+
return callable(obj) and not isinstance(obj, type)
|
23
|
+
|
24
|
+
@util.preload_module("ormlambda.sql")
|
25
|
+
@classmethod
|
26
|
+
def resolved_callback_object(cls, table: T, lambda_func: Callable[[T], Any]) -> tuple[SelectCol, ...]:
|
27
|
+
TableProxy = util.preloaded.sql_table.TableProxy
|
28
|
+
|
29
|
+
try:
|
30
|
+
table_proxy = TableProxy(table)
|
31
|
+
|
32
|
+
if not callable(lambda_func):
|
33
|
+
raise NotCallableError(lambda_func)
|
34
|
+
|
35
|
+
if isinstance(lambda_func, Iterable):
|
36
|
+
# We hit that condition when trying to pass column or function dynamically into select clause.
|
37
|
+
|
38
|
+
# max_fn = Max(lambda x: x.Col1)
|
39
|
+
# min_fn = Min(lambda x: x.Col1)
|
40
|
+
# sum_fn = Sum(lambda x: x.Col1)
|
41
|
+
# result = self.model.select(
|
42
|
+
# (
|
43
|
+
# max_fn,
|
44
|
+
# min_fn,
|
45
|
+
# sum_fn,
|
46
|
+
# ),
|
47
|
+
# flavour=dict,
|
48
|
+
# )
|
49
|
+
|
50
|
+
response = []
|
51
|
+
|
52
|
+
for item in lambda_func:
|
53
|
+
response.append(item)
|
54
|
+
return response
|
55
|
+
|
56
|
+
response = lambda_func(table_proxy)
|
57
|
+
result = []
|
58
|
+
|
59
|
+
if isinstance(response, str) or not isinstance(response, Iterable):
|
60
|
+
response = [response]
|
61
|
+
|
62
|
+
for item in response:
|
63
|
+
column = cls.parser_object(item, table)
|
64
|
+
|
65
|
+
result.extend(column)
|
66
|
+
|
67
|
+
return result
|
68
|
+
|
69
|
+
except TypeError as err:
|
70
|
+
cond1 = r"takes \d+ positional argument but \d+ were given"
|
71
|
+
cond2 = r"missing \d+ required positional arguments:"
|
72
|
+
if re.search(r"(" + f"{cond1}|{cond2}" + r")", err.args[0]):
|
73
|
+
raise UnmatchedLambdaParameterError(len(table), lambda_func)
|
74
|
+
raise err
|
75
|
+
|
76
|
+
@util.preload_module(
|
77
|
+
"ormlambda.sql.column",
|
78
|
+
"ormlambda.sql.table",
|
79
|
+
"ormlambda.sql.comparer",
|
80
|
+
"ormlambda.sql.column_table_proxy",
|
81
|
+
)
|
82
|
+
@staticmethod
|
83
|
+
def parser_object(item: Any, table: T) -> tuple[ColumnProxy, ...]:
|
84
|
+
ColumnProxy = util.preloaded.sql_column.ColumnProxy
|
85
|
+
Column = util.preloaded.sql_column.Column
|
86
|
+
|
87
|
+
TableProxy = util.preloaded.sql_table.TableProxy
|
88
|
+
Comparer = util.preloaded.sql_comparer.Comparer
|
89
|
+
FKChain = util.preloaded.sql_column_table_proxy.FKChain
|
90
|
+
|
91
|
+
if isinstance(item, TableProxy):
|
92
|
+
return item.get_columns()
|
93
|
+
|
94
|
+
if isinstance(item, str):
|
95
|
+
# If we got a string, probably means that it'll be an alias,
|
96
|
+
# so we'll want to avoid add string alias table to alias like `address`.count
|
97
|
+
new_col = Column(dtype=str, column_name=item)
|
98
|
+
new_col.table = table
|
99
|
+
return [ColumnProxy(new_col, path=FKChain(table, None))]
|
100
|
+
if isinstance(item, Comparer):
|
101
|
+
return [item]
|
102
|
+
|
103
|
+
if isinstance(item, ColumnProxy):
|
104
|
+
return [item]
|
105
|
+
|
106
|
+
return [item]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from abc import
|
2
|
+
from abc import ABC
|
3
3
|
from typing import TYPE_CHECKING
|
4
4
|
|
5
5
|
if TYPE_CHECKING:
|
@@ -9,7 +9,7 @@ if TYPE_CHECKING:
|
|
9
9
|
class IQuery(ABC):
|
10
10
|
"""Interface to queries that retrieve any element such as select, limit, offset, where, group by, etc..."""
|
11
11
|
|
12
|
-
@abstractmethod
|
12
|
+
# @abstractmethod
|
13
13
|
def query(self, dialect: Dialect, **kwargs) -> str: ...
|
14
14
|
|
15
15
|
def __repr__(self) -> str:
|
@@ -1,5 +1,3 @@
|
|
1
|
-
from .ICustomAlias import ICustomAlias as ICustomAlias
|
2
|
-
from .IDecompositionQuery import IDecompositionQuery as IDecompositionQuery
|
3
1
|
from .IJoinSelector import IJoinSelector as IJoinSelector
|
4
2
|
from .INonQueryCommand import INonQueryCommand as INonQueryCommand
|
5
3
|
from .IQueryCommand import IQuery as IQuery
|
@@ -1,6 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
+
from typing import Callable, Optional, Type, TYPE_CHECKING, ClassVar
|
2
3
|
import abc
|
3
|
-
from
|
4
|
+
from ormlambda import util
|
5
|
+
import importlib
|
4
6
|
|
5
7
|
|
6
8
|
if TYPE_CHECKING:
|
@@ -76,3 +78,34 @@ class Dialect(abc.ABC):
|
|
76
78
|
|
77
79
|
def __repr__(self):
|
78
80
|
return f"{Dialect.__name__}: {type(self).__name__}"
|
81
|
+
|
82
|
+
|
83
|
+
def _auto_fn(name: str) -> Optional[Callable[[], Type[Dialect]]]:
|
84
|
+
"""default dialect importer.
|
85
|
+
|
86
|
+
plugs into the :class:`.PluginLoader`
|
87
|
+
as a first-hit system.
|
88
|
+
|
89
|
+
"""
|
90
|
+
if "." in name:
|
91
|
+
dialect, driver = name.split(".")
|
92
|
+
else:
|
93
|
+
dialect = name
|
94
|
+
driver = "base"
|
95
|
+
|
96
|
+
try:
|
97
|
+
module = importlib.import_module(f"ormlambda.dialects.{dialect}")
|
98
|
+
|
99
|
+
except ImportError:
|
100
|
+
return None
|
101
|
+
|
102
|
+
if hasattr(module, driver):
|
103
|
+
module = getattr(module, driver)
|
104
|
+
return lambda: module.dialect
|
105
|
+
else:
|
106
|
+
return None
|
107
|
+
|
108
|
+
|
109
|
+
registry = util.PluginLoader("ormlambda.dialects", auto_fn=_auto_fn)
|
110
|
+
|
111
|
+
__all__ = ("mysql", "sqlite")
|
@@ -0,0 +1,41 @@
|
|
1
|
+
from . import base as base
|
2
|
+
from . import mysqlconnector as mysqlconnector
|
3
|
+
|
4
|
+
from .base import BIGINT as BIGINT
|
5
|
+
from .base import BIT as BIT
|
6
|
+
from .base import BLOB as BLOB
|
7
|
+
from .base import BOOLEAN as BOOLEAN
|
8
|
+
from .base import CHAR as CHAR
|
9
|
+
from .base import DATE as DATE
|
10
|
+
from .base import DATETIME as DATETIME
|
11
|
+
from .base import DECIMAL as DECIMAL
|
12
|
+
from .base import DOUBLE as DOUBLE
|
13
|
+
from .base import FLOAT as FLOAT
|
14
|
+
from .base import INTEGER as INTEGER
|
15
|
+
from .base import LONGBLOB as LONGBLOB
|
16
|
+
from .base import LONGTEXT as LONGTEXT
|
17
|
+
from .base import MEDIUMBLOB as MEDIUMBLOB
|
18
|
+
from .base import MEDIUMINT as MEDIUMINT
|
19
|
+
from .base import MEDIUMTEXT as MEDIUMTEXT
|
20
|
+
from .base import NCHAR as NCHAR
|
21
|
+
from .base import NUMERIC as NUMERIC
|
22
|
+
from .base import NVARCHAR as NVARCHAR
|
23
|
+
from .base import REAL as REAL
|
24
|
+
from .base import SMALLINT as SMALLINT
|
25
|
+
from .base import TEXT as TEXT
|
26
|
+
from .base import TIME as TIME
|
27
|
+
from .base import TIMESTAMP as TIMESTAMP
|
28
|
+
from .base import TINYBLOB as TINYBLOB
|
29
|
+
from .base import TINYINT as TINYINT
|
30
|
+
from .base import TINYTEXT as TINYTEXT
|
31
|
+
from .base import VARBINARY as VARBINARY
|
32
|
+
from .base import VARCHAR as VARCHAR
|
33
|
+
from .base import YEAR as YEAR
|
34
|
+
from .types import POINT as POINT
|
35
|
+
|
36
|
+
|
37
|
+
from .repository import MySQLRepository as MySQLRepository # noqa: F401
|
38
|
+
from .caster import MySQLCaster as MySQLCaster # noqa: F401
|
39
|
+
|
40
|
+
# default dialect
|
41
|
+
base.dialect = dialect = mysqlconnector.dialect
|