@@ -9,10 +9,11 @@ package common_test
99import (
1010 "testing"
1111
12- q "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/sql/query"
13- qcommon "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/sql/query/common"
14- "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/sql/query/cond"
15- "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/sql/sqlite"
12+ q "github.com/hyperledger-labs/fabric-token-sdk/token/services/storage/db/sql/query"
13+ qcommon "github.com/hyperledger-labs/fabric-token-sdk/token/services/storage/db/sql/query/common"
14+ "github.com/hyperledger-labs/fabric-token-sdk/token/services/storage/db/sql/query/cond"
15+
16+ common "github.com/hyperledger-labs/fabric-token-sdk/token/services/storage/db/sql/common"
1617 "github.com/stretchr/testify/assert"
1718)
1819
@@ -22,23 +23,23 @@ func TestSelect_Compile(t *testing.T) {
2223 FieldsByName ("id" , "name" ).
2324 From (q .Table ("users" )).
2425 Where (cond .Eq ("id" , 1 )).
25- Format (sqlite . NewConditionInterpreter ())
26+ Format (common . NewTestInterpreter ())
2627 assert .Equal (t , "SELECT id, name FROM users WHERE id = $1" , query )
2728 assert .Equal (t , 1 , args [0 ])
2829
2930 // SELECT DISTINCT
3031 query , args = q .SelectDistinct ().
3132 FieldsByName ("email_id" ).
3233 From (q .Table ("customers" )).
33- Format (sqlite . NewConditionInterpreter ())
34+ Format (common . NewTestInterpreter ())
3435 assert .Equal (t , "SELECT DISTINCT email_id FROM customers" , query )
3536 assert .Empty (t , args )
3637
3738 // No columns selected
3839 query , args = q .Select ().
3940 AllFields ().
4041 From (q .Table ("users" )).
41- Format (sqlite . NewConditionInterpreter ())
42+ Format (common . NewTestInterpreter ())
4243 assert .Equal (t , "SELECT * FROM users" , query )
4344 assert .Empty (t , args )
4445}
@@ -60,7 +61,7 @@ func TestUpdate_Compile(t *testing.T) {
6061 Set ("name" , "TheName" ).
6162 Set ("age" , 16 ).
6263 Where (cond .Eq ("id" , 1 )).
63- Format (sqlite . NewConditionInterpreter ())
64+ Format (common . NewTestInterpreter ())
6465 assert .Equal (t , "UPDATE users SET name = $1, age = $2 WHERE id = $3" , query )
6566 assert .Equal (t , "TheName" , args [0 ])
6667 assert .Equal (t , 16 , args [1 ])
@@ -71,7 +72,7 @@ func TestDelete_Compile(t *testing.T) {
7172 // Simple DELETE
7273 query , args := q .DeleteFrom ("users" ).
7374 Where (cond .Eq ("id" , 1 )).
74- Format (sqlite . NewConditionInterpreter ())
75+ Format (common . NewTestInterpreter ())
7576 assert .Equal (t , "DELETE FROM users WHERE id = $1" , query )
7677 assert .Equal (t , 1 , args [0 ])
7778}
@@ -81,7 +82,7 @@ func TestDelete_Compile(t *testing.T) {
8182// numbering continuing across branches and args concatenated in order.
8283// This is the pattern used by UnspentTokensIteratorBy.
8384func TestUnionAll_Compile (t * testing.T ) {
84- ci := sqlite . NewConditionInterpreter ()
85+ ci := common . NewTestInterpreter ()
8586
8687 branch1 := q .Select ().
8788 FieldsByName ("id" , "name" ).
0 commit comments