Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify for postgres specific variable expansion #2

Closed
qjhart opened this issue Nov 6, 2015 · 0 comments
Closed

Modify for postgres specific variable expansion #2

qjhart opened this issue Nov 6, 2015 · 0 comments

Comments

@qjhart
Copy link

qjhart commented Nov 6, 2015

You example was incredibly clarifying. Looking at that, I have an alternative suggestion. Postgres has variable expansion, which is in some ways clunky, but in other ways super nice. One part of this is that it will do shell command substitution, which we can use to simplify the setup.

Taking your example, we replace with: (This is not fully baked)

\set require `pwd` / foo.js
\set  es6-to-plv8  'es6-to-plv8 -h '  :require 
\set browserified :`es6-to-plv8`

create or replace function init() returns void
language plv8
as $function#
:browserified
$function$;

create or replace function foo()
returns text
language plv8 IMMUTABLE STRICT
as
$$
return Testing.foo();
$$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants