Query execution speed up.
This commit is contained in:
parent
5bff434eb0
commit
e0327bef69
10 changed files with 645 additions and 266 deletions
|
|
@ -18,8 +18,6 @@ func TestAllTypesSelect(t *testing.T) {
|
|||
fmt.Println(err)
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Equal(t, len(dest), 2)
|
||||
|
||||
assert.DeepEqual(t, dest[0], allTypesRow0)
|
||||
assert.DeepEqual(t, dest[1], allTypesRow1)
|
||||
}
|
||||
|
|
@ -98,7 +96,7 @@ func TestExpressionOperators(t *testing.T) {
|
|||
RAW("current_database()"),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -159,11 +157,11 @@ func TestStringOperators(t *testing.T) {
|
|||
TO_HEX(AllTypes.IntegerPtr),
|
||||
)
|
||||
|
||||
_, args, _ := query.Sql()
|
||||
//_, args, _ := query.Sql()
|
||||
|
||||
fmt.Println(query.Sql())
|
||||
fmt.Println(args[15])
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.Sql())
|
||||
//fmt.Println(args[15])
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -190,7 +188,7 @@ func TestBoolOperators(t *testing.T) {
|
|||
AllTypes.Boolean.OR(AllTypes.Boolean).EQ(AllTypes.Boolean.AND(AllTypes.Boolean)),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -240,7 +238,7 @@ func TestFloatOperators(t *testing.T) {
|
|||
TRUNC(AllTypes.Decimal, Int(1)),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -287,7 +285,7 @@ func TestIntegerOperators(t *testing.T) {
|
|||
CBRT(AllTypes.Integer),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -348,7 +346,7 @@ func TestTimeOperators(t *testing.T) {
|
|||
NOW(),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
//fmt.Println(query.DebugSql())
|
||||
|
||||
err := query.Query(db, &struct{}{})
|
||||
|
||||
|
|
@ -522,7 +520,7 @@ FROM`
|
|||
).
|
||||
FROM(subQuery)
|
||||
|
||||
fmt.Println(stmt2.DebugSql())
|
||||
//fmt.Println(stmt2.DebugSql())
|
||||
|
||||
assertStatementSql(t, stmt2, expectedSql+expected.sql+";\n", expected.args...)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
. "github.com/go-jet/jet"
|
||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/chinook/model"
|
||||
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/chinook/table"
|
||||
|
|
@ -105,12 +104,106 @@ func TestJoinEverything(t *testing.T) {
|
|||
err := stmt.Query(db, &dest)
|
||||
|
||||
assert.NilError(t, err)
|
||||
//jsonSave(dest)
|
||||
|
||||
fmt.Println("Artist count :", len(dest))
|
||||
assert.Equal(t, len(dest), 275)
|
||||
|
||||
assertJson(t, "./testdata/joined_everything.json", dest)
|
||||
assertJsonFile(t, "./testdata/joined_everything.json", dest)
|
||||
}
|
||||
|
||||
func TestSelfJoin(t *testing.T) {
|
||||
var dest []struct {
|
||||
model.Employee
|
||||
|
||||
Manager *model.Employee `alias:"Manager.*"`
|
||||
}
|
||||
|
||||
manager := Employee.AS("Manager")
|
||||
|
||||
stmt := Employee.
|
||||
LEFT_JOIN(manager, Employee.ReportsTo.EQ(manager.EmployeeId)).
|
||||
SELECT(
|
||||
Employee.EmployeeId,
|
||||
Employee.FirstName,
|
||||
Employee.LastName,
|
||||
manager.EmployeeId,
|
||||
manager.FirstName,
|
||||
manager.LastName,
|
||||
).
|
||||
ORDER_BY(Employee.EmployeeId)
|
||||
|
||||
assertStatementSql(t, stmt, `
|
||||
SELECT "Employee"."EmployeeId" AS "Employee.EmployeeId",
|
||||
"Employee"."FirstName" AS "Employee.FirstName",
|
||||
"Employee"."LastName" AS "Employee.LastName",
|
||||
"Manager"."EmployeeId" AS "Manager.EmployeeId",
|
||||
"Manager"."FirstName" AS "Manager.FirstName",
|
||||
"Manager"."LastName" AS "Manager.LastName"
|
||||
FROM chinook."Employee"
|
||||
LEFT JOIN chinook."Employee" AS "Manager" ON ("Employee"."ReportsTo" = "Manager"."EmployeeId")
|
||||
ORDER BY "Employee"."EmployeeId";
|
||||
`)
|
||||
|
||||
err := stmt.Query(db, &dest)
|
||||
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, len(dest), 8)
|
||||
assertJson(t, dest[0:2], `
|
||||
[
|
||||
{
|
||||
"EmployeeId": 1,
|
||||
"LastName": "Adams",
|
||||
"FirstName": "Andrew",
|
||||
"Title": null,
|
||||
"ReportsTo": null,
|
||||
"BirthDate": null,
|
||||
"HireDate": null,
|
||||
"Address": null,
|
||||
"City": null,
|
||||
"State": null,
|
||||
"Country": null,
|
||||
"PostalCode": null,
|
||||
"Phone": null,
|
||||
"Fax": null,
|
||||
"Email": null,
|
||||
"Manager": null
|
||||
},
|
||||
{
|
||||
"EmployeeId": 2,
|
||||
"LastName": "Edwards",
|
||||
"FirstName": "Nancy",
|
||||
"Title": null,
|
||||
"ReportsTo": null,
|
||||
"BirthDate": null,
|
||||
"HireDate": null,
|
||||
"Address": null,
|
||||
"City": null,
|
||||
"State": null,
|
||||
"Country": null,
|
||||
"PostalCode": null,
|
||||
"Phone": null,
|
||||
"Fax": null,
|
||||
"Email": null,
|
||||
"Manager": {
|
||||
"EmployeeId": 1,
|
||||
"LastName": "Adams",
|
||||
"FirstName": "Andrew",
|
||||
"Title": null,
|
||||
"ReportsTo": null,
|
||||
"BirthDate": null,
|
||||
"HireDate": null,
|
||||
"Address": null,
|
||||
"City": null,
|
||||
"State": null,
|
||||
"Country": null,
|
||||
"PostalCode": null,
|
||||
"Phone": null,
|
||||
"Fax": null,
|
||||
"Email": null
|
||||
}
|
||||
}
|
||||
]
|
||||
`)
|
||||
|
||||
}
|
||||
|
||||
func TestUnionForQuotedNames(t *testing.T) {
|
||||
|
|
@ -121,7 +214,7 @@ func TestUnionForQuotedNames(t *testing.T) {
|
|||
).
|
||||
ORDER_BY(Album.AlbumId)
|
||||
|
||||
fmt.Println(stmt.DebugSql())
|
||||
//fmt.Println(stmt.DebugSql())
|
||||
assertStatementSql(t, stmt, `
|
||||
(
|
||||
(
|
||||
|
|
@ -242,10 +335,17 @@ ORDER BY "first10Artist"."Artist.ArtistId";
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
spew.Dump(dest)
|
||||
//spew.Dump(dest)
|
||||
}
|
||||
|
||||
func assertJson(t *testing.T, jsonFilePath string, data interface{}) {
|
||||
func assertJson(t *testing.T, data interface{}, expectedJson string) {
|
||||
jsonData, err := json.MarshalIndent(data, "", "\t")
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Equal(t, "\n"+string(jsonData)+"\n", expectedJson)
|
||||
}
|
||||
|
||||
func assertJsonFile(t *testing.T, jsonFilePath string, data interface{}) {
|
||||
fileJsonData, err := ioutil.ReadFile(jsonFilePath)
|
||||
assert.NilError(t, err)
|
||||
|
||||
|
|
@ -253,6 +353,7 @@ func assertJson(t *testing.T, jsonFilePath string, data interface{}) {
|
|||
assert.NilError(t, err)
|
||||
|
||||
assert.Assert(t, string(fileJsonData) == string(jsonData))
|
||||
//assert.Equal(t, string(fileJsonData), string(jsonData))
|
||||
}
|
||||
|
||||
func jsonPrint(v interface{}) {
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ INSERT INTO test_sample.link VALUES
|
|||
}
|
||||
|
||||
func TestInsertModelObject(t *testing.T) {
|
||||
cleanUpLinkTable(t)
|
||||
var expectedSql = `
|
||||
INSERT INTO test_sample.link (url, name) VALUES
|
||||
('http://www.duckduckgo.com', 'Duck Duck go');
|
||||
|
|
|
|||
|
|
@ -6,25 +6,29 @@ import (
|
|||
. "github.com/go-jet/jet"
|
||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/model"
|
||||
. "github.com/go-jet/jet/tests/.gentestdata/jetdb/test_sample/table"
|
||||
"github.com/google/uuid"
|
||||
"gotest.tools/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestUUIDType(t *testing.T) {
|
||||
query := AllTypes.
|
||||
SELECT(AllTypes.AllColumns).
|
||||
SELECT(AllTypes.UUID, AllTypes.UUIDPtr).
|
||||
WHERE(AllTypes.UUID.EQ(String("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11")))
|
||||
|
||||
queryStr, args, err := query.Sql()
|
||||
assertStatementSql(t, query, `
|
||||
SELECT all_types.uuid AS "all_types.uuid",
|
||||
all_types.uuid_ptr AS "all_types.uuid_ptr"
|
||||
FROM test_sample.all_types
|
||||
WHERE all_types.uuid = 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11';
|
||||
`, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11")
|
||||
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, len(args), 1)
|
||||
fmt.Println(queryStr)
|
||||
//assert.Equal(t, queryStr, `SELECT all_types.character AS "all_types.character", all_types.character_varying AS "all_types.character_varying", all_types.text AS "all_types.text", all_types.bytea AS "all_types.bytea", all_types.timestamp_without_time_zone AS "all_types.timestamp_without_time_zone", all_types.timestamp_with_time_zone AS "all_types.timestamp_with_time_zone", all_types.uuid AS "all_types.uuid", all_types.json AS "all_types.json", all_types.jsonb AS "all_types.jsonb" FROM test_sample.all_types WHERE all_types.uuid = 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11`)
|
||||
result := model.AllTypes{}
|
||||
|
||||
err = query.Query(db, &result)
|
||||
spew.Dump(result)
|
||||
err := query.Query(db, &result)
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, result.UUID, uuid.MustParse("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"))
|
||||
assert.DeepEqual(t, result.UUIDPtr, uuidPtr("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"))
|
||||
}
|
||||
|
||||
func TestEnumType(t *testing.T) {
|
||||
|
|
@ -120,7 +124,25 @@ ORDER BY employee.employee_id;
|
|||
func TestWierdNamesTable(t *testing.T) {
|
||||
stmt := WeirdNamesTable.SELECT(WeirdNamesTable.AllColumns)
|
||||
|
||||
fmt.Println(stmt.DebugSql())
|
||||
assertStatementSql(t, stmt, `
|
||||
SELECT "WEIRD NAMES TABLE".weird_column_name1 AS "WEIRD NAMES TABLE.weird_column_name1",
|
||||
"WEIRD NAMES TABLE"."Weird_Column_Name2" AS "WEIRD NAMES TABLE.Weird_Column_Name2",
|
||||
"WEIRD NAMES TABLE"."wEiRd_cOluMn_nAmE3" AS "WEIRD NAMES TABLE.wEiRd_cOluMn_nAmE3",
|
||||
"WEIRD NAMES TABLE"."WeIrd_CoLuMN_Name4" AS "WEIRD NAMES TABLE.WeIrd_CoLuMN_Name4",
|
||||
"WEIRD NAMES TABLE"."WEIRD_COLUMN_NAME5" AS "WEIRD NAMES TABLE.WEIRD_COLUMN_NAME5",
|
||||
"WEIRD NAMES TABLE"."WeirdColumnName6" AS "WEIRD NAMES TABLE.WeirdColumnName6",
|
||||
"WEIRD NAMES TABLE"."weirdColumnName7" AS "WEIRD NAMES TABLE.weirdColumnName7",
|
||||
"WEIRD NAMES TABLE".weirdcolumnname8 AS "WEIRD NAMES TABLE.weirdcolumnname8",
|
||||
"WEIRD NAMES TABLE"."weird col name9" AS "WEIRD NAMES TABLE.weird col name9",
|
||||
"WEIRD NAMES TABLE"."wEiRd cOlu nAmE10" AS "WEIRD NAMES TABLE.wEiRd cOlu nAmE10",
|
||||
"WEIRD NAMES TABLE"."WEIRD COLU NAME11" AS "WEIRD NAMES TABLE.WEIRD COLU NAME11",
|
||||
"WEIRD NAMES TABLE"."Weird Colu Name12" AS "WEIRD NAMES TABLE.Weird Colu Name12",
|
||||
"WEIRD NAMES TABLE"."weird-col-name13" AS "WEIRD NAMES TABLE.weird-col-name13",
|
||||
"WEIRD NAMES TABLE"."wEiRd-cOlu-nAmE14" AS "WEIRD NAMES TABLE.wEiRd-cOlu-nAmE14",
|
||||
"WEIRD NAMES TABLE"."WEIRD-COLU-NAME15" AS "WEIRD NAMES TABLE.WEIRD-COLU-NAME15",
|
||||
"WEIRD NAMES TABLE"."Weird-Colu-Name16" AS "WEIRD NAMES TABLE.Weird-Colu-Name16"
|
||||
FROM test_sample."WEIRD NAMES TABLE";
|
||||
`)
|
||||
|
||||
dest := []model.WeirdNamesTable{}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
. "github.com/go-jet/jet"
|
||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/dvds/enum"
|
||||
"github.com/go-jet/jet/tests/.gentestdata/jetdb/dvds/model"
|
||||
|
|
@ -158,7 +156,6 @@ LIMIT 12;
|
|||
).
|
||||
LIMIT(12)
|
||||
|
||||
fmt.Println(query.Sql())
|
||||
assertStatementSql(t, query, expectedSql, int64(1), int64(1), int64(10), int64(1), int64(2), int64(1), int64(12))
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +250,6 @@ LIMIT 1000;
|
|||
assert.Equal(t, len(languageActorFilm[0].Films), 10)
|
||||
assert.Equal(t, len(languageActorFilm[0].Films[0].Actors), 10)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestJoinQuerySlice(t *testing.T) {
|
||||
|
|
@ -487,6 +483,97 @@ ORDER BY city.city_id, address.address_id, customer.customer_id;
|
|||
assert.Equal(t, *dest[0].Customers[1].LastName, "Vines")
|
||||
}
|
||||
|
||||
func TestExecution4(t *testing.T) {
|
||||
|
||||
var dest []struct {
|
||||
CityID int32 `sql:"primary_key" alias:"city.city_id"`
|
||||
CityName string `alias:"city.city"`
|
||||
|
||||
Customers []struct {
|
||||
CustomerID int32 `sql:"primary_key" alias:"customer_id"`
|
||||
LastName *string `alias:"last_name"`
|
||||
|
||||
Address struct {
|
||||
AddressID int32 `sql:"primary_key" alias:"AddressId"`
|
||||
AddressLine string `alias:"address.address"`
|
||||
} `alias:"address.*"`
|
||||
} `alias:"customer"`
|
||||
}
|
||||
|
||||
stmt := City.
|
||||
INNER_JOIN(Address, Address.CityID.EQ(City.CityID)).
|
||||
INNER_JOIN(Customer, Customer.AddressID.EQ(Address.AddressID)).
|
||||
SELECT(
|
||||
City.CityID,
|
||||
City.City,
|
||||
Customer.CustomerID,
|
||||
Customer.LastName,
|
||||
Address.AddressID,
|
||||
Address.Address,
|
||||
).
|
||||
WHERE(City.City.EQ(String("London")).OR(City.City.EQ(String("York")))).
|
||||
ORDER_BY(City.CityID, Address.AddressID, Customer.CustomerID)
|
||||
|
||||
assertStatementSql(t, stmt, `
|
||||
SELECT city.city_id AS "city.city_id",
|
||||
city.city AS "city.city",
|
||||
customer.customer_id AS "customer.customer_id",
|
||||
customer.last_name AS "customer.last_name",
|
||||
address.address_id AS "address.address_id",
|
||||
address.address AS "address.address"
|
||||
FROM dvds.city
|
||||
INNER JOIN dvds.address ON (address.city_id = city.city_id)
|
||||
INNER JOIN dvds.customer ON (customer.address_id = address.address_id)
|
||||
WHERE (city.city = 'London') OR (city.city = 'York')
|
||||
ORDER BY city.city_id, address.address_id, customer.customer_id;
|
||||
`, "London", "York")
|
||||
|
||||
err := stmt.Query(db, &dest)
|
||||
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, len(dest), 2)
|
||||
assertJson(t, dest, `
|
||||
[
|
||||
{
|
||||
"CityID": 312,
|
||||
"CityName": "London",
|
||||
"Customers": [
|
||||
{
|
||||
"CustomerID": 252,
|
||||
"LastName": "Hoffman",
|
||||
"Address": {
|
||||
"AddressID": 256,
|
||||
"AddressLine": "1497 Yuzhou Drive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CustomerID": 512,
|
||||
"LastName": "Vines",
|
||||
"Address": {
|
||||
"AddressID": 517,
|
||||
"AddressLine": "548 Uruapan Street"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"CityID": 589,
|
||||
"CityName": "York",
|
||||
"Customers": [
|
||||
{
|
||||
"CustomerID": 497,
|
||||
"LastName": "Sledge",
|
||||
"Address": {
|
||||
"AddressID": 502,
|
||||
"AddressLine": "1515 Korla Way"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
`)
|
||||
}
|
||||
|
||||
func TestJoinQuerySliceWithPtrs(t *testing.T) {
|
||||
type FilmsPerLanguage struct {
|
||||
Language model.Language
|
||||
|
|
@ -810,8 +897,6 @@ FROM dvds.actor
|
|||
rRatingFilms.AllColumns(),
|
||||
)
|
||||
|
||||
fmt.Println(query.DebugSql())
|
||||
|
||||
assertStatementSql(t, query, expectedQuery)
|
||||
|
||||
dest := []model.Actor{}
|
||||
|
|
@ -875,7 +960,6 @@ ORDER BY film.film_id ASC;
|
|||
WHERE(Film.RentalRate.EQ(maxFilmRentalRate)).
|
||||
ORDER_BY(Film.FilmID.ASC())
|
||||
|
||||
fmt.Println(query.Sql())
|
||||
assertStatementSql(t, query, expectedSql)
|
||||
|
||||
maxRentalRateFilms := []model.Film{}
|
||||
|
|
@ -1039,7 +1123,36 @@ func TestSelectStaff(t *testing.T) {
|
|||
|
||||
assert.NilError(t, err)
|
||||
|
||||
spew.Dump(staffs)
|
||||
assertJson(t, staffs, `
|
||||
[
|
||||
{
|
||||
"StaffID": 1,
|
||||
"FirstName": "Mike",
|
||||
"LastName": "Hillyer",
|
||||
"AddressID": 3,
|
||||
"Email": "Mike.Hillyer@sakilastaff.com",
|
||||
"StoreID": 1,
|
||||
"Active": true,
|
||||
"Username": "Mike",
|
||||
"Password": "8cb2237d0679ca88db6464eac60da96345513964",
|
||||
"LastUpdate": "2006-05-16T16:13:11.79328Z",
|
||||
"Picture": "iVBORw0KWgo="
|
||||
},
|
||||
{
|
||||
"StaffID": 2,
|
||||
"FirstName": "Jon",
|
||||
"LastName": "Stephens",
|
||||
"AddressID": 4,
|
||||
"Email": "Jon.Stephens@sakilastaff.com",
|
||||
"StoreID": 2,
|
||||
"Active": true,
|
||||
"Username": "Jon",
|
||||
"Password": "8cb2237d0679ca88db6464eac60da96345513964",
|
||||
"LastUpdate": "2006-05-16T16:13:11.79328Z",
|
||||
"Picture": null
|
||||
}
|
||||
]
|
||||
`)
|
||||
}
|
||||
|
||||
func TestSelectTimeColumns(t *testing.T) {
|
||||
|
|
@ -1114,9 +1227,6 @@ OFFSET 20;
|
|||
LIMIT(10).
|
||||
OFFSET(20)
|
||||
|
||||
queryStr, _, _ := query.Sql()
|
||||
|
||||
fmt.Println("-" + queryStr + "-")
|
||||
assertStatementSql(t, query, expectedQuery, float64(100), float64(200), int64(10), int64(20))
|
||||
|
||||
dest := []model.Payment{}
|
||||
|
|
@ -1396,7 +1506,7 @@ ORDER BY actor.actor_id ASC, film.film_id ASC;
|
|||
assert.NilError(t, err)
|
||||
|
||||
//jsonSave("./testdata/quick-start-dest.json", dest)
|
||||
assertJson(t, "./testdata/quick-start-dest.json", dest)
|
||||
assertJsonFile(t, "./testdata/quick-start-dest.json", dest)
|
||||
|
||||
var dest2 []struct {
|
||||
model.Category
|
||||
|
|
@ -1409,7 +1519,7 @@ ORDER BY actor.actor_id ASC, film.film_id ASC;
|
|||
assert.NilError(t, err)
|
||||
|
||||
//jsonSave("./testdata/quick-start-dest2.json", dest2)
|
||||
assertJson(t, "./testdata/quick-start-dest2.json", dest2)
|
||||
assertJsonFile(t, "./testdata/quick-start-dest2.json", dest2)
|
||||
}
|
||||
|
||||
func TestQuickStartWithSubQueries(t *testing.T) {
|
||||
|
|
@ -1461,7 +1571,7 @@ func TestQuickStartWithSubQueries(t *testing.T) {
|
|||
assert.NilError(t, err)
|
||||
|
||||
//jsonSave("./testdata/quick-start-dest.json", dest)
|
||||
assertJson(t, "./testdata/quick-start-dest.json", dest)
|
||||
assertJsonFile(t, "./testdata/quick-start-dest.json", dest)
|
||||
|
||||
var dest2 []struct {
|
||||
model.Category
|
||||
|
|
@ -1474,5 +1584,5 @@ func TestQuickStartWithSubQueries(t *testing.T) {
|
|||
assert.NilError(t, err)
|
||||
|
||||
//jsonSave("./testdata/quick-start-dest2.json", dest2)
|
||||
assertJson(t, "./testdata/quick-start-dest2.json", dest2)
|
||||
assertJsonFile(t, "./testdata/quick-start-dest2.json", dest2)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ UPDATE test_sample.link
|
|||
SET (name, url) = ('Bong', 'http://bong.com')
|
||||
WHERE link.name = 'Bing';
|
||||
`
|
||||
fmt.Println(query.Sql())
|
||||
|
||||
assertStatementSql(t, query, expectedSql, "Bong", "http://bong.com", "Bing")
|
||||
|
||||
assertExec(t, query, 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue