I hereby claim:
- I am xwmx on github.
- I am williammelody (https://keybase.io/williammelody) on keybase.
- I have a public key whose fingerprint is E40E 93A0 B64B 2240 1128 7058 B720 9D44 B320 8C42
To claim this, I am signing this object:
-- PostgreSQL 9.2 beta (for the new JSON datatype) | |
-- You can actually use an earlier version and a TEXT type too | |
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
-- Inspired by | |
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
-- http://ssql-pgaustin.herokuapp.com/#1 | |
-- JSON Types need to be mapped into corresponding PG types | |
-- |
CREATE or REPLACE FUNCTION | |
json_get(data json, prop text) RETURNS JSON as $$ | |
prop = prop.split('.'); | |
for (var i = 0, len = prop.length; i < len - 1; i++) { | |
data = data[prop[i]]; | |
} | |
return data[prop[len - 1]]; | |
$$ LANGUAGE plv8 STABLE STRICT; |
### Keybase proof | |
I hereby claim: | |
* I am alphabetum on github. | |
* I am williammelody (https://keybase.io/williammelody) on keybase. | |
* I have a public key whose fingerprint is E40E 93A0 B64B 2240 1128 7058 B720 9D44 B320 8C42 | |
To claim this, I am signing this object: |
I hereby claim:
To claim this, I am signing this object: