Skip to content

Commit 6564b1d

Browse files
authored
chore: reorganize workspace meta (#81)
* chore: reorganize workspace meta * chore: update README for library
1 parent 4ff620d commit 6564b1d

File tree

6 files changed

+57
-22
lines changed

6 files changed

+57
-22
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
resolver = "2"
33
members = ["datafusion-postgres", "datafusion-postgres-cli"]
44

5+
[workspace.package]
6+
version = "0.4.0"
7+
edition = "2021"
8+
license = "Apache-2.0"
9+
rust-version = "1.82.0"
10+
authors = ["Ning Sun <[email protected]>"]
11+
keywords = ["database", "postgresql", "datafusion"]
12+
homepage = "https://github.com/sunng87/datafusion-postgres/"
13+
repository = "https://github.com/sunng87/datafusion-postgres/"
14+
documentation = "https://docs.rs/crate/datafusion-postgres/"
15+
readme = "README.md"
16+
517
[workspace.dependencies]
618
pgwire = "0.30.2"
719
datafusion = { version = "47", default-features = false }

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,34 @@ picking up unfinished items.
1919

2020
- [x] datafusion-postgres as a CLI tool
2121
- [x] datafusion-postgres as a library
22-
- [x] datafusion information schema: a postgres compatible `information_schema`
22+
- [ ] datafusion information schema: a postgres compatible `information_schema`
2323
- [ ] datafusion pg catalog: a postgres compatible `pg_catalog`
2424
- [ ] data type mapping between arrow and postgres: in progress
2525
- [ ] additional postgres functions for datafusion
2626

2727
## Usage
2828

29+
### The Library `datafusion-postgres`
30+
31+
The high-level entrypoint of `datafusion-postgres` library is the `serve`
32+
function which takes a datafusion `SessionContext` and some server configuration
33+
options.
34+
35+
```rust
36+
use datafusion::prelude::SessionContext;
37+
use datafusion_postgres::{serve, ServerOptions};
38+
39+
// Create datafusion SessionContext
40+
let session_context = SessionContext::new();
41+
// Configure your `session_context`
42+
// ...
43+
44+
// Start the Postgres compatible server
45+
serve(session_context, &ServerOptions::new()).await
46+
```
47+
48+
### The CLI `datafusion-postgres-cli`
49+
2950
As a command-line application, this tool serves any JSON/CSV/Arrow/Parquet/Avro
3051
files as table, and expose them via Postgres compatible protocol, with which you
3152
can connect using psql or language drivers to execute `SELECT` queries against

datafusion-postgres-cli/Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
[package]
22
name = "datafusion-postgres-cli"
3-
version = "0.1.0"
4-
edition = "2021"
5-
rust-version = "1.82.0"
6-
7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
3+
description = "Command-line tool for DataFusion's Postgres Protocol frontend"
4+
version.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
authors.workspace = true
8+
keywords.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
11+
documentation.workspace = true
12+
readme.workspace = true
813

914
[dependencies]
1015
pgwire = { workspace = true }
1116
datafusion = { workspace = true, default-features = true, features = ["avro"] }
1217
tokio = { workspace = true, features = ["full"] }
13-
datafusion-postgres = { path = "../datafusion-postgres" }
18+
datafusion-postgres = { path = "../datafusion-postgres", version = "0.4.0" }
1419
structopt = { version = "0.3", default-features = false }

datafusion-postgres/Cargo.toml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
[package]
22
name = "datafusion-postgres"
3-
version = "0.4.0"
4-
edition = "2021"
5-
rust-version = "1.82.0"
63
description = "Exporting datafusion query engine with postgres wire protocol"
7-
authors = ["Ning Sun <[email protected]>"]
8-
license = "Apache-2.0"
9-
keywords = ["database", "postgresql"]
10-
homepage = "https://github.com/sunng87/datafusion-postgres/"
11-
repository = "https://github.com/sunng87/datafusion-postgres/"
12-
documentation = "https://docs.rs/crate/datafusion-postgres/"
13-
readme = "../README.md"
14-
15-
16-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
4+
version.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
authors.workspace = true
8+
keywords.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
11+
documentation.workspace = true
12+
readme.workspace = true
1713

1814
[dependencies]
1915
async-trait = "0.1"

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"rust-analyzer"
3838
])
3939
cargo-nextest
40+
cargo-release
4041
curl
4142
gnuplot ## for cargo bench
4243
pythonEnv

0 commit comments

Comments
 (0)