diff options
Diffstat (limited to 'oblast.go')
| -rw-r--r-- | oblast.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -24,9 +24,7 @@ // // Then use it many times to perform load and store operations: // -// func doStuff(db *sql.DB) error { -// dbh := oblast.Wrap(db) -// +// func doStuff(db *oblast.DB) error { // newEntry := LogEntry{ // CreatedAt: time.Now(), // Message: "Hello World.", @@ -44,6 +42,10 @@ // fmt.Printf("there are %d log entries so far", len(allEntries)) // } // +// In this example, "oblast.DB" is a thin wrapper around [*sql.DB], which can be obtained with the [NewDB] function. +// A [*DB] can be used in the same way as an [*sql.DB], but if Oblast is only to be used for specific functions, +// then individual [*sql.Conn] or [*sql.Tx] instances can also be wrapped with the [NewConn] and [NewTx] functions. +// // # Mapping rules for record types // // If the database column has a different name (or casing, e.g. "id" vs. "ID") than the field name, provide it in the field tag "db". @@ -133,9 +135,7 @@ func StructTagKeyIs(key string) PlanOption { return func(opts *planOpts) { opts.StructTagKey = key } } -// Store is the main interface of this library. -// -// It holds information on how to read and write data into record type R, +// Store holds information on how to read and write data into record type R, // and can also be used to execute autogenerated queries if the respective [PlanOption] values were provided during [NewStore]. type Store[R any] struct { dialect Dialect |
