Using the Power of Javascript
in the database
(to build a database)
PostgreSQL has stored procedures
CREATE OR REPLACE FUNCTION myCoolThing (arg1 VARCHAR, arg2 INT) RETURNS
SETOF JSON AS $$
return [ { "first": arg1, "second": arg2 ];
$$ LANGUAGE plv8 STRICT;
// createdb pdxnode
// psql pdxnode
// create extension plv8
// copy/paste
// SELECT myCoolThing(‘abc’, 123);
// we’ve been given the most awesome database in the world
// and we can do anything!