Ejemplo n.º 1
0
func (me *mysqlTest) TestUpdateReturning() {
	t := me.T()
	ds := me.db.From("entry")
	var id uint32
	_, err := ds.Where(goqu.I("int").Eq(11)).Returning("id").Update(map[string]interface{}{"int": 9}).ScanVal(&id)
	assert.Error(t, err)
	assert.Equal(t, err.Error(), "goqu: Adapter does not support RETURNING clause")
}
Ejemplo n.º 2
0
func (me *mysqlTest) TestInsertReturning() {
	t := me.T()
	ds := me.db.From("entry")
	now := time.Now()
	e := entry{Int: 10, Float: 1.000000, String: "1.000000", Time: now, Bool: true, Bytes: []byte("1.000000")}
	_, err := ds.Returning(goqu.Star()).Insert(e).ScanStruct(&e)
	assert.Error(t, err)

}