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

Not able to import qs to run examples #18

Closed
solidsnack opened this issue Nov 16, 2014 · 2 comments
Closed

Not able to import qs to run examples #18

solidsnack opened this issue Nov 16, 2014 · 2 comments

Comments

@solidsnack
Copy link
Contributor

I've tried both the OneJS (https://github.com/clkao/plv8x/tree/master) and the
Browserify (https://github.com/clkao/plv8x/tree/browserify) branches.

The OneJS branch results in:

postgres=# SELECT ~>'require("qs").parse("foo=bar&baz=1")';
WARNING:  failed to load module qs: Error: Cannot find module "qs" @[module: lib/index package: plv8x]
ERROR:  TypeError: Cannot call method 'parse' of undefined
DETAIL:  undefined() LINE 1:   return require("qs").parse("foo=bar&baz=1");

The Browserify branch results in:

postgres=# SELECT ~>'require("qs").parse("foo=bar&baz=1")';
WARNING:  failed to load module LiveScript:
ERROR:  TypeError: Cannot call method 'compile' of undefined
DETAIL:  boot() LINE 82:   return require('LiveScript').compile(expression, {

Yet the install appears to have succeeded:

postgres=# SELECT name FROM plv8x.code;
 name
-------
 qs
 plv8x

postgres@...:~$ plv8x -d /var/run/postgresql -l
qs: 12615 bytes
plv8x: 899907 bytes

This on a default install of Postgres 9.3 on Ubuntu 14.04 with Node v0.10.29
and NPM 1.4.14 (both of which were install via packages).

@clkao
Copy link
Owner

clkao commented Feb 17, 2015

Hm, the ~> operator requires LiveScript. try this:

#postgres=# SELECT |> 'require("qs").parse("foo=bar&baz=1")';

@clkao clkao closed this as completed Feb 17, 2015
@solidsnack
Copy link
Contributor Author

Okay, how do I run a web server inside Postgres?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants