surrealdb-orm 0.1.3__py3-none-any.whl → 0.5.0__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 (51) hide show
  1. surreal_orm/__init__.py +78 -3
  2. surreal_orm/aggregations.py +164 -0
  3. surreal_orm/auth/__init__.py +15 -0
  4. surreal_orm/auth/access.py +167 -0
  5. surreal_orm/auth/mixins.py +302 -0
  6. surreal_orm/cli/__init__.py +15 -0
  7. surreal_orm/cli/commands.py +369 -0
  8. surreal_orm/connection_manager.py +58 -18
  9. surreal_orm/fields/__init__.py +36 -0
  10. surreal_orm/fields/encrypted.py +166 -0
  11. surreal_orm/fields/relation.py +465 -0
  12. surreal_orm/migrations/__init__.py +51 -0
  13. surreal_orm/migrations/executor.py +380 -0
  14. surreal_orm/migrations/generator.py +272 -0
  15. surreal_orm/migrations/introspector.py +305 -0
  16. surreal_orm/migrations/migration.py +188 -0
  17. surreal_orm/migrations/operations.py +531 -0
  18. surreal_orm/migrations/state.py +406 -0
  19. surreal_orm/model_base.py +594 -135
  20. surreal_orm/py.typed +0 -0
  21. surreal_orm/query_set.py +609 -34
  22. surreal_orm/relations.py +645 -0
  23. surreal_orm/surreal_function.py +95 -0
  24. surreal_orm/surreal_ql.py +113 -0
  25. surreal_orm/types.py +86 -0
  26. surreal_sdk/README.md +79 -0
  27. surreal_sdk/__init__.py +151 -0
  28. surreal_sdk/connection/__init__.py +17 -0
  29. surreal_sdk/connection/base.py +516 -0
  30. surreal_sdk/connection/http.py +421 -0
  31. surreal_sdk/connection/pool.py +244 -0
  32. surreal_sdk/connection/websocket.py +519 -0
  33. surreal_sdk/exceptions.py +71 -0
  34. surreal_sdk/functions.py +607 -0
  35. surreal_sdk/protocol/__init__.py +13 -0
  36. surreal_sdk/protocol/rpc.py +218 -0
  37. surreal_sdk/py.typed +0 -0
  38. surreal_sdk/pyproject.toml +49 -0
  39. surreal_sdk/streaming/__init__.py +31 -0
  40. surreal_sdk/streaming/change_feed.py +278 -0
  41. surreal_sdk/streaming/live_query.py +265 -0
  42. surreal_sdk/streaming/live_select.py +369 -0
  43. surreal_sdk/transaction.py +386 -0
  44. surreal_sdk/types.py +346 -0
  45. surrealdb_orm-0.5.0.dist-info/METADATA +465 -0
  46. surrealdb_orm-0.5.0.dist-info/RECORD +52 -0
  47. {surrealdb_orm-0.1.3.dist-info → surrealdb_orm-0.5.0.dist-info}/WHEEL +1 -1
  48. surrealdb_orm-0.5.0.dist-info/entry_points.txt +2 -0
  49. {surrealdb_orm-0.1.3.dist-info → surrealdb_orm-0.5.0.dist-info}/licenses/LICENSE +1 -1
  50. surrealdb_orm-0.1.3.dist-info/METADATA +0 -184
  51. surrealdb_orm-0.1.3.dist-info/RECORD +0 -11
