Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
plv8x helps you manage functions and packages in plv8, postgresql's javascript procedural language support.
Note: Requires postgresql 9.1 or later. 9.0 will be supported soon.
# for older distros: sudo add-apt-repository ppa:martinkl/ppa
sudo apt-get install libv8-dev
sudo easy_install pgxnclient
sudo pgxn install plv8
If you have trouble installing plv8 on MacOSX, try the fork that includes unmerged patches for build fixes here: https://github.com/clkao/plv8js
% git clone git://github.com/clkao/plv8x.git; cd plv8x
% npm i -g .
Enable plv8x for your database:
plv8x --db tcp://localhost/test -l
[INFO] console - plv8x: 491425 bytes
Now try:
test=# select '{"foo": [1,2,3]}'::json |> 'function() { return this.foo[1] }';
?column?
----------
2
Expression works too:
test=# select '{"foo": [1,2,3]}'::json |> 'return this.foo[1]';
?column?
----------
2
CoffeeScript:
test=# select '{"foo": [1,2,3]}'::json |> '@foo[1]';
?column?
----------
2
Actually it was LiveScript: (please send pullreqs for coffeescript support!)
test=# select '{"foo": [1,2,3]}'::json |> '@foo.1 * 5';
?column?
----------
10
<|
is |>
reversed:
test=# select '@foo.1 * 5' <| '{"foo": [1,2,3]}'::json
?column?
----------
10
|>
as unary operator:
test=# select |> '~> plv8x.require "LiveScript" .compile "-> \Hello" {+bare}';
?column?
--------------------------------------
"(function(){\n return Hello;\n});"
MIT
FAQs
Use JavaScript expressions and modules in PostgreSQL plv8
The npm package plv8x receives a total of 35 weekly downloads. As such, plv8x popularity was classified as not popular.
We found that plv8x demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.