MySQL bool expressions.
This commit is contained in:
parent
bffa102849
commit
d0533f73fb
37 changed files with 720 additions and 436 deletions
|
|
@ -31,7 +31,7 @@ RETURNING link.id AS "link.id",
|
|||
VALUES(102, "http://www.yahoo.com", "Yahoo", nil).
|
||||
RETURNING(Link.AllColumns)
|
||||
|
||||
testutils.AssertStatementSql(t, insertQuery, expectedSQL,
|
||||
testutils.AssertDebugStatementSql(t, insertQuery, expectedSQL,
|
||||
100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial",
|
||||
101, "http://www.google.com", "Google",
|
||||
102, "http://www.yahoo.com", "Yahoo", nil)
|
||||
|
|
@ -85,7 +85,7 @@ INSERT INTO test_sample.link VALUES
|
|||
stmt := Link.INSERT().
|
||||
VALUES(100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial", DEFAULT)
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, expectedSQL,
|
||||
testutils.AssertDebugStatementSql(t, stmt, expectedSQL,
|
||||
100, "http://www.postgresqltutorial.com", "PostgreSQL Tutorial")
|
||||
|
||||
assertExec(t, stmt, 1)
|
||||
|
|
@ -107,7 +107,7 @@ INSERT INTO test_sample.link (url, name) VALUES
|
|||
INSERT(Link.URL, Link.Name).
|
||||
MODEL(linkData)
|
||||
|
||||
testutils.AssertStatementSql(t, query, expectedSQL, "http://www.duckduckgo.com", "Duck Duck go")
|
||||
testutils.AssertDebugStatementSql(t, query, expectedSQL, "http://www.duckduckgo.com", "Duck Duck go")
|
||||
|
||||
assertExec(t, query, 1)
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ INSERT INTO test_sample.link VALUES
|
|||
INSERT().
|
||||
MODEL(linkData)
|
||||
|
||||
testutils.AssertStatementSql(t, query, expectedSQL, int32(1000), "http://www.duckduckgo.com", "Duck Duck go", nil)
|
||||
testutils.AssertDebugStatementSql(t, query, expectedSQL, int32(1000), "http://www.duckduckgo.com", "Duck Duck go", nil)
|
||||
|
||||
assertExec(t, query, 1)
|
||||
}
|
||||
|
|
@ -161,7 +161,7 @@ INSERT INTO test_sample.link (url, name) VALUES
|
|||
INSERT(Link.URL, Link.Name).
|
||||
MODELS([]model.Link{tutorial, google, yahoo})
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, expectedSQL,
|
||||
testutils.AssertDebugStatementSql(t, stmt, expectedSQL,
|
||||
"http://www.postgresqltutorial.com", "PostgreSQL Tutorial",
|
||||
"http://www.google.com", "Google",
|
||||
"http://www.yahoo.com", "Yahoo")
|
||||
|
|
@ -194,7 +194,7 @@ INSERT INTO test_sample.link (url, name, description) VALUES
|
|||
MODEL(google).
|
||||
MODELS([]model.Link{google, yahoo})
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, expectedSQL,
|
||||
testutils.AssertDebugStatementSql(t, stmt, expectedSQL,
|
||||
"http://www.postgresqltutorial.com", "PostgreSQL Tutorial",
|
||||
"http://www.google.com", "Google", nil,
|
||||
"http://www.google.com", "Google", nil,
|
||||
|
|
@ -231,7 +231,7 @@ RETURNING link.id AS "link.id",
|
|||
).
|
||||
RETURNING(Link.AllColumns)
|
||||
|
||||
testutils.AssertStatementSql(t, query, expectedSQL, int64(0))
|
||||
testutils.AssertDebugStatementSql(t, query, expectedSQL, int64(0))
|
||||
|
||||
dest := []model.Link{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue