Repository navigation
Releases
Releases · ikarys/rango-orm
Rango 0.1.0-beta.2
Breaking: on SQLite and MySQL, QueryBuilder::all() now returns Vec<WithRelated<M>> (derefs to M), like Postgres.
- Subqueries on every backend:
where_exists(correlatedEXISTS,NOT EXISTSvia.not()) andin_subquery. Subquery values stay bound parameters. select_relatedis oneLEFT JOINover the filtered/paginated rows on every backend.prefetch_relatedon every backend, for reverse foreign keys (Comment::POST_ID) and many-to-many fields (Article::TAGS, oneINNER JOINon the pivot). Keys are bound as= ANY($1)on Postgres,IN (...)in batches of 900 elsewhere.- Typed relation columns:
select_related/prefetch_related/where_existstakePost::AUTHOR_IDand infer the related model.#[derive(Model)]generates a constant perManyToManyfield. M2Moperations (add,remove,set,all,reverse,clear,exists) on SQLite and MySQL.setruns in one transaction on every backend.- Perf (Postgres): relation loading uses one pooled connection and decodes straight into
WithRelated; key dedup is O(n) instead of quadratic. - Fix:
rango::bulk_create/bulk_update/bulk_upsertwere missing from the Postgres facade. - Fix:
ManyToManyfields no longer triggerdead_codewarnings. - Auto-increment primary keys:
FieldAutoInt/FieldAutoBigInt(GENERATED BY DEFAULT AS IDENTITYon Postgres,AUTO_INCREMENTon MySQL, rowid on SQLite). The database assigns the id oninsert,get_or_createandbulk_create.importon Postgres moves identity sequences past the imported ids.makemigrationsrefuses aManyToManybetween models without UUID keys. - MySQL 8.0+ / MariaDB 10.6+ backend (
rango-mysql, featuremysql): CRUD, bulk create, transactions, query builder, raw SQL. UUIDs are stored asBINARY(16). - CLI:
backend = "mysql"(or"mariadb").makemigrationsemits backtick-quoted DDL with named unique/index/FK constraints andMODIFY COLUMNfor type and nullability changes;migrateuses an advisory lock;export/importround-trip UUIDs and JSON, and import runs in one transaction with FK checks off. - Fix:
importon Postgres and SQLite failed when a child table came before its parent in the file. Postgres now inserts tables in foreign key order, SQLite defers FK checks to commit, and both run the whole import in one transaction. - Fix:
makemigrationsignored#[model(constraints = ...)]andordering, and failed onManyToManyfields (the scanner printed types with a repetition instead of an interpolation).
Rango 0.1.0-beta.1
First beta. The API may still change between betas: pin the tag.
#[derive(Model)]with typed field types, constraints, ordering and FKs with realON DELETE.- PostgreSQL and SQLite backends: CRUD, bulk create/update/upsert, transactions (
atomic,atomic_retryon Postgres), raw SQL. - Typed query builder:
Column<M, T>constants, so comparing a column to a value of the wrong type does not compile. - Typed errors (
rango::Error), TLS by default for remote Postgres, argon2idFieldPassword. rangoCLI:init,makemigrations,migrate,export,import.