Skip to content

zero-sqlx is a database orm framework based on go-zero implementation that supports read/write separation between leader and follower databases.

License

Notifications You must be signed in to change notification settings

chenquan/zero-sqlx

Repository files navigation

zero-sqlx

zero-sqlx supports leader-follower read-write separation.

installation

go get github.com/chenquan/zero-sqlx

features

  • Full tracing
  • Read and write separation
  • Allows specified leader db execution
  • Adaptive circuit breaker
  • P2c algorithm

how to use it

DB:
  Leader: leader
  Followers:
    - follower1
    - follower2
type Config struct{
  DB DBConf
}
var c config.Config
conf.MustLoad(*configFile, &c, conf.UseEnv())


mysql := NewMultipleSqlConn("mysql", c.DB)
var name string
mysql.QueryRow(&name, "SELECT name FROM user WHERE id = 1")

About

zero-sqlx is a database orm framework based on go-zero implementation that supports read/write separation between leader and follower databases.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages