Skip to content

Commit 2ad8a3e

Browse files
committed
docs: added documentation for POSTGRESQL_VERSION and GITHUB_TOKEN usage
1 parent cfc96a2 commit 2ad8a3e

File tree

5 files changed

+60
-47
lines changed

5 files changed

+60
-47
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><img width="256" height="256" src="images/logo.png"></p>
1+
<p align="center"><img width="250" height="250" src="images/logo.png"></p>
22

33
# PostgreSQL Embedded
44

@@ -8,8 +8,6 @@
88
[![License](https://img.shields.io/crates/l/postgresql_embedded)](https://github.com/theseus-rs/postgresql-embedded#license)
99
[![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html)
1010

11-
---
12-
1311
Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be
1412
bundled with your application, or downloaded on demand.
1513

postgresql_archive/README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
[![License](https://img.shields.io/crates/l/postgresql_archive?)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_archive#license)
77
[![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html)
88

9-
---
10-
119
A library for downloading and extracting PostgreSQL archives from
1210
[theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries).
1311

@@ -22,7 +20,7 @@ use postgresql_archive::{extract, get_archive, LATEST};
2220
async fn main() {
2321
let (archive_version, archive, hash) = get_archive(&LATEST).await.unwrap();
2422
let out_dir = std::env::temp_dir();
25-
let result = extract(&archive, &out_dir).await;
23+
let result = extract(&archive, &out_dir).await.unwrap();
2624
}
2725
```
2826

@@ -34,7 +32,7 @@ use postgresql_archive::blocking::{extract, get_archive};
3432
fn main() {
3533
let (archive_version, archive, hash) = get_archive(&LATEST).unwrap();
3634
let out_dir = std::env::temp_dir();
37-
let result = extract(&archive, &out_dir);
35+
let result = extract(&archive, &out_dir).unwrap();
3836
}
3937
```
4038

@@ -45,41 +43,41 @@ uses.
4543

4644
The following features are available:
4745

48-
Name | Description | Default?
49-
---|---|---
50-
`blocking` | Enables the blocking API | No
46+
| Name | Description | Default? |
47+
|---|---|---|
48+
| `blocking` | Enables the blocking API | No |
5149

5250
## Supported platforms
5351

5452
`postgresql_archive` supports all platforms provided by [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries).
5553

5654
Currently supported platforms are:
5755

58-
OS | [Target](https://doc.rust-lang.org/nightly/rustc/platform-support.html)
59-
---|---
60-
Linux | aarch64-unknown-linux-gnu
61-
Linux | aarch64-unknown-linux-musl
62-
Linux | arm-unknown-linux-gnueabi
63-
Linux | arm-unknown-linux-gnueabihf
64-
Linux | arm-unknown-linux-musleabi
65-
Linux | arm-unknown-linux-musleabihf
66-
Linux | armv5te-unknown-linux-gnueabi
67-
Linux | armv7-unknown-linux-gnueabihf
68-
Linux | armv7-unknown-linux-musleabihf
69-
Linux | i586-unknown-linux-gnu
70-
Linux | i586-unknown-linux-musl
71-
Linux | i686-unknown-linux-gnu
72-
Linux | i686-unknown-linux-musl
73-
Linux | mips64-unknown-linux-gnuabi64
74-
Linux | powerpc64le-unknown-linux-gnu
75-
Linux | powerpc64le-unknown-linux-musl
76-
Linux | s390x-unknown-linux-gnu
77-
Linux | s390x-unknown-linux-musl
78-
Linux | x86_64-unknown-linux-gnu
79-
Linux | x86_64-unknown-linux-musl
80-
MacOS | aarch64-apple-darwin
81-
MacOS | x86_64-apple-darwin
82-
Windows | x86_64-pc-windows-msvc
56+
| OS | [Target](https://doc.rust-lang.org/nightly/rustc/platform-support.html) |
57+
|---|---|
58+
| Linux | aarch64-unknown-linux-gnu |
59+
| Linux | aarch64-unknown-linux-musl |
60+
| Linux | arm-unknown-linux-gnueabi |
61+
| Linux | arm-unknown-linux-gnueabihf |
62+
| Linux | arm-unknown-linux-musleabi |
63+
| Linux | arm-unknown-linux-musleabihf |
64+
| Linux | armv5te-unknown-linux-gnueabi |
65+
| Linux | armv7-unknown-linux-gnueabihf |
66+
| Linux | armv7-unknown-linux-musleabihf |
67+
| Linux | i586-unknown-linux-gnu |
68+
| Linux | i586-unknown-linux-musl |
69+
| Linux | i686-unknown-linux-gnu |
70+
| Linux | i686-unknown-linux-musl |
71+
| Linux | mips64-unknown-linux-gnuabi64 |
72+
| Linux | powerpc64le-unknown-linux-gnu |
73+
| Linux | powerpc64le-unknown-linux-musl |
74+
| Linux | s390x-unknown-linux-gnu |
75+
| Linux | s390x-unknown-linux-musl |
76+
| Linux | x86_64-unknown-linux-gnu |
77+
| Linux | x86_64-unknown-linux-musl |
78+
| MacOS | aarch64-apple-darwin |
79+
| MacOS | x86_64-apple-darwin |
80+
| Windows | x86_64-pc-windows-msvc |
8381

8482
## Safety
8583

postgresql_archive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! async fn main() {
2929
//! let (archive_version, archive, hash) = get_archive(&LATEST).await.unwrap();
3030
//! let out_dir = std::env::temp_dir();
31-
//! let result = extract(&archive, &out_dir).await;
31+
//! let result = extract(&archive, &out_dir).await.unwrap();
3232
//! }
3333
//! ```
3434
//!
@@ -39,7 +39,7 @@
3939
//!
4040
//! let (archive_version, archive, hash) = get_archive(&LATEST).unwrap();
4141
//! let out_dir = std::env::temp_dir();
42-
//! let result = extract(&archive, &out_dir);
42+
//! let result = extract(&archive, &out_dir).unwrap();
4343
//! ```
4444
//!
4545
//! ## Feature flags

postgresql_embedded/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
[![License](https://img.shields.io/crates/l/postgresql_embedded)](https://github.com/theseus-rs/postgresql-embedded/tree/main/postgresql_embedded#license)
77
[![Semantic Versioning](https://img.shields.io/badge/%E2%9A%99%EF%B8%8F_SemVer-2.0.0-blue)](https://semver.org/spec/v2.0.0.html)
88

9-
---
10-
119
Install and run a PostgreSQL database locally on Linux, MacOS or Windows. PostgreSQL can be
1210
bundled with your application, or downloaded on demand.
1311

@@ -53,7 +51,17 @@ fn main() {
5351

5452
## Information
5553

56-
The downloaded postgresql binaries are cached in the following directories:
54+
During the build process, when the `bundled` feature is enabled, the PostgreSQL binaries are
55+
downloaded and included in the resulting binary. The version of the PostgreSQL binaries is
56+
determined by the `POSTGRESQL_VERSION` environment variable. If the `POSTGRESQL_VERSION`
57+
environment variable is not set, then `postgresql_archive::LATEST` will be used to determine the
58+
version of the PostgreSQL binaries to download.
59+
60+
When downloading the PostgreSQL binaries, either during build, or at runtime, the `GITHUB_TOKEN`
61+
environment variable can be set to a GitHub personal access token to increase the rate limit for
62+
downloading the PostgreSQL binaries. The `GITHUB_TOKEN` environment variable is not required.
63+
64+
At runtime, the PostgreSQL binaries are cached by default in the following directories:
5765

5866
- Unix: `$HOME/.theseus/postgresql`
5967
- Windows: `%USERPROFILE%\.theseus\postgresql`
@@ -65,11 +73,11 @@ uses.
6573

6674
The following features are available:
6775

68-
Name | Description | Default?
69-
---|---|---
70-
`bundled` | Bundles the PostgreSQL archive into the resulting binary | Yes
71-
`blocking` | Enables the blocking API; requires `tokio` | No
72-
`tokio` | Enables using tokio for async | No
76+
| Name | Description | Default? |
77+
|------------|---|---|
78+
| `bundled` | Bundles the PostgreSQL archive into the resulting binary | Yes |
79+
| `blocking` | Enables the blocking API; requires `tokio` | No |
80+
| `tokio` | Enables using tokio for async | No |
7381

7482
## Safety
7583

postgresql_embedded/src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
//! ## Examples
2222
//!
2323
//! ### Asynchronous API
24-
//! **Note**: The following example requires the `tokio` runtime.
2524
//!
2625
//! ```rust, ignore
2726
//! use postgresql_embedded::PostgreSQL;
@@ -59,7 +58,17 @@
5958
//!
6059
//! ## Information
6160
//!
62-
//! The downloaded postgresql binaries are cached in the following directories:
61+
//! During the build process, when the `bundled` feature is enabled, the PostgreSQL binaries are
62+
//! downloaded and included in the resulting binary. The version of the PostgreSQL binaries is
63+
//! determined by the `POSTGRESQL_VERSION` environment variable. If the `POSTGRESQL_VERSION`
64+
//! environment variable is not set, then `postgresql_archive::LATEST` will be used to determine the
65+
//! version of the PostgreSQL binaries to download.
66+
//!
67+
//! When downloading the PostgreSQL binaries, either during build, or at runtime, the `GITHUB_TOKEN`
68+
//! environment variable can be set to a GitHub personal access token to increase the rate limit for
69+
//! downloading the PostgreSQL binaries. The `GITHUB_TOKEN` environment variable is not required.
70+
//!
71+
//! At runtime, the PostgreSQL binaries are cached by default in the following directories:
6372
//!
6473
//! - Unix: `$HOME/.theseus/postgresql`
6574
//! - Windows: `%USERPROFILE%\.theseus\postgresql`

0 commit comments

Comments
 (0)