This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
args AS ( | |
SELECT | |
' | |
[ | |
[[1,3]], | |
[[3,5],[7,8]], | |
[[8,8]], | |
[[0,100]] | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const through2 = require('through2'); | |
const split2 = require('split2'); | |
var vowels = through2({ objectMode: true }); | |
var consonants = through2({ objectMode: true }); | |
var muxed = through2({ objectMode: true, highWaterMark: 1 }); | |
[vowels, consonants].forEach(x => x.pipe(muxed)); | |
muxed.pipe(process.stderr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export namespace api { | |
export interface Request< | |
> { | |
method: string; | |
params: any; | |
result: any; | |
} | |
export interface Notification< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export namespace api { | |
export interface Request<T extends string> { | |
params: any; | |
result: any; | |
__name: { | |
[name in T]: T | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { spawn } from 'child_process'; | |
import { Writable, Readable } from 'stream'; | |
const child = spawn( | |
'perl', | |
['-e', ` | |
use IO::Handle; | |
my $in = IO::Handle->new_from_fd($ENV{JIPE_RHS_STDIN_FD}, 'r'); | |
my $out = IO::Handle->new_from_fd($ENV{JIPE_RHS_STDOUT_FD}, 'w'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP VIEW IF EXISTS stored_procedure_do; | |
CREATE VIEW IF NOT EXISTS stored_procedure_do | |
AS SELECT NULL AS json_args LIMIT 1; | |
DROP TABLE IF EXISTS stored_procedure_result; | |
CREATE TABLE IF NOT EXISTS stored_procedure_result( | |
json_result | |
); | |
DROP TRIGGER IF EXISTS stored_procedure_impl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- styles for CPAN module Text::ANSITable | |
SELECT | |
time, priority, message | |
, | |
json_object( | |
'priority', | |
json_object( | |
'fgcolor', | |
CASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi, | |
Using the sqlite-tools-linux-x86-3250100 Linux binaries I find that | |
Window functions in VIEWS behave differently from PostgreSQL 9.6 and | |
from what I expect. | |
DROP TABLE IF EXISTS example; | |
CREATE TABLE example(t INT, total INT); | |
INSERT INTO example VALUES(0,2); | |
INSERT INTO example VALUES(5,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP VIEW IF EXISTS view_every_hour_past_six_months; | |
CREATE VIEW view_every_hour_past_six_months AS | |
WITH RECURSIVE | |
bounds AS ( | |
SELECT | |
strftime('%s', 'now', 'start of day', '-6 month') AS lower, | |
strftime('%s', 'now', 'start of day', '+1 day') AS upper | |
), | |
samples AS ( | |
SELECT lower AS sample FROM bounds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
token = _ | |
/ keyword | |
/ identifier | |
/ constant | |
/ string-literal | |
/ punctuator | |
preprocessing-token = _ | |
/ header-name | |
/ identifier |