Skip to content
What's new

Rent v0.8.16

Rent v0.8.16 brings significant performance improvements to permission-aware reads. In matched benchmarks, fetching a row with its permission flags took 74.9–85.7% less time than in v0.8.15 across all four databases.

Permission-flag latency

Databasev0.8.15v0.8.16Lower latencySQL statements, before → after
PostgreSQL6.716 ms0.958 ms85.7%17 → 1
MySQL7.548 ms1.893 ms74.9%19 → 5
MariaDB8.087 ms1.922 ms76.2%19 → 5
SQLite1.074 ms0.176 ms83.6%16 → 2

Median latency for the same permission-flag workload across three paired runs. Results vary with the application and database setup.

These improvements apply automatically, with no new API or cache setting to adopt. Rent reduces database work while preserving authorization checks.

Typed tenant IDs

Tenant ownership now uses Int, BigInt or Uuid and cannot be changed after creation. Tenancy remains optional. See choosing a stable tenant ID and the tenancy example.

More expressive write permissions

Support unauthored records and control changes to related records with more flexible permission rules. See optional creators and field-level updates.

Reproducible PostgreSQL baselines

Preserve application functions when importing a database, with more faithful imports of indexes, defaults and triggers. See function-aware imports and the PostgreSQL functions example.

Query correction

Nullable tuple filters now handle numeric and UUID keys correctly on PostgreSQL.

Upgrade

Pin the SDK, extension crates and CLI to v0.8.16, regenerate the client, and commit the application lockfile.

String tenant IDs require a schema and data transition. Choose a typed ID, map every existing tenant consistently, and migrate tenant columns, foreign keys and permission-assignment scopes together. Rent does not invent that mapping or convert populated databases automatically. Remove code that tries to change an existing row's tenant. Review foreign-key actions that would mutate tenant keys.

Applications without tenancy do not need to adopt a tenant type. Ordinary transaction callbacks retain the v0.8.15 API. Function export is opt-in, and existing SQL-managed functions can remain in reviewed migrations.

Consumers constructing migration schema structs directly in Rust must supply new fields such as SqlFunction::body_style and Column::exact_text. Existing serialized function definitions default to quoted bodies.