Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4691352

Browse files
committed
Merge branch 'release-v0.11.4' into release
2 parents b234cc0 + a3022dc commit 4691352

28 files changed

+4205
-783
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/target/
1+
target/
22
Cargo.lock
33
.cargo/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: required
33
rust:
44
- nightly
55
- beta
6-
- 1.5.0
6+
- 1.6.0
77
addons:
88
postgresql: 9.4
99
before_script:

Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
[package]
22
name = "postgres"
3-
version = "0.11.3"
3+
version = "0.11.4"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "MIT"
66
description = "A native PostgreSQL driver"
77
repository = "https://github.com/sfackler/rust-postgres"
8-
documentation = "https://sfackler.github.io/rust-postgres/doc/v0.11.3/postgres"
8+
documentation = "https://sfackler.github.io/rust-postgres/doc/v0.11.4/postgres"
99
readme = "README.md"
1010
keywords = ["database", "postgres", "postgresql", "sql"]
11-
build = "build.rs"
12-
include = ["src/*", "build.rs", "errcodes.txt", "Cargo.toml", "LICENSE", "README.md", "THIRD_PARTY"]
11+
include = ["src/*", "Cargo.toml", "LICENSE", "README.md", "THIRD_PARTY"]
1312

1413
[lib]
1514
name = "postgres"
@@ -21,9 +20,6 @@ bench = false
2120
name = "test"
2221
path = "tests/test.rs"
2322

24-
[build-dependencies]
25-
phf_codegen = "0.7"
26-
2723
[dependencies]
2824
bufstream = "0.1"
2925
byteorder = ">= 0.3, < 0.5"
@@ -34,7 +30,7 @@ net2 = "0.2.16"
3430
rustc-serialize = { version = "0.3", optional = true }
3531
chrono = { version = "0.2.14", optional = true }
3632
openssl = { version = ">= 0.6.4, < 0.8", optional = true }
37-
serde_json = { version = "0.6", optional = true }
33+
serde_json = { version = ">= 0.6, < 0.8", optional = true }
3834
time = { version = "0.1.14", optional = true }
3935
unix_socket = { version = "0.5", optional = true }
4036
uuid = { version = "0.1", optional = true }

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Rust-Postgres
22
A native PostgreSQL driver for Rust.
33

