Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Refactor workspace and add pg_analytics module #149

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/benchmark-pg_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
run: echo "PGRX_VERSION=$(cargo tree --depth 1 -i pgrx -p pg_analytics | head -n 1 | cut -f2 -dv)" >> $GITHUB_ENV

- name: Install pgrx & pg_analytics
working-directory: pg_analytics/
run: |
cargo install -j $(nproc) --locked cargo-pgrx --version ${{ env.PGRX_VERSION }}
cargo pgrx init --pg${{ matrix.pg_version }}=/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config
Expand All @@ -76,6 +77,7 @@ jobs:
run: cargo run install

- name: Run Official ${{ matrix.name }} Benchmark
working-directory: pg_analytics/
run: |
cargo pgrx start pg${{ matrix.pg_version }}
cargo paradedb bench hits run ${{ matrix.flags }} --url postgresql://localhost:288${{ matrix.pg_version }}/postgres
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-pg_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ jobs:
# The integration tests also test upgrading the extension when passed the '-u' flag (only on promotion PRs)
- name: Run pg_analytics Cargo Test Suite
if: steps.check_skip.outputs.skip_remaining_steps != 'true'
working-directory: pg_analytics/
env:
LLVM_PROFILE_FILE: target/coverage/pg_analytics-%p-%m.profraw
RUST_BACKTRACE: full
Expand All @@ -131,7 +132,7 @@ jobs:

echo ""
echo "Enabling code coverage..."
echo -e "\n# Enable code coverage on Linux only, for CI builds\n[target.'cfg(target_os=\"linux\")']\nrustflags = [\"-Cinstrument-coverage\"]" >> .cargo/config.toml
echo -e "\n# Enable code coverage on Linux only, for CI builds\n[target.'cfg(target_os=\"linux\")']\nrustflags = [\"-Cinstrument-coverage\"]" >> ../.cargo/config.toml
mkdir -p target/coverage target/coverage-report

echo ""
Expand Down
58 changes: 4 additions & 54 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,11 @@
[package]
name = "pg_analytics"
description = "Postgres for analytics, powered by DuckDB"
version = "0.2.0"
edition = "2021"
license = "AGPL-3.0"
[workspace]
members = ["pg_analytics"]
resolver = "2"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["pg17"]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13", "supabase-wrappers/pg13"]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14", "supabase-wrappers/pg14"]
pg15 = ["pgrx/pg15", "pgrx-tests/pg15", "supabase-wrappers/pg15"]
pg16 = ["pgrx/pg16", "pgrx-tests/pg16", "supabase-wrappers/pg16"]
pg17 = ["pgrx/pg17", "pgrx-tests/pg17", "supabase-wrappers/pg17"]
pg_test = []

[dependencies]
[workspace.dependencies]
anyhow = "1.0.88"
async-std = { version = "1.13.0", features = ["tokio1", "attributes"] }
chrono = "0.4.38"
duckdb = { git = "https://github.com/paradedb/duckdb-rs.git", features = [
"bundled",
"extensions-full",
], rev = "e532dd6" }
pgrx = "0.12.5"
serde = "1.0.210"
serde_json = "1.0.128"
signal-hook = "0.3.17"
sqlparser = "0.50.0"
strum = { version = "0.26.3", features = ["derive"] }
supabase-wrappers = { git = "https://github.com/paradedb/wrappers.git", default-features = false, rev = "c32abb7" }
thiserror = "1.0.63"
uuid = "1.10.0"

[dev-dependencies]
aws-config = "1.5.6"
aws-sdk-s3 = "1.49.0"
bigdecimal = { version = "0.3.1", features = ["serde"] }
bytes = "1.7.1"
datafusion = "37.1.0"
deltalake = { version = "0.17.3", features = ["datafusion"] }
futures = "0.3.30"
pgrx-tests = "0.12.5"
rstest = "0.19.0"
serde_arrow = { version = "0.11.7", features = ["arrow-51"] }
soa_derive = "0.13.0"
sqlx = { version = "0.7.4", features = [
"postgres",
"runtime-async-std",
Expand All @@ -55,12 +14,3 @@ sqlx = { version = "0.7.4", features = [
"uuid",
"chrono",
] }
tempfile = "3.12.0"
testcontainers = "0.16.7"
testcontainers-modules = { version = "0.4.3", features = ["localstack"] }
time = { version = "0.3.36", features = ["serde"] }
geojson = "0.24.1"

[[bin]]
name = "pgrx_embed_pg_analytics"
path = "src/bin/pgrx_embed.rs"
59 changes: 59 additions & 0 deletions pg_analytics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[package]
name = "pg_analytics"
description = "Postgres for analytics, powered by DuckDB"
version = "0.2.0"
edition = "2021"
license = "AGPL-3.0"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["pg17"]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13", "supabase-wrappers/pg13"]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14", "supabase-wrappers/pg14"]
pg15 = ["pgrx/pg15", "pgrx-tests/pg15", "supabase-wrappers/pg15"]
pg16 = ["pgrx/pg16", "pgrx-tests/pg16", "supabase-wrappers/pg16"]
pg17 = ["pgrx/pg17", "pgrx-tests/pg17", "supabase-wrappers/pg17"]
pg_test = []

[dependencies]
anyhow = { workspace = true }
async-std = { workspace = true }
chrono = "0.4.38"
duckdb = { git = "https://github.com/paradedb/duckdb-rs.git", features = [
"bundled",
"extensions-full",
], rev = "e532dd6" }
pgrx = "0.12.5"
serde = "1.0.210"
serde_json = "1.0.128"
signal-hook = "0.3.17"
sqlparser = "0.50.0"
strum = { version = "0.26.3", features = ["derive"] }
supabase-wrappers = { git = "https://github.com/paradedb/wrappers.git", default-features = false, rev = "c32abb7" }
thiserror = { workspace = true }
uuid = "1.10.0"

[dev-dependencies]
aws-config = "1.5.6"
aws-sdk-s3 = "1.49.0"
bigdecimal = { version = "0.3.1", features = ["serde"] }
bytes = "1.7.1"
datafusion = "37.1.0"
deltalake = { version = "0.17.3", features = ["datafusion"] }
futures = "0.3.30"
pgrx-tests = "0.12.5"
rstest = "0.19.0"
serde_arrow = { version = "0.11.7", features = ["arrow-51"] }
soa_derive = "0.13.0"
sqlx = { workspace = true }
tempfile = "3.12.0"
testcontainers = "0.16.7"
testcontainers-modules = { version = "0.4.3", features = ["localstack"] }
time = { version = "0.3.36", features = ["serde"] }
geojson = "0.24.1"

[[bin]]
name = "pgrx_embed_pg_analytics"
path = "src/bin/pgrx_embed.rs"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.