@@ -43,7 +43,7 @@ fn main() {
4343 };
4444 conn . execute (" INSERT INTO person (name, time_created, data)
4545 VALUES ($1, $2, $3)" ,
46- [& me . name, & me . time_created, & me . data]). unwrap ();
46+ & [& me . name, & me . time_created, & me . data]). unwrap ();
4747
4848 let stmt = conn . prepare (" SELECT id, name, time_created, data FROM person" )
4949 . unwrap ();
@@ -103,7 +103,7 @@ Both methods take an array of parameters to bind to the query represented as
103103query (or 0 if not applicable):
104104``` rust
105105let stmt = try ! (conn . prepare (" UPDATE foo SET bar = $1 WHERE baz = $2" ));
106- let updates = try ! (stmt . execute ([& 1i32 , & " biz" ]));
106+ let updates = try ! (stmt . execute (& [& 1i32 , & " biz" ]));
107107println! (" {} rows were updated" , updates );
108108```
109109` query ` returns an iterator over the rows returned from the database. The
@@ -122,7 +122,7 @@ In addition, `PostgresConnection` has a utility `execute` method which is useful
122122if a statement is only going to be executed once:
123123``` rust
124124let updates = try ! (conn . execute (" UPDATE foo SET bar = $1 WHERE baz = $2" ,
125- [& 1i32 , & " biz" ]));
125+ & [& 1i32 , & " biz" ]));
126126println! (" {} rows were updated" , updates );
127127```
128128
@@ -146,23 +146,6 @@ The transaction will be active until the `PostgresTransaction` object falls out
146146of scope. A transaction will roll back by default. Nested transactions are
147147supported via savepoints.
148148
149- ### Connection Pooling
150- A very basic fixed-size connection pool is provided in the ` pool ` module. A
151- single pool can be shared across tasks and ` get_connection ` will block until a
152- connection is available.
153- ``` rust
154- let pool = try ! (PostgresConnectionPool :: new (" postgres://postgres@localhost" ,
155- NoSsl , 5 ));
156-
157- for _ in range (0 , 10 ) {
158- let pool = pool . clone ();
159- spawn (proc () {
160- let conn = pool . get_connection ();
161- conn . query (... ). unwrap ();
162- })
163- }
164- ```
165-
166149### Type Correspondence
167150Rust-Postgres enforces a strict correspondence between Rust types and Postgres
168151types. The driver currently supports the following conversions:
0 commit comments