Skip to content

fuyutarow/piqel

Repository files navigation

PartiQL-rs

WIP

What's PartiQL?

pq command

curl -s https://api.github.com/users/fuyutarow/repos | pq -q "$(cat<<EOS
SELECT
  owner.login AS user,
  stargazers_count AS star,
  svn_url AS url,
EOS
)" -t yaml

Installation

brew install fuyutarow/tap/pq

Sample Usage

Convert JSON <--> TOML <--> YAML <--> ...

Support

  • JSON
  • JSON5
  • TOML
  • YAML
  • XML
env | jo | pq
env | jo | pq -t yaml
env | jo | pq -t yaml | pq -t toml

sort keys of objects on output

env | jo | pq -S ;:
FYI
  • jo is a useful tool for creating json objects.
    brew install jo
    

Convert data

env | jo | pq "SELECT NAME AS name, USER AS user"

ip command is only available in Linux and WSL, not in Mac.

ip -j -p | pq "$(cat<<EOS
SELECT
  address,
  info.family AS inet,
  info.local
FROM addr_info AS info
WHERE inet LIKE 'inet%'
EOS
)"

For Development

Requirements

Preparation

makers install-dev

build

makers build
makers build:pq ;: for pq commnad

test

makers test:lib
makers test:pq ;: for pq commnad