02-read-write-split

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 7 Imported by: 0

README

Primary and read replicas

ReplicaSet.Read() returns only the generated read wrapper and balances calls across replicas. ReplicaSet.Write() returns the primary-capable wrapper for writes and strong reads.

RW_PRIMARY_DSN='postgres://user:pass@primary/accounts?sslmode=disable' \
RW_REPLICA_DSN='postgres://user:pass@replica/accounts?sslmode=disable' \
  go run ./examples/02-read-write-split

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL