Parameterized Advanced Querying System
About
Standard repository for development work related to hyperfast and slightly modern querying platform.
Access Package
git clone https://github.com/Query-Fulfillment/paqs.gitProvenance
Developer Affiliation(s)
Description
This repository provides scripts for developing PAQS queries. Follow the steps below to set up your local environment, develop and test PAQS queries.
Build With
Databases
Supported
Tested
Prerequisites
Development can be done in the container or natively. However, we recommend to use the container for easier dependency management and portablity of the package.
Ensure you have container management software such as Docker or Podman installed.
Clone this Repository
You’ll need this base package to start query development from regardless of environment
Note: Avoid direct edits to the cloned directory to maintain integrity.
git clone https://github.com/Query-Fulfillment/paqs.git
Scripts and Directories
paqs
├── config_template
│ ├── bigquery
│ ├── databricks
│ ├── duckdb
│ ├── mssql_ad
│ ├── mssql_db
│ ├── oracle
│ ├── postgres
│ └── snowflake
├── Dockerfile
├── LICENSE.txt
├── package
├── query
│ ├── code_sets
│ ├── execute_req.R
│ ├── results
│ └── script
│ ├── base
│ │ ├── helper.R
│ │ └── setup.R
│ ├── study
│ ├── driver.R
│ ├── report.qmd
│ └── study
├── README
├── renv.lock
├── results
├── tools
│ ├── banner
│ ├── build_package.sh
│ ├── handler.sh
│ ├── parse_log.sh
│ ├── PCORnet-logo-resize.png
│ └── pcornet-style-sheet.css
└── workplan.qmd
- Dockerfile: Contains the recipe to build a query specific image from a pre-built image and execute the query within the container
- config_template/: Contains configuration templates for establishing a connection to the database
- query/code_sets/: Contains codeset files when required to execute the request
- query/results/: Initially empty. Will store query results in the container which will be mounted to
../results - query/script/: Contains query execution code needed to execute the request
- query/script/base: Contains query execution code that is standard for all queries [DO NOT EDIT]
- query/script/study: Empty initially. Should contain query execution code that is specific to the current request [ALWAYS CUSTOM CODE]
- query/script/query: Contains query execution code that is specific to the query that is being developed [Add new code/scripts in this directory]
- query/execute_req.R: Contains code to drive query execution using an R function
- tools/: Contains miscellaneous files required for the query
- results: Initially empty. This directory will be mounted with the
query/resultsdirectory within the container. Output generated by the query are to be returned via your site’s PCORnet® AWS S3 bucket. These tables consist of aggregate data/output and transfers the minimum information required to answer the analytic question. Please see Step 4 of the Returning Results section of this workplan for information on returning query output generated in this folder.
Booting up a Development Environment
Run below command in terminal. Please replace {home_dir} with the home directory on your machine and update the tag with the version you want to use. For new query, it’s recommended to use the latest version.
docker run --rm -p 8787:8787 -e PASSWORD=pass -e ROOT=TRUE -v {home_dir}:/home/rstudio pcornetqf/qf-r-base-rstudio:2.0.1
Open web browser and go to localhost:8787. Log in with username=rstudio and password=pass.
For more details on pre-built docker image see here.
New request
- Navigate to the terminal in R-studio and navigate to the directory where you want to create a new request.
- Copy and paste the path to new_request.sh, then execute it with a unique identifier for the report, such as:
path/to/new_request.sh fd1000
**Note:** This repository is under active development; the code is subjected to change.
