2
0

Rename BeginEx to BeginTx and update docs

This commit is contained in:
Jack Christensen
2019-08-24 20:50:24 -05:00
parent ebf88b691f
commit b2b949afa4
6 changed files with 20 additions and 16 deletions
+7 -3
View File
@@ -146,10 +146,9 @@ Raw Bytes Mapping
Transactions
Transactions are started by calling Begin. The second argument can create a transaction with a specified isolation
level.
Transactions are started by calling Begin.
tx, err := conn.Begin(context.Background(), nil)
tx, err := conn.Begin(context.Background())
if err != nil {
return err
}
@@ -167,6 +166,11 @@ level.
return err
}
The Tx returned from Begin also implements the Begin method. This can be used to implement pseudo nested transactions.
These are internally implemented with savepoints.
Use BeginTx to control the transaction mode.
Prepared Statements
Prepared statements can be manually created with the Prepare method. However, this is rarely necessary because pgx