Skip to content

sqlalchemy_loader to support multiple sessions #258

@gabor-lbl

Description

@gabor-lbl

In my project, my graphql context has 2 db sessions:

'session': database.db_session,
'ro_session': database.ro_db_session,

For some read-only queries, I like to use ro_session which points to my read-only replica. However, afaict, the sqlalchemy_loader key can only point to one session. Would it be possible to somehow use the session an object was loaded with, instead of having to set sqlalchemy_loader?

In SqlAlchemy object_session() handles this.

Thank you!

Feature Request Type

  • Core functionality
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions