Skip to content

Make it easier to switch tables #36

Description

@angrynode

Right now we cheat with a Table::db(&self) -> DatabaseOperator helper method.

Maybe each table could store the DatabaseOperator and implement Deref<Target = DatabaseOperator>? That would allow to do something like:

let magnet_operator = category_operator.magnet();

Is that useful? Is that confusing? Is it better to stay explicit with the category_operator.db().magnet() instruction?

Also worth noting that we currently do a lot of cloning which is not really a problem given we don't have many requests, but we maybe could avoid that with some lifetime magic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions