Merge branch 'release-v0.11.9' into release

This commit is contained in:
Steven Fackler 2016-06-15 18:32:42 -07:00
commit 453cd07955
9 changed files with 22 additions and 18 deletions

View File

@ -1,11 +1,11 @@
[package]
name = "postgres"
version = "0.11.8"
version = "0.11.9"
authors = ["Steven Fackler <sfackler@gmail.com>"]
license = "MIT"
description = "A native PostgreSQL driver"
repository = "https://github.com/sfackler/rust-postgres"
documentation = "https://sfackler.github.io/rust-postgres/doc/v0.11.8/postgres"
documentation = "https://sfackler.github.io/rust-postgres/doc/v0.11.9/postgres"
readme = "README.md"
keywords = ["database", "postgres", "postgresql", "sql"]
include = ["src/*", "Cargo.toml", "LICENSE", "README.md", "THIRD_PARTY"]

View File

@ -1,7 +1,7 @@
# Rust-Postgres
A native PostgreSQL driver for Rust.
[Documentation](https://sfackler.github.io/rust-postgres/doc/v0.11.8/postgres)
[Documentation](https://sfackler.github.io/rust-postgres/doc/v0.11.9/postgres)
[![Build Status](https://travis-ci.org/sfackler/rust-postgres.png?branch=master)](https://travis-ci.org/sfackler/rust-postgres) [![Latest Version](https://img.shields.io/crates/v/postgres.svg)](https://crates.io/crates/postgres)
@ -22,13 +22,11 @@ use postgres::{Connection, SslMode};
struct Person {
id: i32,
name: String,
data: Option<Vec<u8>>
data: Option<Vec<u8>>,
}
fn main() {
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None)
.unwrap();
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
conn.execute("CREATE TABLE person (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
@ -37,16 +35,15 @@ fn main() {
let me = Person {
id: 0,
name: "Steven".to_string(),
data: None
data: None,
};
conn.execute("INSERT INTO person (name, data) VALUES ($1, $2)",
&[&me.name, &me.data]).unwrap();
for row in &conn.query("SELECT id, name, data FROM person", &[]).unwrap() {
let person = Person {
id: row.get(0),
name: row.get(1),
data: row.get(2)
data: row.get(2),
};
println!("Found person {}", person.name);
}

View File

@ -38,7 +38,7 @@
//! }
//! }
//! ```
#![doc(html_root_url="https://sfackler.github.io/rust-postgres/doc/v0.11.8")]
#![doc(html_root_url="https://sfackler.github.io/rust-postgres/doc/v0.11.9")]
#![warn(missing_docs)]
#![allow(unknown_lints, needless_lifetimes)] // for clippy
#![cfg_attr(all(unix, feature = "nightly"), feature(unix_socket))]

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::io::prelude::*;
use std::ptr;
use std::mem;
use std::ops::{Add, Range};
@ -277,7 +276,7 @@ struct Md5State {
}
impl Md5State {
#[allow(new_without_default)]
#[allow(new_without_default_derive)]
fn new() -> Md5State {
Md5State {
s0: 0x67452301,

View File

@ -1,4 +1,6 @@
use byteorder::ReadBytesExt;
// this import needs to stay to support pre 1.9 users
#[allow(unused_imports)]
use net2::TcpStreamExt;
use std::error::Error;
use std::io;
@ -18,7 +20,7 @@ use std::os::windows::io::{AsRawSocket, RawSocket};
use {SslMode, ConnectParams, ConnectTarget};
use error::ConnectError;
use io::{NegotiateSsl, StreamWrapper};
use io::StreamWrapper;
use message::{self, WriteMessage};
use message::Frontend;

View File

@ -7,7 +7,7 @@ use std::fmt;
use std::ops::Deref;
use std::slice;
use {Result, Transaction, DbErrorNew, SessionInfoNew, RowsNew, LazyRowsNew, StatementInternals,
use {Result, Transaction, SessionInfoNew, RowsNew, LazyRowsNew, StatementInternals,
WrongTypeNew};
use types::{FromSql, SessionInfo, WrongType};
use stmt::{Statement, Column};

View File

@ -88,7 +88,7 @@ impl ConfigInternals for Config {
}
if let Some(read_only) = self.read_only {
if first {
if !first {
s.push(',');
}
if read_only {
@ -100,7 +100,7 @@ impl ConfigInternals for Config {
}
if let Some(deferrable) = self.deferrable {
if first {
if !first {
s.push(',');
}
if deferrable {

View File

@ -7,7 +7,6 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::io::prelude::*;
use std::str::FromStr;
use hex::FromHex;

View File

@ -1039,6 +1039,13 @@ fn transaction_config() {
conn.set_transaction_config(&config).unwrap();
}
#[test]
fn transaction_config_one_setting() {
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
conn.set_transaction_config(&transaction::Config::new().read_only(true)).unwrap();
conn.set_transaction_config(&transaction::Config::new().deferrable(true)).unwrap();
}
#[test]
fn transaction_with() {
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();