feat: add returning to mysql
This commit is contained in:
parent
0585cd1949
commit
b2b1a59a45
5 changed files with 42 additions and 6 deletions
|
|
@ -1,9 +1,10 @@
|
|||
package mysql
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestInvalidInsert(t *testing.T) {
|
||||
|
|
@ -24,6 +25,14 @@ VALUES (?);
|
|||
`, int(1))
|
||||
}
|
||||
|
||||
func TestInsertWithReturing(t *testing.T) {
|
||||
assertStatementSql(t, table1.INSERT(table1Col1).VALUES(1).RETURNING(table1Col1), `
|
||||
INSERT INTO db.table1 (col1)
|
||||
VALUES (?)
|
||||
RETURNING table1.col1 AS "table1.col1";
|
||||
`, int(1))
|
||||
}
|
||||
|
||||
func TestInsertWithColumnList(t *testing.T) {
|
||||
columnList := ColumnList{table3ColInt}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue