https://github.com/extism/extism-pql
RunReveal's PQL compiler as an Extism plugin.
https://github.com/extism/extism-pql
Last synced: over 1 year ago
JSON representation
RunReveal's PQL compiler as an Extism plugin.
- Host: GitHub
- URL: https://github.com/extism/extism-pql
- Owner: extism
- Created: 2024-02-27T21:51:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-27T21:52:02.000Z (over 2 years ago)
- Last Synced: 2025-04-15T19:54:13.532Z (over 1 year ago)
- Language: Go
- Homepage: https://github.com/runreveal/pql
- Size: 270 KB
- Stars: 3
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PQL as an Extism Plugin
**Run the PQL compiler in 15+ programming languages, using Extism Host SDKs.**
See more: https://extism.org
## Example
Download the compiled `main.wasm` module [from Modsurfer](https://modsurfer.dylibso.com/module?hash=85bcfd5198efdbc30c0aab652c4a5de3c0bb0dfcdedf164131ab5f77329dff5c), or build it using [TinyGo](https://tinygo.org/) or Go.
```sh
tinygo build -o main.wasm -target wasi main.go
```
Next, try calling it using the [`extism` CLI](https://github.com/extism/cli):
```sh
cat example.pql | extism call main.wasm compile --stdin --wasi
SELECT * FROM "StormEvents" WHERE ("DamageProperty" > 5000) AND (coalesce("EventType" = 'Thunderstorm Wind', FALSE)) ORDER BY "DamageProperty" DESC NULLS LAST LIMIT 3;
```
## Using it from other languages
Extism enables many languages to make calls to Wasm functions, and thus PQL could be used to generate SQL from virtually any application. See all the available Host SDKs where you can run PQL using Extism:
https://extism.org/docs/concepts/host-sdk