@@ -968,7 +968,7 @@ func (c *SecondLevelCache) UpdateByQueryBuilder(ctx context.Context, tx *Tx, bui
968968 }
969969 foundValues = values
970970 } else {
971- sql , args := builder .SelectSQL (c .typ )
971+ sql , args := builder .SelectSQL (c .valueFactory , c . typ )
972972 rows , err := tx .conn .QueryContext (ctx , sql , args ... )
973973 if err != nil {
974974 return xerrors .Errorf ("failed sql %s %v: %w" , sql , args , err )
@@ -989,7 +989,7 @@ func (c *SecondLevelCache) UpdateByQueryBuilder(ctx context.Context, tx *Tx, bui
989989 log .GetFromDB (tx .id , sql , "" , value )
990990 }
991991 }
992- sql , values := builder .UpdateSQL (updateMap )
992+ sql , values := builder .UpdateSQL (c . valueFactory , updateMap )
993993 if _ , err := tx .conn .ExecContext (ctx , sql , values ... ); err != nil {
994994 return xerrors .Errorf ("failed update sql %s %v: %w" , sql , values , err )
995995 }
@@ -1297,7 +1297,8 @@ func (c *SecondLevelCache) isUsedPrimaryKeyBuilder(queries *Queries) bool {
12971297}
12981298
12991299func (c * SecondLevelCache ) deleteCacheFromSQL (ctx context.Context , tx * Tx , builder * QueryBuilder ) (e error ) {
1300- sql , args := builder .SelectSQL (c .typ )
1300+ sql , args := builder .SelectSQL (c .valueFactory , c .typ )
1301+
13011302 rows , err := tx .conn .QueryContext (ctx , sql , args ... )
13021303 if err != nil {
13031304 return xerrors .Errorf ("failed sql %s %v: %w" , sql , args , err )
@@ -1332,7 +1333,7 @@ func (c *SecondLevelCache) DeleteByQueryBuilder(ctx context.Context, tx *Tx, bui
13321333 return xerrors .Errorf ("failed to delete cache by SQL: %w" , err )
13331334 }
13341335 }
1335- sql , args := builder .DeleteSQL ()
1336+ sql , args := builder .DeleteSQL (c . valueFactory )
13361337 if _ , err := tx .conn .ExecContext (ctx , sql , args ... ); err != nil {
13371338 return xerrors .Errorf ("failed sql %s %v: %w" , sql , args , err )
13381339 }
@@ -1355,7 +1356,7 @@ func (c *SecondLevelCache) DeleteByQueryBuilder(ctx context.Context, tx *Tx, bui
13551356 }
13561357 }
13571358 }
1358- sql , args := builder .DeleteSQL ()
1359+ sql , args := builder .DeleteSQL (c . valueFactory )
13591360 if _ , err := tx .conn .ExecContext (ctx , sql , args ... ); err != nil {
13601361 return xerrors .Errorf ("failed sql %s %v: %w" , sql , args , err )
13611362 }
@@ -1409,7 +1410,7 @@ func (c *SecondLevelCache) deleteKeyByValue(tx *Tx, value *StructValue) error {
14091410}
14101411
14111412func (c * SecondLevelCache ) findValuesByQueryBuilderWithoutCache (ctx context.Context , tx * Tx , builder * QueryBuilder ) (ssv * StructSliceValue , e error ) {
1412- sql , args := builder .SelectSQL (c .typ )
1413+ sql , args := builder .SelectSQL (c .valueFactory , c . typ )
14131414 rows , err := tx .conn .QueryContext (ctx , sql , args ... )
14141415 if err != nil {
14151416 return nil , xerrors .Errorf ("failed sql %s %v: %w" , sql , args , err )
0 commit comments