Skip to content

Behaviour like JDBC's "targetServerType" #999

@rogierlommers

Description

@rogierlommers

In JDBC, I can connect to a database and I can provide the targetServerType parameter. The JDBC docs explain this as:

Allows opening connections to only servers with required state, the allowed values are any, master, slave and preferSlave. The master/slave distinction is currently done by observing if the server allows writes. The value preferSlave tries to connect to slaves if any are available, otherwise allows falls back to connecting also to master.

It provides a way to configure the connection with two hosts, one acting as the master and one as the slave. When something is wrong with the master, the client will automatically switch to the master. Does something like this exists in Go world?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions