Update example with SSL argument

This commit is contained in:
Steven Fackler 2013-11-10 17:59:25 -08:00
parent 5f678825d1
commit 1ce4bd6cf5
2 changed files with 8 additions and 6 deletions

View File

@ -18,7 +18,7 @@ extern mod extra;
use extra::time;
use extra::time::Timespec;
use postgres::{PostgresConnection, PostgresStatement};
use postgres::{PostgresConnection, PostgresStatement, NoSsl};
use postgres::types::ToSql;
struct Person {
@ -29,7 +29,8 @@ struct Person {
}
fn main() {
let conn = PostgresConnection::connect("postgres://postgres@localhost");
let conn = PostgresConnection::connect("postgres://postgres@localhost",
NoSsl);
conn.update("CREATE TABLE person (
id SERIAL PRIMARY KEY,

9
lib.rs
View File

@ -10,7 +10,7 @@ extern mod extra;
use extra::time;
use extra::time::Timespec;
use postgres::{PostgresConnection, PostgresStatement};
use postgres::{PostgresConnection, PostgresStatement, NoSsl};
use postgres::types::ToSql;
struct Person {
@ -21,7 +21,8 @@ struct Person {
}
fn main() {
let conn = PostgresConnection::connect("postgres://postgres@localhost");
let conn = PostgresConnection::connect("postgres://postgres@localhost",
NoSsl);
conn.update("CREATE TABLE person (
id SERIAL PRIMARY KEY,
@ -82,8 +83,8 @@ use std::rt::io::net::ip::{Port, SocketAddr};
use std::rt::io::net::tcp::TcpStream;
use std::task;
use self::error::{PostgresConnectError,
PostgresDbError,
use self::error::{PostgresDbError,
PostgresConnectError,
InvalidUrl,
DnsError,
SocketError,