evanj / partiqldemo

A web tool to experiment with PartiQL queries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PartiQL Demo

This is a Go web server that wraps the PartiQL command line tools in a web interface, to make it easier to use. Try it with a version running on Google Cloud Run.

Usage

  1. Build it with make
  2. Run it with go run . --jar=build/partiqldemo.jar
  3. Visit http://localhost:8080/

Java input

The command line tool reads the "environment" a file, then reads the query from standard input. It then executes the query and prints the output on standard output.

This unfortunately requires starting the JVM then tearing it down. To make the web interface work with lower latency, it also supports a server mode. It reads input from standard input using the following protocol:

  • 4 bytes little endian: length of query
  • 4 bytes little endian: length of environment
  • query bytes (UTF-8)
  • environment bytes (UTF-8)

After reading the input, it writes to standard out

  • 4 bytes little endian: length of output
  • output bytes (UTF-8)

About

A web tool to experiment with PartiQL queries

License:MIT License


Languages

Language:Go 69.4%Language:Java 22.0%Language:Makefile 6.2%Language:Dockerfile 2.4%