4-
[Documentation](https://sfackler.github.io/rust-postgres/doc/v0.11.3/postgres)
4+
[Documentation](https://sfackler.github.io/rust-postgres/doc/v0.11.4/postgres)
55

66
[![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)
77

@@ -54,7 +54,7 @@ fn main() {
5454
```
5555

5656
## Requirements
57-
* **Rust** - Rust-Postgres is developed against the 1.5 release of Rust
57+
* **Rust** - Rust-Postgres is developed against the 1.6 release of Rust
5858
available on http://www.rust-lang.org. It should also compile against more
5959
recent releases.
6060

@@ -265,14 +265,19 @@ types. The driver currently supports the following conversions:
265265
More conversions can be defined by implementing the `ToSql` and `FromSql`
266266
traits.
267267

268+
The [postgres-derive](https://github.com/sfackler/rust-postgres-derive)
269+
crate will synthesize `ToSql` and `FromSql` implementations for enum, domain,
270+
and composite Postgres types.
271+
268272
Support for array types is located in the
269273
[postgres-array](https://github.com/sfackler/rust-postgres-array) crate.
270274

271275
Support for range types is located in the
272276
[postgres-range](https://github.com/sfackler/rust-postgres-range) crate.
273277

274278
Support for the large object API is located in the
275-
[postgres-large-object](https://github.com/sfackler/rust-postgres-large-object) crate.
279+
[postgres-large-object](https://github.com/sfackler/rust-postgres-large-object)
280+
crate.
276281

277282
## Optional features
278283

codegen/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "codegen"
3+
version = "0.1.0"
4+
authors = ["Steven Fackler <[email protected]>"]
5+
6+
[dependencies]
7+
phf_codegen = "0.7"
8+
regex = "0.1"
9+
marksman_escape = "0.1"
File renamed without changes.

codegen/src/main.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
extern crate phf_codegen;
2+
extern crate regex;
3+
extern crate marksman_escape;
4+
5+
use std::ascii::AsciiExt;
6+
use std::path::Path;
7+
8+
mod sqlstate;
9+
mod types;
10+
11+
fn main() {
12+
let path = Path::new("../src");
13+
sqlstate::build(path);
14+
types::build(path);
15+
}
16+
17+
fn snake_to_camel(s: &str) -> String {
18+
let mut out = String::new();
19+
20+
let mut upper = true;
21+
for ch in s.chars() {
22+
if ch == '_' {
23+
upper = true;
24+
} else {
25+
let ch = if upper {
26+
upper = false;
27+
ch.to_ascii_uppercase()
28+
} else {
29+
ch
30+
};
31+
out.push(ch);
32+
}
33+
}
34+
35+
out
36+
}

codegen/src/pg_range.h

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* pg_range.h
4+
* definition of the system "range" relation (pg_range)
5+
* along with the relation's initial contents.
6+
*
7+
*
8+
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
9+
* Portions Copyright (c) 1994, Regents of the University of California
10+
*
11+
* src/include/catalog/pg_range.h
12+
*
13+
* NOTES
14+
* the genbki.pl script reads this file and generates .bki
15+
* information from the DATA() statements.
16+
*
17+
* XXX do NOT break up DATA() statements into multiple lines!
18+
* the scripts are not as smart as you might think...
19+
*
20+
*-------------------------------------------------------------------------
21+
*/
22+
#ifndef PG_RANGE_H
23+
#define PG_RANGE_H
24+
25+
#include "catalog/genbki.h"
26+
27+
/* ----------------
28+
* pg_range definition. cpp turns this into
29+
* typedef struct FormData_pg_range
30+
* ----------------
31+
*/
32+
#define RangeRelationId 3541
33+
34+
CATALOG(pg_range,3541) BKI_WITHOUT_OIDS
35+
{
36+
Oid rngtypid; /* OID of owning range type */
37+
Oid rngsubtype; /* OID of range's element type (subtype) */
38+
Oid rngcollation; /* collation for this range type, or 0 */
39+
Oid rngsubopc; /* subtype's btree opclass */
40+
regproc rngcanonical; /* canonicalize range, or 0 */
41+
regproc rngsubdiff; /* subtype difference as a float8, or 0 */
42+
} FormData_pg_range;
43+
44+
/* ----------------
45+
* Form_pg_range corresponds to a pointer to a tuple with
46+
* the format of pg_range relation.
47+
* ----------------
48+
*/
49+
typedef FormData_pg_range *Form_pg_range;
50+
51+
/* ----------------
52+
* compiler constants for pg_range
53+
* ----------------
54+
*/
55+
#define Natts_pg_range 6
56+
#define Anum_pg_range_rngtypid 1
57+
#define Anum_pg_range_rngsubtype 2
58+
#define Anum_pg_range_rngcollation 3
59+
#define Anum_pg_range_rngsubopc 4
60+
#define Anum_pg_range_rngcanonical 5
61+
#define Anum_pg_range_rngsubdiff 6
62+
63+
64+
/* ----------------
65+
* initial contents of pg_range
66+
* ----------------
67+
*/
68+
DATA(insert ( 3904 23 0 1978 int4range_canonical int4range_subdiff));
69+
DATA(insert ( 3906 1700 0 3125 - numrange_subdiff));
70+
DATA(insert ( 3908 1114 0 3128 - tsrange_subdiff));
71+
DATA(insert ( 3910 1184 0 3127 - tstzrange_subdiff));
72+
DATA(insert ( 3912 1082 0 3122 daterange_canonical daterange_subdiff));
73+
DATA(insert ( 3926 20 0 3124 int8range_canonical int8range_subdiff));
74+
75+
76+
/*
77+
* prototypes for functions in pg_range.c
78+
*/
79+
80+
extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
81+
Oid rangeSubOpclass, RegProcedure rangeCanonical,
82+
RegProcedure rangeSubDiff);
83+
extern void RangeDelete(Oid rangeTypeOid);
84+
85+
#endif /* PG_RANGE_H */

0 commit comments

Comments
 (0)