Skip to content

pims/prql-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prql-go is a cgo-free alternative to https://github.com/PRQL/prql/blob/main/prql-lib/README.md

It uses https://github.com/tetratelabs/wazero as a WASM runtime to compile PRQL to SQL

$ go get github.com/pims/prql-go
import "github.com/pims/prql-go"
ctx := context.Background()
w, err := prql.New(ctx)
if err != nil {
    fmt.Println(err)
    os.Exit(1)
}
defer w.Close(ctx)

sql, err := w.Compile(ctx, "from employees | select [name,age]")
if err != nil {
    fmt.Println(err)
    os.Exit(1)
}
fmt.Println(sql)
// SELECT
//   name,
//   age
// FROM
//   employees

The prql-wasi.wasm file comes from https://github.com/pims/prql-wasi

About

Go library to compile PRQL to SQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages