From 744cb7dfda9ee8c681dc17b540cf8db9fa74f726 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Thu, 5 Jun 2014 18:23:22 +0800 Subject: [PATCH] Update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b729f92b..ee80c444 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,11 @@ db.Model(&user).UpdateColumns(User{Name: "hello", Age: 18}) //// UPDATE users SET name='hello', age=18 WHERE id = 111; ``` +### Get Affected Records Count + +```go +db.Model(User{}).Updates(User{Name: "hello", Age: 18}).RowsAffected +``` ## Delete ### Delete An Existing Struct @@ -937,6 +942,9 @@ db.Model(User{}).AddUniqueIndex("idx_user_name", "name") // multiple column unique index db.Model(User{}).AddUniqueIndex("idx_user_name_age", "name", "age") + +// remove index +db.Model(User{}).RemoveIndex("idx_user_name") ``` ## Run Raw SQL