go-dblog is a multi-module Go toolkit for parsing database change logs. The
root module defines shared event, registry, checkpoint, filtering, and safe
flashback/recovery contracts; each backend keeps product-specific parsing, live
reading, typed events, and extension hooks in its own module.
Install only the backend you use.
| Product | Module | README | Features | Examples |
|---|---|---|---|---|
| Common API | github.com/Infranite/go-dblog |
This README | Roadmap scope | Minimal example below |
| MySQL family | github.com/Infranite/go-dblog/mysql |
English / 中文 | English / 中文 | English / 中文 |
| PostgreSQL family | github.com/Infranite/go-dblog/postgres |
English / 中文 | English / 中文 | English / 中文 |
| MongoDB family | github.com/Infranite/go-dblog/mongo |
English / 中文 | English / 中文 | English / 中文 |
| Redis family | github.com/Infranite/go-dblog/redis |
English / 中文 | English / 中文 | English / 中文 |
- Backend-neutral
dblog.Eventshape for mixed database log streams. - Explicit backend registration through
dblog.Registry. - Streaming decoders built on Go iterator APIs.
- Shared source metadata, position, checkpoint resume, filtering, and safe flashback/recovery helpers.
- Backend-native typed events for database-specific fields.
- Plugin hooks inside backend decoder packages for compatible dialects and product-specific records.
- Separate Go modules so callers do not install unused database dependencies.
The current public tag set is v0.4.0.
go get github.com/Infranite/go-dblog@v0.4.0
go get github.com/Infranite/go-dblog/mysql@v0.4.0
go get github.com/Infranite/go-dblog/postgres@v0.4.0
go get github.com/Infranite/go-dblog/mongo@v0.4.0
go get github.com/Infranite/go-dblog/redis@v0.4.0package main
import (
"fmt"
"strings"
"github.com/Infranite/go-dblog"
"github.com/Infranite/go-dblog/redis"
)
func main() {
var registry dblog.Registry
if err := redis.Register(®istry); err != nil {
panic(err)
}
decoder, err := registry.Open(redis.Driver,
dblog.WithReader(strings.NewReader("*2\r\n$4\r\nINCR\r\n$7\r\ncounter\r\n")),
)
if err != nil {
panic(err)
}
defer decoder.Close()
for event, err := range decoder.Events() {
if err != nil {
panic(err)
}
fmt.Println(event.Kind(), dblog.PositionOf(event).Value)
}
}Use the common API for multi-source routing, shared filtering, CDC pipelines, backend registration, and recovery tasks. Use backend-native APIs when you need database-specific event fields.
| Topic | English | 中文 |
|---|---|---|
| Project overview | This README | doc/README.zh-CN.md |
| Recovery cookbook | doc/RECOVERY.md | doc/RECOVERY.zh-CN.md |
| CI evidence | doc/CI.md | doc/CI.zh-CN.md |
| Roadmap and product scope | doc/ROADMAP.md | doc/ROADMAP.zh-CN.md |
| Development and contribution flow | doc/DEVELOPMENT.md | doc/DEVELOPMENT.zh-CN.md |
| Security policy | doc/SECURITY.md | doc/SECURITY.zh-CN.md |
GitHub Releases and git tags are the public release record. Git history is the detailed change log; this repository does not maintain separate release notes or changelog files.
Apache License 2.0. See LICENSE.