@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@benjie
@jemgillam
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
CREATE FUNCTION plv8_test (keys text[], vals text[])
RETURNS text
AS $$
var object = {}
for (var i = 0; i < keys.length; i++) {
object[keys[i]] = vals[i]
}
return JSON.stringify(object)
$$
LANGUAGE plv8
IMMUTABLE STRICT;
PLV8
CREATE FUNCTION app.register_user (first_name text, email text, PASSWORD text)
RETURNS app.user
AS $$
DECLARE
person app.user;
BEGIN
INSERT INTO app.user(first_name, created_at)
values(first_name, now())
RETURNING
* INTO person;
INSERT INTO app_private.account (user_id, email, password_hash)
values(person.id, email, crypt(PASSWORD, gen_salt('bf')));
RETURN person;
END;
$$
LANGUAGE plpgsql
STRICT
SECURITY DEFINER;
PLPSQL
@thomasankcorn on Twitter
SELECT graphile_worker.add_job(
'testTask',
json_build_object('name', 'Bobby Tables')
);
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter
@thomasankcorn on Twitter