dal/pkg/builder/convert_insert_test.go
Anton Nesterov 1db30b92c2
[wip] builder
Signed-off-by: Anton Nesterov <anton@demiurg.io>
2024-08-09 21:14:28 +02:00

27 lines
491 B
Go

package builder
import (
"testing"
)
func TestConvertInsert(t *testing.T) {
ctx := SQLiteContext{
TableName: "test",
TableAlias: "t",
}
insert := []Map{
{"a": "1", "b": 2},
{"b": 2, "a": "1", "c": 3},
}
result, _ := ConvertInsert(ctx, insert)
if result.Statement != `INSERT INTO test (a,b,c) VALUES (?,?,?)` {
t.Errorf(`Expected "INSERT INTO test (a,b,c) VALUES (?,?,?)", got %s`, result.Statement)
}
// for _, r := range result.Values {
// fmt.Println(r)
// }
}