Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit eb8a663

Browse files
committed
Drop codegen stuff from readme
1 parent e48ce90 commit eb8a663

File tree

1 file changed

+2
-61
lines changed

1 file changed

+2
-61
lines changed

README.md

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
Syntax extensions to automatically derive `FromSql` and `ToSql` implementations for Postgres enum,
66
domain, and composite types.
77

8-
The generated code requires rust-postgres 0.12.0 or higher and Rust 1.10.0 or higher.
8+
The generated code requires rust-postgres 0.12.0 or higher and Rust 1.15.0 or higher.
99

1010
# Usage
1111

12-
postgres-derive can be used both as a syntax extension with a nightly build of the compiler, or
13-
as a code generator with stable builds.
14-
15-
## Nightlies
16-
17-
Simply depend on the `postgres-derive-macros` crate and register it as a plugin:
12+
Simply depend on the `postgres-derive` crate and register it as a plugin:
1813

1914

2015
Cargo.toml
@@ -42,60 +37,6 @@ pub enum Mood {
4237

4338
// ...
4439
```
45-
46-
## Stable
47-
48-
Use `postgres-derive-codegen` in a build script:
49-
50-
Cargo.toml
51-
```toml
52-
[package]
53-
# ...
54-
build = "build.rs"
55-
56-
[build-dependencies]
57-
postgres-derive-codegen = "0.2"
58-
59-
[dependencies]
60-
postgres = "0.13"
61-
```
62-
63-
build.rs
64-
```rust
65-
extern crate postgres_derive_codegen;
66-
67-
use std::env;
68-
use std::path::Path;
69-
70-
pub fn main() {
71-
let out_dir = env::var_os("OUT_DIR").unwrap();
72-
let src = Path::new("src/types.rs.in");
73-
let dst = Path::new(&out_dir).join("types.rs");
74-
75-
postgres_derive_codegen::expand(src, dst).unwrap();
76-
}
77-
```
78-
79-
types.rs.in
80-
```rust
81-
#[derive(Debug, ToSql, FromSql)]
82-
pub enum Mood {
83-
Sad,
84-
Ok,
85-
Happy,
86-
}
87-
```
88-
89-
lib.rs
90-
```rust
91-
#[macro_use]
92-
extern crate postgres;
93-
94-
include!(concat!(env!("OUT_DIR"), "/types.rs"));
95-
96-
// ...
97-
```
98-
9940
# Types
10041

10142
## Enums

0 commit comments

Comments
 (0)