ferrum-orm 0.1.4__tar.gz → 0.1.6__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.
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/Cargo.lock +4 -4
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/Cargo.toml +1 -1
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/PKG-INFO +1 -1
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/pyproject.toml +1 -1
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/__init__.py +1 -1
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/inspectdb_cmd.py +16 -15
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/LICENSE +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/README.md +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/Cargo.toml +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/benches/hydrate.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/compile/mod.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/error.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/hydrate/mod.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/ir/metadata.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/ir/mod.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/lib.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-core/src/migrate/mod.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-pyo3/Cargo.toml +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-pyo3/src/lib.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/Cargo.toml +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/benches/compile.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/dialect.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/emit.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/fts/mod.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/fts/mssql.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/fts/mysql.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/fts/postgres.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/fts/sqlite.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/crates/ferrum-sql/src/lib.rs +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/_native.pyi +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/app.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/bootstrap.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/init.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/makemigrations_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/migrate_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/migrations_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/resetdb_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/revert_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/showmigrations_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/cli/sqlmigrate_cmd.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/config.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/connection.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/contrib/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/contrib/fastapi.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/mssql.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/mysql.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/postgres.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/protocol.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/drivers/sqlite.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/errors.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/expressions.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/ext/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/ext/fts.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/ext/pgvector.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/hooks.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/base.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/drift.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/fts/__init__.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/fts/mssql.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/fts/mysql.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/fts/postgres.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/fts/sqlite.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/gates.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/introspect.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/ledger.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/loader.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/operations.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/orchestrator.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/migrations/tokens.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/models.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/observability.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/py.typed +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/queryset.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/registry.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/relations.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/runtime.py +0 -0
- {ferrum_orm-0.1.4 → ferrum_orm-0.1.6}/python/ferrum/session.py +0 -0
|
@@ -223,7 +223,7 @@ checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
|
|
|
223
223
|
|
|
224
224
|
[[package]]
|
|
225
225
|
name = "ferrum-core"
|
|
226
|
-
version = "0.1.
|
|
226
|
+
version = "0.1.6"
|
|
227
227
|
dependencies = [
|
|
228
228
|
"criterion",
|
|
229
229
|
"proptest",
|
|
@@ -234,7 +234,7 @@ dependencies = [
|
|
|
234
234
|
|
|
235
235
|
[[package]]
|
|
236
236
|
name = "ferrum-migrate"
|
|
237
|
-
version = "0.1.
|
|
237
|
+
version = "0.1.6"
|
|
238
238
|
dependencies = [
|
|
239
239
|
"ferrum-core",
|
|
240
240
|
"serde",
|
|
@@ -243,7 +243,7 @@ dependencies = [
|
|
|
243
243
|
|
|
244
244
|
[[package]]
|
|
245
245
|
name = "ferrum-pyo3"
|
|
246
|
-
version = "0.1.
|
|
246
|
+
version = "0.1.6"
|
|
247
247
|
dependencies = [
|
|
248
248
|
"ferrum-core",
|
|
249
249
|
"ferrum-sql",
|
|
@@ -255,7 +255,7 @@ dependencies = [
|
|
|
255
255
|
|
|
256
256
|
[[package]]
|
|
257
257
|
name = "ferrum-sql"
|
|
258
|
-
version = "0.1.
|
|
258
|
+
version = "0.1.6"
|
|
259
259
|
dependencies = [
|
|
260
260
|
"criterion",
|
|
261
261
|
"ferrum-core",
|
|
@@ -35,7 +35,7 @@ _HEADER = textwrap.dedent("""\
|
|
|
35
35
|
from __future__ import annotations
|
|
36
36
|
from datetime import date, datetime, time
|
|
37
37
|
from decimal import Decimal
|
|
38
|
-
from typing import Annotated
|
|
38
|
+
from typing import Annotated, ClassVar
|
|
39
39
|
from uuid import UUID
|
|
40
40
|
|
|
41
41
|
import ferrum
|
|
@@ -237,12 +237,18 @@ def _render_class(
|
|
|
237
237
|
fk = fk_map[col_name]
|
|
238
238
|
target_class = _to_class_name(fk["foreign_table_name"])
|
|
239
239
|
delete_rule = fk["delete_rule"].upper()
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
f
|
|
245
|
-
)
|
|
240
|
+
annotation = _pg_type_to_ferrum(pg_type, max_len, precision, scale, is_pk, is_nullable)
|
|
241
|
+
if "Field(" in annotation:
|
|
242
|
+
lines.append(f" {col_name}: {annotation}")
|
|
243
|
+
else:
|
|
244
|
+
lines.append(f" {col_name}: {annotation}")
|
|
245
|
+
# Relation descriptor (ClassVar) — only when the column follows {name}_id.
|
|
246
|
+
if col_name.endswith("_id"):
|
|
247
|
+
rel_name = col_name[:-3]
|
|
248
|
+
lines.append(
|
|
249
|
+
f" {rel_name}: ClassVar[ForeignKey] = ForeignKey("
|
|
250
|
+
f'to="{target_class}", on_delete="{delete_rule}")'
|
|
251
|
+
)
|
|
246
252
|
continue
|
|
247
253
|
|
|
248
254
|
annotation = _pg_type_to_ferrum(pg_type, max_len, precision, scale, is_pk, is_nullable)
|
|
@@ -291,14 +297,9 @@ async def run_inspectdb(
|
|
|
291
297
|
if conn.dialect != "postgres":
|
|
292
298
|
print("inspectdb currently supports PostgreSQL only.")
|
|
293
299
|
return 2
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return 2
|
|
298
|
-
async with pool.acquire() as db_conn:
|
|
299
|
-
col_rows = await db_conn.fetch(_COL_QUERY, schema)
|
|
300
|
-
fk_rows = await db_conn.fetch(_FK_QUERY, schema)
|
|
301
|
-
pk_rows = await db_conn.fetch(_PK_QUERY, schema)
|
|
300
|
+
col_rows = await driver.fetch(_COL_QUERY, schema)
|
|
301
|
+
fk_rows = await driver.fetch(_FK_QUERY, schema)
|
|
302
|
+
pk_rows = await driver.fetch(_PK_QUERY, schema)
|
|
302
303
|
except FerrumConfigError as exc:
|
|
303
304
|
print(f"Configuration error: {exc}")
|
|
304
305
|
return 2
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|