Skip to content

Releases

Rango 0.1.0-beta.2

Rango 0.1.0-beta.2 Pre-release
Pre-release

Choose a tag to compare

@ikarys ikarys released this 06 Nov 09:47

Breaking: on SQLite and MySQL, QueryBuilder::all() now returns Vec<WithRelated<M>> (derefs to M), like Postgres.

  • Subqueries on every backend: where_exists (correlated EXISTS, NOT EXISTS via .not()) and in_subquery. Subquery values stay bound parameters.
  • select_related is one LEFT JOIN over the filtered/paginated rows on every backend.
  • prefetch_related on every backend, for reverse foreign keys (Comment::POST_ID) and many-to-many fields (Article::TAGS, one INNER JOIN on the pivot). Keys are bound as = ANY($1) on Postgres, IN (...) in batches of 900 elsewhere.
  • Typed relation columns: select_related / prefetch_related / where_exists take Post::AUTHOR_ID and infer the related model. #[derive(Model)] generates a constant per ManyToMany field.
  • M2M operations (add, remove, set, all, reverse, clear, exists) on SQLite and MySQL. set runs 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_upsert were missing from the Postgres facade.
  • Fix: ManyToMany fields no longer trigger dead_code warnings.
  • Auto-increment primary keys: FieldAutoInt / FieldAutoBigInt (GENERATED BY DEFAULT AS IDENTITY on Postgres, AUTO_INCREMENT on MySQL, rowid on SQLite). The database assigns the id on insert, get_or_create and bulk_create. import on Postgres moves identity sequences past the imported ids. makemigrations refuses a ManyToMany between models without UUID keys.
  • MySQL 8.0+ / MariaDB 10.6+ backend (rango-mysql, feature mysql): CRUD, bulk create, transactions, query builder, raw SQL. UUIDs are stored as BINARY(16).
  • CLI: backend = "mysql" (or "mariadb"). makemigrations emits backtick-quoted DDL with named unique/index/FK constraints and MODIFY COLUMN for type and nullability changes; migrate uses an advisory lock; export/import round-trip UUIDs and JSON, and import runs in one transaction with FK checks off.
  • Fix: import on 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: makemigrations ignored #[model(constraints = ...)] and ordering, and failed on ManyToMany fields (the scanner printed types with a repetition instead of an interpolation).

Rango 0.1.0-beta.1

Rango 0.1.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@ikarys ikarys released this 05 Nov 22:48

First beta. The API may still change between betas: pin the tag.

  • #[derive(Model)] with typed field types, constraints, ordering and FKs with real ON DELETE.
  • PostgreSQL and SQLite backends: CRUD, bulk create/update/upsert, transactions (atomic, atomic_retry on 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, argon2id FieldPassword.
  • rango CLI: init, makemigrations, migrate, export, import.