half-orm 1.0.0rc17__tar.gz → 1.1.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.
- {half_orm-1.0.0rc17/half_orm.egg-info → half_orm-1.1.0}/PKG-INFO +18 -7
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/README.md +12 -1
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/__main__.py +8 -4
- half_orm-1.1.0/half_orm/cli.py +951 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/field.py +108 -8
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/hotest.py +18 -1
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/model.py +326 -58
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/pg_meta.py +32 -8
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/relation.py +508 -113
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/relation_errors.py +9 -5
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/transaction.py +43 -6
- half_orm-1.1.0/half_orm/version.txt +1 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0/half_orm.egg-info}/PKG-INFO +18 -7
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/pyproject.toml +7 -7
- half_orm-1.1.0/test/test_cli.py +1399 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/test/test_main.py +4 -4
- half_orm-1.0.0rc17/half_orm/cli.py +0 -447
- half_orm-1.0.0rc17/half_orm/version.txt +0 -1
- half_orm-1.0.0rc17/test/test_cli.py +0 -556
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/AUTHORS +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/LICENSE +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/__init__.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/cli_utils.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/field_errors.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/fkey.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/migrations/BREAKING_CHANGES-1.0.0.md +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/migrations/__init__.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/model_errors.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/null.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/py.typed +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/relation_factory.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/sql_adapter.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/sql_ast.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/testing.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm/utils.py +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm.egg-info/SOURCES.txt +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm.egg-info/dependency_links.txt +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm.egg-info/entry_points.txt +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm.egg-info/requires.txt +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/half_orm.egg-info/top_level.txt +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/setup.cfg +0 -0
- {half_orm-1.0.0rc17 → half_orm-1.1.0}/test/test_sql_ast.py +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: half_orm
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A database-first ORM for PostgreSQL
|
|
5
5
|
Author-email: Joël Maïzi <joel.maizi@collorg.org>
|
|
6
|
-
License: GPL-3.0
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://github.com/half-orm/half-orm
|
|
8
8
|
Project-URL: Documentation, https://half-orm.github.io/half-orm/
|
|
9
9
|
Project-URL: Changelog, https://github.com/half-orm/half-orm/blob/main/CHANGELOG.md
|
|
10
|
-
Classifier: Development Status ::
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Database
|
|
13
13
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: AUTHORS
|
|
@@ -30,7 +30,7 @@ Dynamic: license-file
|
|
|
30
30
|
# halfORM
|
|
31
31
|
|
|
32
32
|
[](https://pypi.org/project/half-orm/)
|
|
33
|
-
[](https://www.python.org)
|
|
34
34
|
[](https://www.postgresql.org)
|
|
35
35
|
[](https://pypi.org/project/half-orm/)
|
|
36
36
|
[](https://github.com/half-orm/half-orm/actions/workflows/python-package.yml)
|
|
@@ -39,6 +39,17 @@ Dynamic: license-file
|
|
|
39
39
|
|
|
40
40
|
> ## ⚠️ BREAKING CHANGES in v1.0.0
|
|
41
41
|
>
|
|
42
|
+
> **Legacy unprefixed API removed** — the pre-`ho_` method names, deprecated
|
|
43
|
+
> since 0.x, no longer exist: `select`, `insert`, `update`, `delete`, `get`,
|
|
44
|
+
> `count`, `is_empty`, `unaccent`, `order_by`, `limit`, `offset`, `_mogrify`.
|
|
45
|
+
> Use their `ho_`-prefixed equivalents (`ho_select`, `ho_insert`, `ho_update`,
|
|
46
|
+
> `ho_delete`, `ho_get`, `ho_count`, `ho_is_empty`, `ho_unaccent`, `ho_mogrify`,
|
|
47
|
+
> passing `order_by`/`limit`/`offset` as `ho_select()` keyword arguments).
|
|
48
|
+
>
|
|
49
|
+
> **`DC_Relation`** removed from `half_orm.relation` — this IDE type-checking
|
|
50
|
+
> stub is now generated per-project by `half-orm-dev` instead of shipped in
|
|
51
|
+
> the library.
|
|
52
|
+
>
|
|
42
53
|
> **`ho_get()`** is now public and returns a `dict` directly. It raises
|
|
43
54
|
> `NotFoundError` (0 rows) or `MultipleRowsError` (> 1 row) instead of
|
|
44
55
|
> counting first.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# halfORM
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/half-orm/)
|
|
4
|
-
[](https://www.python.org)
|
|
5
5
|
[](https://www.postgresql.org)
|
|
6
6
|
[](https://pypi.org/project/half-orm/)
|
|
7
7
|
[](https://github.com/half-orm/half-orm/actions/workflows/python-package.yml)
|
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
> ## ⚠️ BREAKING CHANGES in v1.0.0
|
|
12
12
|
>
|
|
13
|
+
> **Legacy unprefixed API removed** — the pre-`ho_` method names, deprecated
|
|
14
|
+
> since 0.x, no longer exist: `select`, `insert`, `update`, `delete`, `get`,
|
|
15
|
+
> `count`, `is_empty`, `unaccent`, `order_by`, `limit`, `offset`, `_mogrify`.
|
|
16
|
+
> Use their `ho_`-prefixed equivalents (`ho_select`, `ho_insert`, `ho_update`,
|
|
17
|
+
> `ho_delete`, `ho_get`, `ho_count`, `ho_is_empty`, `ho_unaccent`, `ho_mogrify`,
|
|
18
|
+
> passing `order_by`/`limit`/`offset` as `ho_select()` keyword arguments).
|
|
19
|
+
>
|
|
20
|
+
> **`DC_Relation`** removed from `half_orm.relation` — this IDE type-checking
|
|
21
|
+
> stub is now generated per-project by `half-orm-dev` instead of shipped in
|
|
22
|
+
> the library.
|
|
23
|
+
>
|
|
13
24
|
> **`ho_get()`** is now public and returns a `dict` directly. It raises
|
|
14
25
|
> `NotFoundError` (0 rows) or `MultipleRowsError` (> 1 row) instead of
|
|
15
26
|
> counting first.
|
|
@@ -40,7 +40,7 @@ def check_databases_access():
|
|
|
40
40
|
try:
|
|
41
41
|
model = Model(cnx_file)
|
|
42
42
|
print(f"✅ {cnx_file}")
|
|
43
|
-
except (psycopg.Error, model_errors.MalformedConfigFile) as exc:
|
|
43
|
+
except (psycopg.Error, model_errors.MalformedConfigFile, ValueError) as exc:
|
|
44
44
|
sys.stderr.write(f'❌ {cnx_file}: {exc}\n')
|
|
45
45
|
else:
|
|
46
46
|
print("💡 No database configuration files found.")
|
|
@@ -50,7 +50,7 @@ def check_databases_access():
|
|
|
50
50
|
except FileNotFoundError:
|
|
51
51
|
sys.stderr.write(f"❌ '{CONF_DIR}' does not exist.\nChange HALFORM_CONF_DIR variable\n")
|
|
52
52
|
sys.stderr.flush()
|
|
53
|
-
print(f"\nCheck the documentation on https://half-orm.github.io/half-orm/
|
|
53
|
+
print(f"\nCheck the documentation on https://half-orm.github.io/half-orm/half-an-hour/#1-connect-1-min")
|
|
54
54
|
|
|
55
55
|
def show_version():
|
|
56
56
|
print(f"[halfORM] version {half_orm.__version__}")
|
|
@@ -77,10 +77,11 @@ def main():
|
|
|
77
77
|
if database == '':
|
|
78
78
|
sys.stderr.write("❌ Empty database name\n")
|
|
79
79
|
sys.exit(1)
|
|
80
|
+
return
|
|
80
81
|
try:
|
|
81
82
|
model = Model(database)
|
|
82
83
|
print(model)
|
|
83
|
-
except (psycopg.Error, model_errors.MalformedConfigFile) as exc:
|
|
84
|
+
except (psycopg.Error, model_errors.MalformedConfigFile, ValueError) as exc:
|
|
84
85
|
sys.stderr.write(f"❌ Error connecting to database '{database}': {exc}\n")
|
|
85
86
|
sys.stderr.write(f"💡 Use 'python -m half_orm --help' for usage information\n")
|
|
86
87
|
sys.exit(1)
|
|
@@ -92,14 +93,17 @@ def main():
|
|
|
92
93
|
if database == '':
|
|
93
94
|
sys.stderr.write("❌ Empty database name\n")
|
|
94
95
|
sys.exit(1)
|
|
96
|
+
return
|
|
95
97
|
if relation == '':
|
|
96
98
|
sys.stderr.write("❌ Empty relation name\n")
|
|
97
99
|
sys.exit(1)
|
|
100
|
+
return
|
|
98
101
|
try:
|
|
99
102
|
model = Model(database)
|
|
100
103
|
relation_class = model.get_relation_class(relation)
|
|
101
104
|
print(relation_class())
|
|
102
|
-
except (psycopg.Error, model_errors.MalformedConfigFile,
|
|
105
|
+
except (psycopg.Error, model_errors.MalformedConfigFile, ValueError,
|
|
106
|
+
model_errors.UnknownRelation, model_errors.MissingSchemaInName) as exc:
|
|
103
107
|
sys.stderr.write(f"❌ Error accessing relation '{relation}' in database '{database}': {exc}\n")
|
|
104
108
|
sys.stderr.write(f"💡 Use 'python -m half_orm --help' for usage information\n")
|
|
105
109
|
sys.exit(1)
|