Schema for Postgres postgres:11
create table test_table_1 (
time timestamptz default now(),
id int,
name text
);
create table test_table_2 (
time timestamptz default now(),
id int,
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: ddn | |
rules: | |
- apiGroups: | |
- apiextensions.k8s.io | |
resources: | |
- customresourcedefinitions |
{"operationName":"IntrospectionQuery","query":"\n query IntrospectionQuery {\n __schema {\n \n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n \n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n \n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n |
-- -- /******************************************************************************* | |
-- -- Chinook Database - Version 1.4 | |
-- -- Script: Chinook_PostgreSql.sql | |
-- -- Description: Creates and populates the Chinook database. | |
-- -- DB Server: PostgreSql | |
-- -- Author: Luis Rocha | |
-- -- License: http://www.codeplex.com/ChinookDatabase/license | |
// Sheet structure: | |
// Columns: | |
// event_id, city, start, end, location, title, notes | |
// leave event_id empty, it will be updated when the script runs | |
var | |
COL_EVENT_ID = 0, COL_EVENT_ID_ADDRESS = 'A', | |
COL_CITY = 1, | |
COL_START = 2, | |
COL_END = 3, | |
COL_LOCATION = 4, |
// usage: | |
// DiffYaml(d2, d1, os.Stdout) | |
package diff | |
import ( | |
"fmt" | |
"io" | |
"strings" | |
"github.com/aryann/difflib" |
Schema for Postgres postgres:11
create table test_table_1 (
time timestamptz default now(),
id int,
name text
);
create table test_table_2 (
time timestamptz default now(),
id int,
#! /usr/bin/env bash | |
# | |
# Usage: ./process_pg_dump.sh <file-name.sql> | |
# | |
if [ "$#" -ne 1 ]; then | |
echo "Invalid usage: ./process_pg_dump.sh <file-name.sql>" | |
fi | |
filename=$1 |
query getFirst10Pokemons { | |
pokemons(first: 10) { | |
name | |
} | |
} |
Operator | Postgres equivalent | Description |
---|---|---|
_contains |
@> |
Does the column value contains these key-value pairs at top-level? |
_contained_in |
<@ |
Is the column value contained in this JSON object at top-level? |
_has_key |
? |
Does the string exist as a top-level key within the JSON value? |
_has_keys_any |
?| |
Do any of these array strings exist as top-level keys? |
_has_keys_all |
?& |
Do all of these array strings exist as top-level keys? |
#!/usr/bin/env bash | |
# wait for a program to start listening on a PORT ($1) | |
wait_for_port() { | |
local PORT=$1 | |
echo "waiting for $PORT" | |
for i in `seq 1 60`; | |
do | |
nc -z localhost $PORT && echo "port $PORT is ready" && return | |
echo -n . |