Skip to content

Commit

Permalink
feat: Support for views (#132)
Browse files Browse the repository at this point in the history
* feat: Support for views

* chore: Add comments for tests

* chore

* chore: Update tests

* fix: Check if the table exists in the DuckDB

* fix: Not fully pushed to DuckDB

* chore

* chore:test

* chore:test

* chore: Used sqlparser to parse create view statement

* chore: Updated tests

* chore: Add comments

* chore: Add comments

* chore: Fix rebase

* chore

* refactor: check pgcatalog

* chore: Fix typo

* chore: Clean up

* chore: Warning the table which is not a foreign table from DuckDB

* chore: Rebase

* refactor: Using parse_analyze_fixedparams

* refactor: Update parse_analyze_fixedparams usage in view_query function

* refactor: Update parse_analyze_fixedparams usage in view_query function

* refactor: Update parse_analyze_fixedparams usage in view_query function and use pg_analyze_and_rewrite_fixedparams instead

* fix: CI

* chore

* chore

* chore: Add nested test

* chore: Update pg_analytics

* chore
  • Loading branch information
Weijun-H authored Oct 28, 2024
1 parent 376f851 commit a97c8f9
Show file tree
Hide file tree
Showing 6 changed files with 494 additions and 366 deletions.
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
crate
socio-economic
larg
rlarg
23 changes: 15 additions & 8 deletions .github/workflows/test-pg_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ jobs:
working-directory: /home/runner/.pgrx/data-${{ matrix.pg_version }}/
run: sed -i "s/^#shared_preload_libraries = .*/shared_preload_libraries = 'pg_analytics'/" postgresql.conf

- name: Compile & install pg_analytics extension
if: steps.check_skip.outputs.skip_remaining_steps != 'true'
run: cargo pgrx install --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config"

- name: Start Postgres via cargo-pgrx
if: steps.check_skip.outputs.skip_remaining_steps != 'true'
run: |
RUST_BACKTRACE=1 cargo pgrx start pg${{ matrix.pg_version }}
# Necessary for the ephemeral Postgres test to have proper permissions
sudo chown -R $(whoami) /var/run/postgresql/
# The SHA hash here must exactly match the Image::Tag that is referenced in the
# testcontainers modules Rust crate for localstack.
- name: Pull localstack image
Expand All @@ -140,16 +151,12 @@ jobs:
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 ""
echo "Building pg_analytics..."
cargo pgrx install --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release
echo ""
echo "Starting Postgres..."
cargo pgrx start pg${{ matrix.pg_version }}
echo ""
echo "Running Rust tests..."
export DATABASE_URL=postgresql://localhost:288${{ matrix.pg_version }}/postgres
export RUST_BACKTRACE=1
cargo test --package tests --features "pg${{ matrix.pg_version }}" --no-default-features
- name: Print the Postgres Logs
if: steps.check_skip.outputs.skip_remaining_steps != 'true' && always()
run: cat ~/.pgrx/${{ matrix.pg_version}}.log
Loading

0 comments on commit a97c8f9

Please sign in to comment.