Skip to content

Two engines with the same model #475

Description

@paulin-mipt

Description

Hi again, fantix and the team!

I'm thinking of the best way of having two engines with the same models (e.g. one engine for a rw- and one for ro- database replica). It seems to me, that if I create two Gino objects, I'll have to fully redeclare models, like this:

db = Gino()
db_ro = Gino()

class MyModel(db.Model):
  attr = db.Column(...)

class MyModelRo(db_ro.Model):
  attr = db_ro.Column(...)

Is there a more elegant way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA community question, closed when inactive.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions