@@ -63,7 +63,7 @@ var userValueOps = ValueOps[*user]{
6363func TestTableEditorInsert (t * testing.T ) {
6464 t .Run ("InsertRow" , func (t * testing.T ) {
6565 set := NewIndexedSet (ueq , keyers )
66- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
66+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
6767 ed .StatementBegin (nil )
6868 require .
NoError (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " }))
6969 require .NoError (t , ed .StatementComplete (nil ))
@@ -72,14 +72,14 @@ func TestTableEditorInsert(t *testing.T) {
7272 })
7373 t .Run ("InsertDuplicateRow" , func (t * testing.T ) {
7474 set := NewIndexedSet (ueq , keyers )
75- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
75+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
7676 ed .StatementBegin (nil )
7777 require .
NoError (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " }))
7878 require .
Error (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " }))
7979 })
8080 t .Run ("InsertBadSchema" , func (t * testing.T ) {
8181 set := NewIndexedSet (ueq , keyers )
82- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
82+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
8383 ed .StatementBegin (nil )
8484 require .
Error (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"extra value" }))
8585 require .
Error (
t ,
ed .
Insert (
nil , sql.
Row {
123 ,
"[email protected] " }))
@@ -92,7 +92,7 @@ func TestTableEditorDelete(t *testing.T) {
9292 set := NewIndexedSet (ueq , keyers )
9393 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
9494 set .
Put (
& user {
"brian" ,
"[email protected] " ,
0 })
95- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
95+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
9696 ed .StatementBegin (nil )
9797 require .
NoError (
t ,
ed .
Delete (
nil , sql.
Row {
"aaron" ,
"[email protected] " }))
9898 require .NoError (t , ed .StatementComplete (nil ))
@@ -103,7 +103,7 @@ func TestTableEditorDelete(t *testing.T) {
103103 set := NewIndexedSet (ueq , keyers )
104104 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
105105 set .
Put (
& user {
"brian" ,
"[email protected] " ,
0 })
106- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
106+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
107107 ed .StatementBegin (nil )
108108 require .
NoError (
t ,
ed .
Delete (
nil , sql.
Row {
"jason" ,
"[email protected] " }))
109109 require .NoError (t , ed .StatementComplete (nil ))
@@ -115,7 +115,7 @@ func TestTableEditorDelete(t *testing.T) {
115115 set := NewIndexedSet (ueq , keyers )
116116 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
117117 set .
Put (
& user {
"brian" ,
"[email protected] " ,
0 })
118- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
118+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
119119 ed .StatementBegin (nil )
120120 require .
NoError (
t ,
ed .
Delete (
nil , sql.
Row {
"aaron" ,
"[email protected] " }))
121121 require .NoError (t , ed .StatementComplete (nil ))
@@ -130,7 +130,7 @@ func TestTableEditorUpdate(t *testing.T) {
130130 set := NewIndexedSet (ueq , keyers )
131131 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
132132 set .
Put (
& user {
"brian" ,
"[email protected] " ,
0 })
133- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
133+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
134134 ed .StatementBegin (nil )
135135 require .
NoError (
t ,
ed .
Update (
nil , sql.
Row {
"aaron" ,
"[email protected] " }, sql.
Row {
"aaron" ,
"[email protected] " }))
136136 require .NoError (t , ed .StatementComplete (nil ))
@@ -144,7 +144,7 @@ func TestTableEditorUpdate(t *testing.T) {
144144 set := NewIndexedSet (ueq , keyers )
145145 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
146146 set .
Put (
& user {
"brian" ,
"[email protected] " ,
0 })
147- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
147+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
148148 ed .StatementBegin (nil )
149149 require .
NoError (
t ,
ed .
Update (
nil , sql.
Row {
"aaron" ,
"[email protected] " }, sql.
Row {
"aaron.son" ,
"[email protected] " }))
150150 require .NoError (t , ed .StatementComplete (nil ))
@@ -163,7 +163,7 @@ func TestTableEditorUpdate(t *testing.T) {
163163 set := NewIndexedSet (ueq , keyers )
164164 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
165165 set .
Put (
& user {
"brian" ,
"[email protected] " ,
1 })
166- ed := & IndexedSetTableEditor [* user ]{set , userValueOps }
166+ ed := & IndexedSetTableEditor [* user ]{Set : set , Ops : userValueOps }
167167 ed .StatementBegin (nil )
168168 require .
NoError (
t ,
ed .
Update (
nil , sql.
Row {
"brian" ,
"[email protected] " }, sql.
Row {
"brian" ,
"[email protected] " }))
169169 require .NoError (t , ed .StatementComplete (nil ))
@@ -272,7 +272,7 @@ func TestMultiTableEditorInsert(t *testing.T) {
272272 t .Run ("InsertRow" , func (t * testing.T ) {
273273 set := NewIndexedSet (ueq , keyers )
274274 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
0 })
275- ed := & MultiIndexedSetTableEditor [* user ]{set , userPetsMultiValueOps }
275+ ed := & MultiIndexedSetTableEditor [* user ]{Set : set , Ops : userPetsMultiValueOps }
276276 ed .StatementBegin (nil )
277277 require .
NoError (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"dog" }))
278278 require .
NoError (
t ,
ed .
Insert (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"fish" }))
@@ -288,7 +288,7 @@ func TestMultiTableEditorDelete(t *testing.T) {
288288 t .Run ("DeleteRow" , func (t * testing.T ) {
289289 set := NewIndexedSet (ueq , keyers )
290290 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
userPetDog | userPetFish })
291- ed := & MultiIndexedSetTableEditor [* user ]{set , userPetsMultiValueOps }
291+ ed := & MultiIndexedSetTableEditor [* user ]{Set : set , Ops : userPetsMultiValueOps }
292292 ed .StatementBegin (nil )
293293 require .
NoError (
t ,
ed .
Delete (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"fish" }))
294294 require .
NoError (
t ,
ed .
Delete (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"cat" }))
@@ -311,7 +311,7 @@ func TestMultiTableEditorUpdate(t *testing.T) {
311311
312312 set := NewIndexedSet (ueq , keyers )
313313 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
userPetDog | userPetFish })
314- ed := & MultiIndexedSetTableEditor [* user ]{set , userPetsMultiValueOps }
314+ ed := & MultiIndexedSetTableEditor [* user ]{Set : set , Ops : userPetsMultiValueOps }
315315 ed .StatementBegin (nil )
316316 require .
NoError (
t ,
ed .
Update (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"dog" }, sql.
Row {
"aaron" ,
"[email protected] " ,
"cat" }))
317317 require .NoError (t , ed .StatementComplete (nil ))
@@ -328,7 +328,7 @@ func TestMultiTableEditorUpdate(t *testing.T) {
328328 // exist.
329329 set = NewIndexedSet (ueq , keyers )
330330 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
userPetDog | userPetFish })
331- ed = & MultiIndexedSetTableEditor [* user ]{set , userPetsMultiValueOps }
331+ ed = & MultiIndexedSetTableEditor [* user ]{Set : set , Ops : userPetsMultiValueOps }
332332 ed .StatementBegin (nil )
333333 require .
Error (
t ,
ed .
Update (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"dog" }, sql.
Row {
"aaron.son" ,
"[email protected] " ,
"cat" }))
334334
@@ -337,7 +337,7 @@ func TestMultiTableEditorUpdate(t *testing.T) {
337337 set = NewIndexedSet (ueq , keyers )
338338 set .
Put (
& user {
"aaron" ,
"[email protected] " ,
userPetDog | userPetCat })
339339 set .
Put (
& user {
"brian" ,
"[email protected] " ,
userPetDog })
340- ed = & MultiIndexedSetTableEditor [* user ]{set , userPetsMultiValueOps }
340+ ed = & MultiIndexedSetTableEditor [* user ]{Set : set , Ops : userPetsMultiValueOps }
341341 ed .StatementBegin (nil )
342342 require .
NoError (
t ,
ed .
Update (
nil , sql.
Row {
"aaron" ,
"[email protected] " ,
"dog" }, sql.
Row {
"brian" ,
"[email protected] " ,
"cat" }))
343343 require .NoError (t , ed .StatementComplete (nil ))
0 commit comments