@@ -1,184 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: surrealdb-orm
3
- Version: 0.1.3
4
- Summary: SurrealDB ORM as 'DJango style' for Python with async support. Works with pydantic validation.
5
- Project-URL: Homepage, https://github.com/EulogySnowfall/SurrealDB-ORM
6
- Project-URL: Documentation, https://github.com/EulogySnowfall/SurrealDB-ORM
7
- Project-URL: Repository, https://github.com/EulogySnowfall/SurrealDB-ORM.git
8
- Project-URL: Issues, https://github.com/EulogySnowfall/SurrealDB-ORM/issues
9
- Author-email: Yannick Croteau <yannick.croteau@gmail.com>
10
- License: # MIT License
11
-
12
- Copyright (c) 2024 Yannick Croteau
13
-
14
- Permission is hereby granted, free of charge, to any person obtaining a copy
15
- of this software and associated documentation files (the "Software"), to deal
16
- in the Software without restriction, including without limitation the rights
17
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- copies of the Software, and to permit persons to whom the Software is
19
- furnished to do so, subject to the following conditions:
20
-
21
- The above copyright notice and this permission notice shall be included in all
22
- copies or substantial portions of the Software.
23
-
24
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- SOFTWARE.
31
- License-File: LICENSE
32
- Classifier: Development Status :: 3 - Alpha
33
- Classifier: License :: OSI Approved :: MIT License
34
- Classifier: Operating System :: OS Independent
35
- Classifier: Programming Language :: Python :: 3
36
- Classifier: Programming Language :: Python :: 3.11
37
- Classifier: Programming Language :: Python :: 3.12
38
- Classifier: Programming Language :: Python :: 3.13
39
- Classifier: Topic :: Database
40
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
- Requires-Python: >=3.11
42
- Requires-Dist: pydantic>=2.10.4
43
- Requires-Dist: surrealdb>=0.4.1
44
- Description-Content-Type: text/markdown
45
-
46
- # SurrealDB-ORM
47
-
48
- ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
49
- ![CI](https://github.com/EulogySnowfall/SurrealDB-ORM/actions/workflows/ci.yml/badge.svg)
50
- [![codecov](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM/graph/badge.svg?token=XUONTG2M6Z)](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM)
51
- ![GitHub License](https://img.shields.io/github/license/EulogySnowfall/SurrealDB-ORM)
52
-
53
- 🚀 **SurrealDB-ORM** is a lightweight ORM (Object-Relational Mapping) inspired by Django ORM, designed to simplify interactions with **SurrealDB** in Python projects. It provides an intuitive way to manage models, perform queries, and execute CRUD (Create, Read, Update, Delete) operations.
54
-
55
- ---
56
-
57
- ## 📋 Table of Contents
58
-
59
- - [Version](#-version)
60
- - [Description](#-description)
61
- - [Requirements and tested based](#-requirements-and-tested-based)
62
- - [Installation](#-installation)
63
- - [Usage Example](#-usage-example)
64
- - [Features](#-features)
65
- - [Contributing](#-contributing)
66
- - [TODO](#-todo)
67
- - [License](#-license)
68
-
69
- ---
70
-
71
- ## ✅ Version
72
-
73
- Alpha 0.1.3
74
-
75
- ---
76
-
77
- ## 📝 Description
78
-
79
- SurrealDB-ORM offers a clean abstraction for handling SurrealDB through Python models.
80
- The goal is to simplify writing complex queries while providing an intuitive interface similar to modern ORMs like Django or SQLAlchemy.
81
-
82
- ---
83
-
84
- ## 📝 Requirements and tested based
85
-
86
- - Python : 3.11~3.13
87
- - Pydantic : 2.10.4
88
- - SurrealDB Database Version : 2.1.4
89
- - You need to set a SurrealDB to connect to.
90
-
91
- ---
92
-
93
- ## 🛠️ Installation
94
-
95
- ```bash
96
- pip install surrealdb-orm
97
- ```
98
-
99
- ---
100
-
101
- ## 🚀 Usage Example
102
-
103
- Here's a simple example demonstrating how to define a model and interact with SurrealDB:
104
-
105
- ### 1. Define a Model
106
-
107
- ```python
108
- from surreal_orm.modelBase import BaseSurrealModel
109
- from pydantic import BaseModel, Field
110
- from typing import Optional
111
-
112
-
113
- class User(BaseSurrealModel):
114
- id: Optional[str] = None
115
- name: str = Field(..., max_length=100)
116
- email: str
117
- ```
118
-
119
- ### 2. Create and Save a User
120
-
121
- ```python
122
- user = User(name="Alice", email="alice@example.com")
123
- await user.save()
124
- ```
125
-
126
- ### 3. Query Users
127
-
128
- ```python
129
- users = await User.objects().filter(name="Alice").exec()
130
- for user in users:
131
- print(user.name, user.email)
132
- ```
133
-
134
- ---
135
-
136
- ## 🌟 Features
137
-
138
- - 🔧 **Model definition** using Pydantic
139
- - 📄 **QuerySet** with filter methods like `filter()`, `limit()`, and `order_by()`
140
- - 🔄 **CRUD** operations (Create, Read, Update, Delete)
141
- - ⚙️ **Asynchronous connection** to SurrealDB
142
- - 🔍 **Automatic validation** with Pydantic
143
- - 📊 **Complex queries** with conditional filters (`age__gte`, `name__in`, etc.)
144
-
145
- ---
146
-
147
- ## 🤝 Contributing
148
-
149
- Contributions are welcome!
150
- If you'd like to improve this project:
151
-
152
- 1. Fork the repository.
153
- 2. Create a branch (`git checkout -b feature/new-feature`).
154
- 3. Make your changes and commit them (`git commit -m "Add new feature"`).
155
- 4. Push to your branch (`git push origin feature/new-feature`).
156
- 5. Create a Pull Request.
157
-
158
- ---
159
-
160
- ## 📌 TODO
161
-
162
- - [ ] Implement relationships
163
- - [ ] Add transaction support
164
- - [ ] Optimize complex queries
165
- - [ ] Expand documentation with advanced examples
166
- - [ ] Better SurrealQL Integration
167
-
168
- ---
169
-
170
- ## 📄 License
171
-
172
- This project is licensed under the **MIT License**. See the `LICENSE` file for more information.
173
-
174
- ---
175
-
176
- ### 📨 Contact
177
-
178
- **Author:** Yannick Croteau
179
- **Email:** <croteau.yannick@gmail.com>
180
- **GitHub:** [EulogySnowfall](https://github.com/EulogySnowfall)
181
-
182
- ---
183
-
184
- **SurrealDB-ORM** is a personal package to use with other projects. I will certainly improve it over the next few months, but feel free to open issues or suggest improvements 🚀
@@ -1,11 +0,0 @@
1
- surreal_orm/__init__.py,sha256=RNoDt0Gt7_jTjzxzXGPXKUqe7EnCdt31b35tnA-JcOM,243
2
- surreal_orm/connection_manager.py,sha256=kRAK6qhkKRVbhTjWZV6LaOGiH_jClwQ3zzmjca1A5Ro,8561
3
- surreal_orm/constants.py,sha256=CLavEca1M6cLJLqVl4l4KoE-cBrgVQNsuGxW9zGJBmg,429
4
- surreal_orm/enum.py,sha256=kR-vzkHqnqy9YaYOvWTwAHdl2-WCzPcSEch-YTyJv1Y,158
5
- surreal_orm/model_base.py,sha256=U9ZJeOS75uJXMvhKTNy8I2QDXMxoF5eVUkQe-vesggk,7358
6
- surreal_orm/query_set.py,sha256=ng-jTFWiUpxPJH-KC7SNxZ2PwmciCnkOifOWa7A2KEs,18156
7
- surreal_orm/utils.py,sha256=mni_dTtb4VGTdge8eWSZpBw5xoWci2m-XThKFHYPKTo,171
8
- surrealdb_orm-0.1.3.dist-info/METADATA,sha256=T9tXMFp3th-r4FMnFQt2s8z4Pz5zCs0_KoE33k64-gU,5980
9
- surrealdb_orm-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- surrealdb_orm-0.1.3.dist-info/licenses/LICENSE,sha256=TO3Ub0nPPx5NxwjsDuBAu3RBdBLmdDybqC5dem4oGts,1074
11
- surrealdb_orm-0.1.3.dist-info/RECORD,,