Skip to content

Operator ergonomics#51

Merged
angrynode merged 2 commits into
axumfrom
operator-ergonomics
May 29, 2026
Merged

Operator ergonomics#51
angrynode merged 2 commits into
axumfrom
operator-ergonomics

Conversation

@angrynode
Copy link
Copy Markdown
Owner

This PR makes table operators more ergonomic so:

  • you can switch table directly from an operator, eg content_folder_operator.torrent()
  • you can log directly from the table operator with log_create, log_update and log_delete methods

This requires the table operator to implement Deref<Target = DatabaseOperator> and TableOperator which has a single method fn table(&self) -> Table to save the table information in the logs.

This PR also reduces allocations when switching tables because we don't have to clone the state/user every time, by introducing a lifetime for table operators. That means a table operator can only live as long as the inner DatabaseOperator, which is perfectly fine.

@angrynode angrynode merged commit 343dd48 into axum May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant