Skip to content

Make it easier to switch tables #36

@angrynode

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.

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