Skip to content

Commit ecf03b8

Browse files
authored
feat(types): migrate sqldav (#145)
1 parent 577de5c commit ecf03b8

28 files changed

+427
-3287
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ dynmgrm is the driver to issue PartiQL Statement to DynamoDB with GORM⚡
3131
- [x] With `set_delete` function
3232
- [ ] With `REMOVE` clause
3333
- [x] Delete
34-
- [x] Create Table ※ proprietary PartiQL syntax by [`btnguyen2k/godynamo`](https://github.com/btnguyen2k/godynamo)
35-
- [x] Create GSI ※ proprietary PartiQL syntax by [`btnguyen2k/godynamo`](https://github.com/btnguyen2k/godynamo)
34+
- [x] Create Table ※ proprietary PartiQL syntax by [`miyamo2/godynamo`](https://github.com/miyamo2/godynamo)
35+
- [x] Create GSI ※ proprietary PartiQL syntax by [`miyamo2/godynamo`](https://github.com/miyamo2/godynamo)
3636

3737
### Supports the following GORM features
3838

@@ -116,14 +116,15 @@ package main
116116

117117
import (
118118
"github.com/miyamo2/dynmgrm"
119+
"github.com/miyamo2/sqldav"
119120
"gorm.io/gorm"
120121
)
121122

122123
type Event struct {
123124
Name string `gorm:"primaryKey"`
124125
Date string `gorm:"primaryKey"`
125126
Host string
126-
Guest dynmgrm.Set[string]
127+
Guest sqldav.Set[string]
127128
}
128129

129130
func main() {
@@ -161,10 +162,10 @@ func main() {
161162
if event.Host == "Dave" {
162163
tx.Delete(&event)
163164
} else {
164-
tx.Model(&event).Update("guest", gorm.Expr("set_delete(guest, ?)", dynmgrm.Set[string]{"Dave"}))
165+
tx.Model(&event).Update("guest", gorm.Expr("set_delete(guest, ?)", sqldav.Set[string]{"Dave"}))
165166
}
166167
}
167-
tx.Model(&carolBirthday).Update("guest", gorm.Expr("set_add(guest, ?)", dynmgrm.Set[string]{"Dave"}))
168+
tx.Model(&carolBirthday).Update("guest", gorm.Expr("set_add(guest, ?)", sqldav.Set[string]{"Dave"}))
168169
tx.Commit()
169170

170171
var hostDateIndex []Event
@@ -198,7 +199,7 @@ Read this article for more [details](https://go.dev/blog/gopher)
198199

199200
- [btnguyen2k/godynamo](https://github.com/btnguyen2k/godynamo)
200201

201-
`dynmgrm` connects to `database/sql` by `btnguyen2k/godynamo`.
202+
`dynmgrm` connects to `database/sql` by `miyamo2/godynamo` that forked from `btnguyen2k/godynamo`.
202203

203204
- [JetBrainsMono](https://github.com/JetBrains/JetBrainsMono)
204205

attribute_value.go

-106
This file was deleted.

0 commit comments

Comments
 (0)