Add support for INSERT select query.
This commit is contained in:
parent
0971573338
commit
b287521f1a
5 changed files with 154 additions and 74 deletions
|
|
@ -123,3 +123,26 @@ func TestInsertValuesFromModelColumnMismatch(t *testing.T) {
|
|||
fmt.Println(err)
|
||||
assert.Assert(t, err != nil)
|
||||
}
|
||||
|
||||
func TestInsertQuery(t *testing.T) {
|
||||
|
||||
stmt := table1.INSERT(table1Col1).
|
||||
QUERY(table1.SELECT(table1Col1))
|
||||
|
||||
stmtStr, err := stmt.String()
|
||||
|
||||
assert.NilError(t, err)
|
||||
|
||||
fmt.Println(stmtStr)
|
||||
}
|
||||
|
||||
func TestInsertDefaultValue(t *testing.T) {
|
||||
stmt := table1.INSERT(table1Col1, table1Col2).
|
||||
VALUES(DEFAULT, "two")
|
||||
|
||||
stmtStr, err := stmt.String()
|
||||
|
||||
assert.NilError(t, err)
|
||||
|
||||
fmt.Println(stmtStr)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue