matrx-orm 1.2.2__tar.gz → 1.2.3__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.
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/PKG-INFO +1 -1
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/pyproject.toml +1 -1
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/config.py +3 -1
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/columns.py +18 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/common.py +3 -3
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/schema.py +22 -2
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/tables.py +7 -1
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/.env.example +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/.github/workflows/publish.yml +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/.gitignore +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/.python-version +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/README.md +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/REFACTORING_SUMMARY.md +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/RESERVED_NAMES.md +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/main.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/adapters/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/adapters/base_adapter.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/adapters/postgresql.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/client/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/client/postgres_connection.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/constants.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/async_db_manager.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/base.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/expressions.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/extended.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/fields.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/registry.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/core/relations.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/error_handling.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/exceptions.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/extended/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/extended/app_error_handler.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/middleware/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/middleware/base.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/operations/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/operations/create.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/operations/delete.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/operations/read.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/operations/update.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/db_objects.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/table_detailed_relationships.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/table_typescript_relationship.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/query/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/query/builder.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/query/executor.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/generator.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/configs.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/git_checker.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/manager_dto_creator.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/manager_helpers.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/manual_overrides.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/relationships.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/views.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/parts_generators/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/parts_generators/entity_field_override_generator.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/parts_generators/entity_main_hook_generator.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/parts_generators/entity_override_generator.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/schema_manager.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/executor.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/queries.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/registry.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/types.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/sql_executor/utils.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/state.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/structure.md +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/utils/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/utils/sql_utils.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/utils/type_converters.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/database_project_config.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/generation_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/load_env_for_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/__init__.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/additional_tests.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/broker_manager_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/broker_manager_with_base.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/cache_management.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/core_model_tests.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/demo.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/junk.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/manager_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/recipe_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/relationship_trials.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/sample_test.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/orm_tests/test_error_handling.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/tests/query_executor.py +0 -0
- {matrx_orm-1.2.2 → matrx_orm-1.2.3}/uv.lock +0 -0
|
@@ -170,9 +170,11 @@ def get_code_config(db_project):
|
|
|
170
170
|
"temp_path": "models.py",
|
|
171
171
|
"root": ADMIN_PYTHON_ROOT,
|
|
172
172
|
"file_location": f"# File: database/{usable_name}/models.py",
|
|
173
|
+
# Note: import_lines are dynamically replaced by generate_models() in schema.py
|
|
174
|
+
# based on the actual field types used. This is a fallback default only.
|
|
173
175
|
"import_lines": [
|
|
174
176
|
"import database_registry",
|
|
175
|
-
"from matrx_orm import
|
|
177
|
+
"from matrx_orm import Model, model_registry, BaseDTO, BaseManager",
|
|
176
178
|
"from enum import Enum",
|
|
177
179
|
"from dataclasses import dataclass"
|
|
178
180
|
],
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/columns.py
RENAMED
|
@@ -791,6 +791,14 @@ class Column:
|
|
|
791
791
|
"blank": value.split("'")[1].strip(), # Extract timestamp with timezone
|
|
792
792
|
"generator": "formatTimestamptz()",
|
|
793
793
|
},
|
|
794
|
+
"::time without time zone": lambda value: {
|
|
795
|
+
"blank": value.split("'")[1].strip(), # Extract time value
|
|
796
|
+
"generator": "formatTime()",
|
|
797
|
+
},
|
|
798
|
+
"::time with time zone": lambda value: {
|
|
799
|
+
"blank": value.split("'")[1].strip(), # Extract time with timezone value
|
|
800
|
+
"generator": "formatTime()",
|
|
801
|
+
},
|
|
794
802
|
"::uuid": lambda uuid_value: {
|
|
795
803
|
"blank": uuid_value.split("'")[1].strip() if "'" in uuid_value else uuid_value.strip(),
|
|
796
804
|
"generator": "",
|
|
@@ -884,6 +892,10 @@ class Column:
|
|
|
884
892
|
elif value.startswith("ARRAY[]::") and value.endswith("[]"):
|
|
885
893
|
return {"blank": "[]", "generator": ""}
|
|
886
894
|
|
|
895
|
+
# Handle non-empty ARRAY[...] syntax: ARRAY['react'::text, 'lucide-react'::text, ...]
|
|
896
|
+
elif value.startswith("ARRAY["):
|
|
897
|
+
return {"blank": "[]", "generator": ""}
|
|
898
|
+
|
|
887
899
|
# Handle simple numeric defaults (no quotes, no casting)
|
|
888
900
|
# This includes integers, decimals, negative numbers, scientific notation
|
|
889
901
|
elif value.isdigit() or (value.startswith("-") and value[1:].replace(".", "", 1).isdigit()):
|
|
@@ -942,6 +954,12 @@ class Column:
|
|
|
942
954
|
vcprint(data=value, color="red")
|
|
943
955
|
return callable_outcomes["::timestamp with time zone"](value)
|
|
944
956
|
|
|
957
|
+
if value.endswith("::time without time zone"):
|
|
958
|
+
return callable_outcomes["::time without time zone"](value)
|
|
959
|
+
|
|
960
|
+
if value.endswith("::time with time zone"):
|
|
961
|
+
return callable_outcomes["::time with time zone"](value)
|
|
962
|
+
|
|
945
963
|
if value.endswith("::uuid"):
|
|
946
964
|
uuid_value = value.split("::")[0].strip("'") # Extract UUID without validation
|
|
947
965
|
return callable_outcomes["::uuid"](uuid_value)
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/schema.py
RENAMED
|
@@ -652,10 +652,19 @@ class Schema:
|
|
|
652
652
|
remaining_tables.remove(table_name)
|
|
653
653
|
|
|
654
654
|
py_structure = [self.get_string_user_model()]
|
|
655
|
+
all_field_types = {"UUIDField", "CharField", "Model"}
|
|
656
|
+
|
|
655
657
|
for table_name in sorted_tables:
|
|
656
658
|
table = self.tables[table_name]
|
|
657
659
|
py_table_entry = table.to_python_model()
|
|
658
660
|
py_structure.append(py_table_entry)
|
|
661
|
+
all_field_types.update(table.unique_field_types)
|
|
662
|
+
|
|
663
|
+
has_enums = any(
|
|
664
|
+
column.has_enum_labels
|
|
665
|
+
for table in self.tables.values()
|
|
666
|
+
for column in table.columns
|
|
667
|
+
)
|
|
659
668
|
|
|
660
669
|
py_manager_structure = []
|
|
661
670
|
py_auto_config_structure = []
|
|
@@ -690,8 +699,19 @@ class Schema:
|
|
|
690
699
|
print("python_models", get_code_config(self.database_project)["python_models"])
|
|
691
700
|
print("-----------------------------\n")
|
|
692
701
|
|
|
693
|
-
|
|
694
|
-
|
|
702
|
+
models_config = get_code_config(self.database_project)["python_models"]
|
|
703
|
+
sorted_field_types = sorted(all_field_types)
|
|
704
|
+
field_imports = ", ".join(sorted_field_types)
|
|
705
|
+
dynamic_import_lines = [
|
|
706
|
+
"import database_registry",
|
|
707
|
+
f"from matrx_orm import {field_imports}, model_registry, BaseDTO, BaseManager",
|
|
708
|
+
]
|
|
709
|
+
if has_enums:
|
|
710
|
+
dynamic_import_lines.append("from enum import Enum")
|
|
711
|
+
dynamic_import_lines.append("from dataclasses import dataclass")
|
|
712
|
+
models_config["import_lines"] = dynamic_import_lines
|
|
713
|
+
|
|
714
|
+
self.code_handler.generate_and_save_code_from_object(models_config, main_code, additional_code)
|
|
695
715
|
|
|
696
716
|
|
|
697
717
|
py_auto_config_code = "\n".join(py_auto_config_structure)
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/tables.py
RENAMED
|
@@ -1021,7 +1021,13 @@ class Table:
|
|
|
1021
1021
|
for column in self.columns:
|
|
1022
1022
|
py_field = column.to_python_model_field()
|
|
1023
1023
|
py_fields.append(py_field)
|
|
1024
|
-
|
|
1024
|
+
|
|
1025
|
+
if column.foreign_key_reference:
|
|
1026
|
+
self.unique_field_types.add("ForeignKey")
|
|
1027
|
+
elif column.has_enum_labels:
|
|
1028
|
+
self.unique_field_types.add("EnumField")
|
|
1029
|
+
else:
|
|
1030
|
+
self.unique_field_types.add(column.python_field_type)
|
|
1025
1031
|
|
|
1026
1032
|
if column.has_enum_labels:
|
|
1027
1033
|
py_enum_entry = column.set_python_enum_entry()
|
|
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
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/table_detailed_relationships.py
RENAMED
|
File without changes
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/python_sql/table_typescript_relationship.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
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/manager_dto_creator.py
RENAMED
|
File without changes
|
|
File without changes
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/helpers/manual_overrides.py
RENAMED
|
File without changes
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/individual_managers/views.py
RENAMED
|
File without changes
|
{matrx_orm-1.2.2 → matrx_orm-1.2.3}/src/matrx_orm/schema_builder/parts_generators/__init__.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
|