qb: json support

This commit is contained in:
Henrik Johansson
2019-05-13 14:01:13 +02:00
committed by Michal Matczuk
parent eadf9b5427
commit 31ae81aba6
5 changed files with 43 additions and 0 deletions

View File

@@ -24,6 +24,12 @@ func TestInsertBuilder(t *testing.T) {
S: "INSERT INTO cycling.cyclist_name (id,user_uuid,firstname) VALUES (?,?,?) ",
N: []string{"id", "user_uuid", "firstname"},
},
// Basic test for insert JSON
{
B: Insert("cycling.cyclist_name").Columns("id", "user_uuid", "firstname").Json(),
S: "INSERT INTO cycling.cyclist_name JSON ?",
N: nil,
},
// Change table name
{
B: Insert("cycling.cyclist_name").Columns("id", "user_uuid", "firstname").Into("Foobar"),