jq is useful to slice, filter, map and transform structured json data.
brew install jq
| These are my red gate snippets. | |
| The powershell file "PushSnippets.ps1" is used to update them. | |
| It can be modified so as to push your own snippets once you create a GIST for them. |
| --SELECT * FROM sys.databases | |
| SELECT 'SERVER OPTIONS' AS 'container' | |
| /* | |
| Author: Tim Cartwright | |
| Purpose: Allows you to check the server, and client SET options | |
| https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-user-options-server-configuration-option | |
| 1 DISABLE_DEF_CNST_CHK Controls interim or deferred constraint checking. |
| DROP TABLE IF EXISTS pgbench_generic_log; | |
| CREATE TABLE pgbench_generic_log ( | |
| mtime timestamptz not null default now(), | |
| action char not null check (action in ('I', 'U', 'D')), | |
| username text not null, | |
| table_name text not null, | |
| row_data jsonb not null | |
| ); | |
| CREATE INDEX ON pgbench_generic_log USING brin (mtime); |
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
| /* | |
| -- EXAMPLE -- | |
| SELECT | |
| * | |
| FROM grid(array(SELECT | |
| ( | |
| lat, |