Browse Source

Update README.md

Volodymyr Tkach 2 years ago
parent
commit
9f5ad1d4a6
1 changed files with 16 additions and 5 deletions
  1. 16 5
      README.md

+ 16 - 5
README.md

@@ -34,12 +34,23 @@ sqlite3:///data/database.sqlite
 ## Examples
 ## Examples
 
 
 ```sh
 ```sh
-$ go run main.go
-
-[SQL] [func Exec] INSERT INTO users (id, name) VALUES ($1, $2) ([5 John]) (nil) 0.004 ms
-[SQL] [func Query] SELECT id, name FROM users ORDER BY id DESC (empty) (nil) 0.000 ms
+$ go run main.go 
+Insert some data to users table
+[SQL] [func Exec] INSERT INTO users (id, name) VALUES ($1, $2) ([5 John]) (nil) 0.005 ms
+Select all rows from users table
+[SQL] [func Query] SELECT id, name FROM users ORDER BY id ASC (empty) (nil) 0.000 ms
+ID: 1, Name: Alice
+ID: 2, Name: Bob
 ID: 5, Name: John
 ID: 5, Name: John
+Update inside transaction
+[SQL] [TX] [func Begin] (empty) (nil) 0.000 ms
+[SQL] [TX] [func Exec] UPDATE users SET name=$1 WHERE id=$2 ([John 1]) (nil) 0.000 ms
+[SQL] [TX] [func Exec] UPDATE users SET name=$1 WHERE id=$2 ([Alice 5]) (nil) 0.000 ms
+[SQL] [TX] [func Commit] (empty) (nil) 0.004 ms
+Select all rows from users again
+[SQL] [func Query] SELECT id, name FROM users ORDER BY id ASC (empty) (nil) 0.000 ms
+ID: 1, Name: John
 ID: 2, Name: Bob
 ID: 2, Name: Bob
-ID: 1, Name: Alice
+ID: 5, Name: Alice
 [SQL] [func Close] (empty) (nil) 0.000 ms
 [SQL] [func Close] (empty) (nil) 0.000 ms
 ```
 ```