Skip to content

Commit d349bb8

Browse files
authored
Merge pull request #8 from dgraph-io/chore/dgdao-typed-client-parity
Adopt the dgdao v0.9.0 API
2 parents c1728ec + 978da98 commit d349bb8

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
All notable changes to this project are documented here. The format follows
44
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

6+
## [0.2.4] - 2026-07-19
7+
8+
### Changed
9+
10+
- Bump the `github.com/dgraph-io/dgdao` dependency to v0.9.0, which renames the
11+
transaction surface (`Txn`/`ClientTxn`), the consume operations
12+
(`GetOrInsert`/`GetAndDelete`), and the record bridge (`AsRecord`). Schema rendering
13+
follows the `AsRecord` rename; no behavior change in migrate itself.
14+
615
## [0.2.3] - 2026-07-17
716

817
### Changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/dgraph-io/dgdao-migrate
33
go 1.26.4
44

55
require (
6-
github.com/dgraph-io/dgdao v0.8.0
6+
github.com/dgraph-io/dgdao v0.9.0
77
github.com/dgraph-io/dgo/v250 v250.0.0
88
github.com/dolan-in/dgman/v2 v2.2.0
99
github.com/stretchr/testify v1.11.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
118118
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
119119
github.com/dgraph-io/badger/v4 v4.9.4 h1:bcw+waCpzRZ2nmcSPbnPvDVhiEsn98TKmvnAhK7r7LM=
120120
github.com/dgraph-io/badger/v4 v4.9.4/go.mod h1:nJjaJTUOSsQEBhsq209FmwCvMJzEA3e74RjZw6V2pQI=
121-
github.com/dgraph-io/dgdao v0.8.0 h1:XktasJioJtpKCUT3LaM1zXeW3b34jBT3SEbAgWea3uw=
122-
github.com/dgraph-io/dgdao v0.8.0/go.mod h1:r3u8mdH7x4XfXnmMZFf/bMwPe7E+IYEg1eAZRjLcaqs=
121+
github.com/dgraph-io/dgdao v0.9.0 h1:OVY1tciW+RCjBWqH1DF8k66NEXLZRUCcgshQtdrmoDQ=
122+
github.com/dgraph-io/dgdao v0.9.0/go.mod h1:r3u8mdH7x4XfXnmMZFf/bMwPe7E+IYEg1eAZRjLcaqs=
123123
github.com/dgraph-io/dgo/v250 v250.0.0 h1:zkVj8EOgNOK3s5XFEK7CJKRdftWqg5K6qGs4HEH5TcY=
124124
github.com/dgraph-io/dgo/v250 v250.0.0/go.mod h1:OVSaapUnuqaY4beLe98CajukINwbVm0JRNp0SRBCz/w=
125125
github.com/dgraph-io/dgraph/v25 v25.3.8 h1:jDEj7zt16PZ7PGylisciEpF/lbKNGbciSORkEDcSx0Y=

migrate/fake_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,10 @@ type stubClient struct {
123123
}
124124

125125
func (c *stubClient) Insert(context.Context, any) error { return nil }
126-
func (c *stubClient) InsertRaw(context.Context, any) error { return nil }
127126
func (c *stubClient) Upsert(context.Context, any, ...string) error { return nil }
128127
func (c *stubClient) Update(context.Context, any) error { return nil }
129-
func (c *stubClient) LoadOrStore(context.Context, any, ...string) (bool, error) { return false, nil }
130-
func (c *stubClient) LoadAndDelete(context.Context, any, any, ...string) (bool, error) {
128+
func (c *stubClient) GetOrInsert(context.Context, any, ...string) (bool, error) { return false, nil }
129+
func (c *stubClient) GetAndDelete(context.Context, any, any, ...string) (bool, error) {
131130
return false, nil
132131
}
133132
func (c *stubClient) Get(context.Context, any, string) error { return nil }
@@ -146,5 +145,5 @@ func (c *stubClient) DgraphClient() (*dgo.Dgraph, func(), error) { return nil, f
146145
func (c *stubClient) WithRetry(_ context.Context, _ mg.RetryPolicy, fn func() error) error {
147146
return fn()
148147
}
149-
func (c *stubClient) InTxn(*mg.TxnContext) mg.Client { return c }
150-
func (c *stubClient) NewTxnContext(context.Context) *mg.TxnContext { return nil }
148+
func (c *stubClient) InTxn(tx *mg.Txn) *mg.ClientTxn { return mg.InTxn(tx) }
149+
func (c *stubClient) NewTxn(context.Context) *mg.Txn { return nil }

migrate/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func MarshalSchema(models ...any) (string, error) {
4646
for _, m := range models {
4747
name := modelName(m)
4848
ts := dg.NewTypeSchema()
49-
ts.Marshal("", mg.UnwrapSchema(m))
49+
ts.Marshal("", mg.AsRecord(m))
5050

5151
for pred, s := range ts.Schema {
5252
decl := strings.TrimSpace(s.String())

0 commit comments

Comments
 (0)