berryql 0.1.5__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.
Files changed (117) hide show
  1. berryql-0.1.5/CHANGELOG.md +30 -0
  2. berryql-0.1.5/CONTRIBUTING.md +190 -0
  3. berryql-0.1.5/LICENSE +21 -0
  4. berryql-0.1.5/MANIFEST.in +11 -0
  5. berryql-0.1.5/PKG-INFO +492 -0
  6. berryql-0.1.5/README.md +438 -0
  7. berryql-0.1.5/berryql/__init__.py +103 -0
  8. berryql-0.1.5/berryql/adapters/__init__.py +24 -0
  9. berryql-0.1.5/berryql/adapters/base.py +32 -0
  10. berryql-0.1.5/berryql/adapters/mssql.py +698 -0
  11. berryql-0.1.5/berryql/adapters/postgres.py +19 -0
  12. berryql-0.1.5/berryql/adapters/sqlite.py +29 -0
  13. berryql-0.1.5/berryql/core/__init__.py +11 -0
  14. berryql-0.1.5/berryql/core/analyzer.py +87 -0
  15. berryql-0.1.5/berryql/core/enum_utils.py +153 -0
  16. berryql-0.1.5/berryql/core/fields.py +423 -0
  17. berryql-0.1.5/berryql/core/filters.py +71 -0
  18. berryql-0.1.5/berryql/core/hydration.py +543 -0
  19. berryql-0.1.5/berryql/core/naming.py +97 -0
  20. berryql-0.1.5/berryql/core/selection.py +488 -0
  21. berryql-0.1.5/berryql/core/utils.py +359 -0
  22. berryql-0.1.5/berryql/mutations.py +1748 -0
  23. berryql-0.1.5/berryql/registry.py +5320 -0
  24. berryql-0.1.5/berryql/sql/builders.py +2353 -0
  25. berryql-0.1.5/berryql/sql/enum_helpers.py +111 -0
  26. berryql-0.1.5/berryql.egg-info/PKG-INFO +492 -0
  27. berryql-0.1.5/berryql.egg-info/SOURCES.txt +115 -0
  28. berryql-0.1.5/berryql.egg-info/dependency_links.txt +1 -0
  29. berryql-0.1.5/berryql.egg-info/requires.txt +28 -0
  30. berryql-0.1.5/berryql.egg-info/top_level.txt +1 -0
  31. berryql-0.1.5/examples/main.py +137 -0
  32. berryql-0.1.5/pyproject.toml +134 -0
  33. berryql-0.1.5/setup.cfg +4 -0
  34. berryql-0.1.5/tests/__init__.py +1 -0
  35. berryql-0.1.5/tests/conftest.py +147 -0
  36. berryql-0.1.5/tests/fixtures.py +210 -0
  37. berryql-0.1.5/tests/models.py +183 -0
  38. berryql-0.1.5/tests/schema.py +709 -0
  39. berryql-0.1.5/tests/test_adapters_matrix.py +25 -0
  40. berryql-0.1.5/tests/test_aggregate_counts.py +20 -0
  41. berryql-0.1.5/tests/test_aggregate_function.py +55 -0
  42. berryql-0.1.5/tests/test_arguments_mapping.py +52 -0
  43. berryql-0.1.5/tests/test_async_filter_args.py +17 -0
  44. berryql-0.1.5/tests/test_async_where.py +27 -0
  45. berryql-0.1.5/tests/test_backref_and_errors.py +46 -0
  46. berryql-0.1.5/tests/test_basic.py +30 -0
  47. berryql-0.1.5/tests/test_binary_array.py +23 -0
  48. berryql-0.1.5/tests/test_binary_array_graphql.py +38 -0
  49. berryql-0.1.5/tests/test_callable_where_pushdown.py +62 -0
  50. berryql-0.1.5/tests/test_camel_case.py +252 -0
  51. berryql-0.1.5/tests/test_context_gating.py +48 -0
  52. berryql-0.1.5/tests/test_custom_field.py +21 -0
  53. berryql-0.1.5/tests/test_custom_fields_inputs.py +23 -0
  54. berryql-0.1.5/tests/test_custom_object_field.py +42 -0
  55. berryql-0.1.5/tests/test_deep_nested_fallback.py +94 -0
  56. berryql-0.1.5/tests/test_default_arg_descriptions.py +55 -0
  57. berryql-0.1.5/tests/test_default_ordering.py +75 -0
  58. berryql-0.1.5/tests/test_domain_descriptions.py +52 -0
  59. berryql-0.1.5/tests/test_domain_native_strawberry_field.py +68 -0
  60. berryql-0.1.5/tests/test_domain_strawberry_fields.py +62 -0
  61. berryql-0.1.5/tests/test_domain_subscription_naming.py +35 -0
  62. berryql-0.1.5/tests/test_domain_type_scope.py +85 -0
  63. berryql-0.1.5/tests/test_domains.py +49 -0
  64. berryql-0.1.5/tests/test_enum_db_normalization.py +53 -0
  65. berryql-0.1.5/tests/test_execution_basic.py +12 -0
  66. berryql-0.1.5/tests/test_filters_arguments.py +54 -0
  67. berryql-0.1.5/tests/test_graphql_aliases_and_fragments.py +109 -0
  68. berryql-0.1.5/tests/test_graphql_descriptions.py +67 -0
  69. berryql-0.1.5/tests/test_graphql_mutation_descriptions.py +20 -0
  70. berryql-0.1.5/tests/test_jsonb.py +52 -0
  71. berryql-0.1.5/tests/test_multilevel_nesting.py +56 -0
  72. berryql-0.1.5/tests/test_mutation_and_subscription_strawberry.py +40 -0
  73. berryql-0.1.5/tests/test_mutation_batch.py +544 -0
  74. berryql-0.1.5/tests/test_mutation_batch_concurrent_issue.py +502 -0
  75. berryql-0.1.5/tests/test_mutation_delete.py +38 -0
  76. berryql-0.1.5/tests/test_mutation_domains.py +40 -0
  77. berryql-0.1.5/tests/test_mutation_hooks.py +140 -0
  78. berryql-0.1.5/tests/test_mutation_hooks_async.py +31 -0
  79. berryql-0.1.5/tests/test_mutation_nested.py +108 -0
  80. berryql-0.1.5/tests/test_mutation_parent_single_relation.py +38 -0
  81. berryql-0.1.5/tests/test_mutation_polymorphic_relation.py +36 -0
  82. berryql-0.1.5/tests/test_mutation_root_array_payload.py +26 -0
  83. berryql-0.1.5/tests/test_mutation_scope.py +197 -0
  84. berryql-0.1.5/tests/test_mutation_scope_descriptor.py +146 -0
  85. berryql-0.1.5/tests/test_mutation_single_payload.py +82 -0
  86. berryql-0.1.5/tests/test_mutation_single_payload_with_nested.py +28 -0
  87. berryql-0.1.5/tests/test_name_converter.py +65 -0
  88. berryql-0.1.5/tests/test_native_strawberry_field.py +101 -0
  89. berryql-0.1.5/tests/test_nested_domains.py +28 -0
  90. berryql-0.1.5/tests/test_nested_mutations.py +114 -0
  91. berryql-0.1.5/tests/test_nested_relations.py +52 -0
  92. berryql-0.1.5/tests/test_non_exposed_methods.py +53 -0
  93. berryql-0.1.5/tests/test_ordering.py +151 -0
  94. berryql-0.1.5/tests/test_pagination_pushdown.py +100 -0
  95. berryql-0.1.5/tests/test_parent_single_relation_mutation.py +38 -0
  96. berryql-0.1.5/tests/test_polymorphic_relation_mutation.py +36 -0
  97. berryql-0.1.5/tests/test_polymorphic_relations.py +115 -0
  98. berryql-0.1.5/tests/test_post_comment_like_count.py +60 -0
  99. berryql-0.1.5/tests/test_posts_commented_by_filter.py +52 -0
  100. berryql-0.1.5/tests/test_query_strawberry_field.py +10 -0
  101. berryql-0.1.5/tests/test_read_only_fields.py +98 -0
  102. berryql-0.1.5/tests/test_relation_argument_pushdown.py +66 -0
  103. berryql-0.1.5/tests/test_relation_filters.py +33 -0
  104. berryql-0.1.5/tests/test_relation_order_by_callable.py +30 -0
  105. berryql-0.1.5/tests/test_relations_chain.py +73 -0
  106. berryql-0.1.5/tests/test_relations_pagination_aggregate.py +92 -0
  107. berryql-0.1.5/tests/test_schema_shape.py +21 -0
  108. berryql-0.1.5/tests/test_single_relations_args.py +44 -0
  109. berryql-0.1.5/tests/test_sql_projection.py +248 -0
  110. berryql-0.1.5/tests/test_strawberry_fields.py +40 -0
  111. berryql-0.1.5/tests/test_strawberry_mutation_not_on_query.py +23 -0
  112. berryql-0.1.5/tests/test_type_scope.py +63 -0
  113. berryql-0.1.5/tests/test_view_type_scope.py +54 -0
  114. berryql-0.1.5/tests/test_where.py +59 -0
  115. berryql-0.1.5/tests/test_where_argument.py +56 -0
  116. berryql-0.1.5/tests/test_where_validation.py +74 -0
  117. berryql-0.1.5/tests/test_write_only_fields.py +72 -0
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented here.
4
+
5
+ ## [0.1.5] - 2025-12-04
6
+ ### Fixed
7
+ - Fixed relation resolution when the parent object is a raw SQLAlchemy model instance (e.g. returned from a native Strawberry field) instead of a BerryQL type instance.
8
+ - Fixed `self.__berry_registry__` access in relation resolvers by capturing the schema instance in closure.
9
+
10
+ ## [0.1.4] - 2025-11-26
11
+ ### Added
12
+ - Enhanced foreign key handling for single relations in BerrySchema.
13
+ - Propagate `parent_ctx` in nested mutations to ensure context availability in deep nesting.
14
+
15
+ ### Changed
16
+ - Refactored callback helpers in `mutations.py` to inner scope for better closure handling.
17
+ - Simplified meta handling in FieldDescriptor and related functions.
18
+ - Improved UUID type imports in utils.
19
+
20
+ ### Removed
21
+ - Deprecated inspection and testing scripts related to Strawberry configuration and GraphQL schema introspection.
22
+ - Removed `build.py` script.
23
+
24
+ ## [0.1.2] - 2025-11-20
25
+
26
+ ### Changed
27
+ - Minor changes
28
+
29
+ ## [0.1.1] - 2025-11-20
30
+ - Initial public release on PyPI.
@@ -0,0 +1,190 @@
1
+ # Contributing to BerryQL
2
+
3
+ Thank you for your interest in contributing to BerryQL! This document provides guidelines for contributing to the project.
4
+
5
+ ## Development Setup
6
+
7
+ 1. **Clone the repository**
8
+ ```bash
9
+ git clone https://github.com/uratol/berryql.git
10
+ cd berryql
11
+ ```
12
+
13
+ 2. **Set up development environment**
14
+ ```bash
15
+ python -m venv venv
16
+ source venv/bin/activate # On Windows: venv\Scripts\activate
17
+ pip install -e ".[dev,test]"
18
+ ```
19
+
20
+ 3. **Install pre-commit hooks**
21
+ ```bash
22
+ pre-commit install
23
+ ```
24
+
25
+ ## Development Workflow
26
+
27
+ ### Code Style
28
+
29
+ We use several tools to maintain code quality:
30
+
31
+ - **Black**: Code formatting
32
+ - **isort**: Import sorting
33
+ - **mypy**: Type checking
34
+ - **flake8**: Linting
35
+
36
+ Run these tools before committing:
37
+
38
+ ```bash
39
+ # Format code
40
+ black berryql tests
41
+
42
+ # Sort imports
43
+ isort berryql tests
44
+
45
+ # Type checking
46
+ mypy berryql
47
+
48
+ # Linting
49
+ flake8 berryql tests
50
+ ```
51
+
52
+ ### Testing
53
+
54
+ Run tests using pytest:
55
+
56
+ ```bash
57
+ # Run all tests
58
+ pytest
59
+
60
+ # Run with coverage
61
+ pytest --cov=berryql --cov-report=html
62
+
63
+ # Run specific test file
64
+ pytest tests/test_factory.py
65
+
66
+ # Run with verbose output
67
+ pytest -v
68
+ ```
69
+
70
+ ### Documentation
71
+
72
+ - Use docstrings for all public functions and classes
73
+ - Follow Google-style docstring format
74
+ - Include type hints for all function parameters and return values
75
+ - Add examples to docstrings where helpful
76
+
77
+ Example:
78
+ ```python
79
+ def example_function(param1: str, param2: int = 10) -> bool:
80
+ """
81
+ Brief description of what the function does.
82
+
83
+ Args:
84
+ param1: Description of param1
85
+ param2: Description of param2 with default value
86
+
87
+ Returns:
88
+ Description of what is returned
89
+
90
+ Raises:
91
+ ValueError: When param1 is invalid
92
+
93
+ Examples:
94
+ >>> example_function("test", 5)
95
+ True
96
+ """
97
+ ```
98
+
99
+ ## Pull Request Process
100
+
101
+ 1. **Create a feature branch**
102
+ ```bash
103
+ git checkout -b feature/your-feature-name
104
+ ```
105
+
106
+ 2. **Make your changes**
107
+ - Write clear, concise commit messages
108
+ - Add tests for new functionality
109
+ - Update documentation as needed
110
+ - Ensure all tests pass
111
+
112
+ 3. **Submit a pull request**
113
+ - Provide a clear description of the changes
114
+ - Reference any related issues
115
+ - Include screenshots or examples if applicable
116
+
117
+ ### Pull Request Guidelines
118
+
119
+ - Keep changes focused and atomic
120
+ - Write descriptive commit messages
121
+ - Include tests for new features
122
+ - Update documentation for API changes
123
+ - Ensure all CI checks pass
124
+
125
+ ## Issue Reporting
126
+
127
+ When reporting issues, please include:
128
+
129
+ 1. **Bug description**: Clear description of the problem
130
+ 2. **Expected behavior**: What you expected to happen
131
+ 3. **Actual behavior**: What actually happened
132
+ 4. **Environment details**: Python version, dependency versions, OS
133
+ 5. **Minimal reproduction**: Minimal code example that reproduces the issue
134
+ 6. **Stack trace**: If applicable, include the full stack trace
135
+
136
+ ## Feature Requests
137
+
138
+ For feature requests, please include:
139
+
140
+ 1. **Use case**: Describe the problem you're trying to solve
141
+ 2. **Proposed solution**: Your ideas for how to address it
142
+ 3. **Alternatives**: Other solutions you've considered
143
+ 4. **Implementation details**: Any technical considerations
144
+
145
+ ## Code Organization
146
+
147
+ ### Directory Structure
148
+
149
+ ```
150
+ berryql/
151
+ ├── berryql/ # Main package
152
+ │ ├── __init__.py # Package exports
153
+ │ ├── factory.py # Main BerryQL factory
154
+ │ ├── query_analyzer.py # GraphQL query analysis
155
+ │ ├── input_types.py # GraphQL input type definitions
156
+ │ ├── input_converter.py # Input conversion utilities
157
+ │ └── resolved_data_helper.py # Data resolution helpers
158
+ ├── tests/ # Test suite
159
+ ├── docs/ # Documentation
160
+ ├── examples/ # Usage examples
161
+ └── scripts/ # Development scripts
162
+ ```
163
+
164
+ ### Coding Standards
165
+
166
+ - Use type hints throughout the codebase
167
+ - Follow PEP 8 style guidelines (enforced by Black)
168
+ - Keep functions focused and single-purpose
169
+ - Use descriptive variable and function names
170
+ - Add docstrings to all public APIs
171
+ - Write tests for all new functionality
172
+
173
+ ## Release Process
174
+
175
+ Releases are handled by maintainers:
176
+
177
+ 1. Update version in `pyproject.toml` and `__init__.py`
178
+ 2. Update `CHANGELOG.md` with release notes
179
+ 3. Create a git tag for the release
180
+ 4. Build and publish to PyPI
181
+
182
+ ## Questions?
183
+
184
+ If you have questions about contributing, please:
185
+
186
+ 1. Check existing issues and discussions
187
+ 2. Create a new issue with the "question" label
188
+ 3. Join our community discussions
189
+
190
+ Thank you for contributing to BerryQL!
berryql-0.1.5/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BerryQL Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ include pyproject.toml
6
+ recursive-include berryql *.py
7
+ recursive-include tests *.py
8
+ recursive-include examples *.py
9
+ recursive-exclude * __pycache__
10
+ recursive-exclude * *.py[co]
11
+ recursive-exclude * *.orig