Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Florents-Tselai authored Mar 2, 2024
1 parent 83d7bb4 commit 213bb8b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ from movies
group by jq(d, '.year')
```

## Notes Installation
## Notes On Installation

For this to work, you'll need development files for both SQLite and jq.

### MacOS

Expand All @@ -133,6 +135,9 @@ brew install jq sqlite3
make all
```

I've found that `brew` installs header files auomatically for you,
so there's nothing else you have to do

Verify installation

```sh
Expand All @@ -144,8 +149,12 @@ EOF

### Linux

On Linux, things can be trickier because
most distros don't have `jq` configured,
```sh
sudo apt install sqlite3 libsqlite3-dev jq libjq-dev
```

On Linux, sometimes things can be trickier because
many distros don't have `jq` configured with `pkg-config`
so your best guess would be installing `jq` from source first.

If you already have `jq` installed to a known prefix,
Expand Down Expand Up @@ -175,6 +184,13 @@ Then try again
make
```

```sh
sqlite3 :memory: <<EOF
.load ./litejq
select jq('{"key": "litejq is loaded"}', '.key')
EOF
```

# Others

There is [another](https://mgdm.net/weblog/using-jq-in-sqlite/) similar extension, but it's written in Go and relies on a non-vanilla implementation of JQ.

0 comments on commit 213bb8b

Please sign in to comment.