rust-postgres-cursor
A cursor type for use with PostgreSQL.
Example
extern crate postgres;
extern crate postgres_cursor;
use ;
use Cursor;
// First, establish a connection with postgres
let conn = connect
.expect;
// Build the cursor
let mut cursor = build
// Batch size determines rows returned in each FETCH call
.batch_size
// Query is the statement to build a cursor for
.query
// Finalize turns this builder into a cursor
.finalize
.expect;
// Iterate over batches of rows
for result in &mut cursor
Features
The library is mostly complete since its only intent is providing a cursor abstraction. However, there are some small planned features worth noting:
- Support query parameters (eg.
"SELECT foo FROM bar WHERE quux = $1"
) in cursor query string.