Insert data

    • Insert one object
    1. fmt.Println(user.Id)
    • Insert multiple objects by Slice on one table
    • Insert multiple records by Slice of pointer on one table
    1. users[0].Name = "name0"
    2. ...
    3. affected, err := engine.Insert(&users)
    • Insert two objects onto two tables.
    1. users := make([]User, 1)
    2. ...
    3. questions := make([]Question, 1)
    4. questions[0].Content = "whywhywhwy?"
    • Insert one or multple objects on multiple tables.