Skip to content

Releases: dgraph-io/dgdao

v0.9.0

Choose a tag to compare

@mlwelles mlwelles released this 19 Jul 14:47
a6d635f

Breaking API redesign of the client and transaction surface.

  • breaking: rename TxnContext -> Txn and NewTxnContext -> NewTxn
  • breaking: InTxn now returns an exported, curated *ClientTxn (was the interface-typed Client): a transaction-scoped client that carries only record data-ops. Connection lifecycle (Close, WithRetry, schema and drop operations) and transaction entry (NewTxn, InTxn) are absent rather than hidden, so starting a transaction from within a transaction is unrepresentable at the type level. A package-level InTxn(tx *Txn) *ClientTxn is the sole constructor; Client.InTxn delegates to it
  • feat: add ClientCore, the narrow record data-ops interface (Get, Insert, Upsert, Update, Delete, GetOrInsert, GetAndDelete, Query, QueryRaw) satisfied by both the connection Client and *ClientTxn; Client embeds it, and typed.Client[T], typed.Query[T], and typed.MultiQuery[T] bind to it so one typed client serves both the connection and transaction modes
  • breaking: rename LoadOrStore -> GetOrInsert and LoadAndDelete -> GetAndDelete across the untyped and typed clients, with docs that lead with the operation, the single-winner concurrency contract, and the use cases (idempotent creation; single-use token consume); the cf. sync.Map lineage notes remain
  • breaking: typed Client[T].Add -> Insert; typed clients gain QueryRaw and drop Iter (iterate via Query(ctx).IterNodes()) and NewTxnContext (transaction entry is a connection-client concern)
  • breaking: delete the vestigial InsertRaw (identical to Insert since the unique-check unification) and the load-test RAW_INSERT mode built on it
  • breaking: fold the generated-wrapper base into core as Entity[R] / AsEntity / Record(); UnwrapSchema -> AsRecord, probing Record(); the Schema marker interface -> Record (RecordTypeName)

v0.8.0

Choose a tag to compare

@mlwelles mlwelles released this 18 Jul 03:35
13fc6ed

Adds a transaction-scoped client: Client.InTxn(tx) and typed.Client[T].InTxn(tx) return clients whose full surface runs inside a caller-managed transaction (reads join the read-set; writes stage; commit via tx.Commit()), plus typed.Client[T].NewTxnContext. A typed WhereEdge query built via InTxn runs its edge pre-pass in the same transaction. BREAKING: v0.7.0's TxnContext.Insert/Upsert/Update are removed — those Client-level writes now live on the scoped InTxn client; TxnContext keeps lifecycle + graph primitives (DeleteEdge/DeleteNode/DeletePredicate). See CHANGELOG.

v0.7.0

Choose a tag to compare

@mlwelles mlwelles released this 17 Jul 22:38
60473ef

Adds Client.NewTxnContext — a validated, deferred-commit read-write transaction for multi-mutation atomic writes (Upsert/Update/Insert/DeleteEdge/DeleteNode/DeletePredicate), with the same validation and unique-error handling as the single-shot methods. See CHANGELOG.md.

v0.6.1

Choose a tag to compare

@matthewmcneely matthewmcneely released this 16 Jul 20:00
0da0359

What's Changed

Full Changelog: v0.6.0...v0.6.1

v0.6.0

Choose a tag to compare

@mlwelles mlwelles released this 10 Jul 20:50
7e1b881

What's new

  • feat: Defaulter hook — dgdao now calls ApplyDefaults(ctx) on the model before validation in Insert, Upsert, Update, and LoadOrStore (not LoadAndDelete), so a model can populate default field values before a write. Because it runs before validation, a defaulted field can satisfy a validate:"required" rule. Applies per-element across slices for batch writes.

Purely additive — models that don't implement Defaulter are unaffected. See DEFAULTER.md.

v0.5.4

Choose a tag to compare

@mlwelles mlwelles released this 09 Jul 16:25
690646b

What's Changed

  • docs: add Extensions section for the companion projects by @mlwelles in #3
  • chore(deps): pin dgraph/v25 to released v25.3.8 by @mlwelles in #4

New Contributors

Full Changelog: v0.5.3...v0.5.4

v0.5.3

Choose a tag to compare

@mlwelles mlwelles released this 07 Jul 21:57
7f51c74

What's Changed

New Contributors

Full Changelog: v0.5.2...v0.5.3