This file contains 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
#!/usr/bin/env bash | |
usage() { | |
echo "Usage: $0 <type> [<schema>.]<name> [r=<requirement>[,<requirement>]...] [<param_name>=<param_value>[,<param_value>]...] [<param1_name>:<param2_name>=<param1_value>:<param2_value>[,<param1_value>:<param2_value>]...]" | |
echo " arguments must be SQL safe strings (A-z 0-9 _ .)" | |
echo " schema defaults to public if not specified" | |
echo " specify 'schema' as <type> and the name of the schema as <name> to add a schema" | |
} | |
if [ "$BASH_VERSINFO" -lt 4 ]; then |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |
This file contains 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
CREATE OR REPLACE FUNCTION validate_user( | |
email TEXT | |
, token UUID | |
) | |
RETURNS BOOL | |
LANGUAGE plpgsql | |
AS $$ | |
DECLARE | |
BEGIN | |
IF exists(SELECT |
This file contains 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
CREATE EXTENSION plv8; | |
CREATE OR REPLACE FUNCTION verify_google_jwt(jwt_token TEXT) | |
RETURNS JSONB | |
LANGUAGE plv8 IMMUTABLE STRICT | |
AS $$ | |
function logerror(msg) { | |
plv8.elog(ERROR, msg); | |
} |
This file contains 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
-- Deploy myproject:application_function__benchmark to pg | |
-- requires: application__schema | |
BEGIN; | |
SET search_path TO application; | |
CREATE TYPE _bench_result AS ( | |
function_name TEXT, | |
runtime REAL, |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |
This file contains 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
-- Deploy [% project %]:[% change %] to [% engine %] | |
[% FOREACH item IN requires -%] | |
-- requires: [% item %] | |
[% END -%] | |
[% FOREACH item IN conflicts -%] | |
-- conflicts: [% item %] | |
[% END -%] | |
BEGIN; |