CodeFaster

CodeFaster

Share this post

CodeFaster
CodeFaster
json-sql

json-sql

Tyler Adams's avatar
Tyler Adams
Jan 05, 2021
∙ Paid

Share this post

CodeFaster
CodeFaster
json-sql
2
Share

Ever wanted to dump a sql DB as json? Me too. In this post, we’ll go over a powerful tool, json-sql to help you work with sql data directly as json.

Why json over raw sql?

json is faster and easier to work with than raw sql data:

  • Raw json can be fed directly into other programs, raw sql cannot

  • Your favoriate language is faster to write than sql. You know your favorite language better than sql and you know how to debug it much faster.

  • json can be edited with any text editor, unlike raw sql which is binary and therefore requires special editors to manipulate.

  • json solves a much wider range of problems than sql, so the more json experience we get, the faster we get at json and therefore we get faster at a wider range of problems than the sql experience.

Why json-sql?

Dumping a database as json to stdout is surprisingly hard to do without a special tool. Dumping a single table is doable, but involves some magic, plus clever uses of sed and jq to clean the raw output up. All summed up, we could us…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Tyler Adams
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share