DBD-SQLite
view release on metacpan or search on metacpan
u32 j;
if( zPath==0 ) goto json_extract_error;
nPath = sqlite3Strlen30(zPath);
if( zPath[0]=='$' ){
j = jsonLookupStep(p, 0, zPath+1, 0);
}else if( (flags & JSON_ABPATH) ){
/* The -> and ->> operators accept abbreviated PATH arguments. This
** is mostly for compatibility with PostgreSQL, but also for
** convenience.
**
** NUMBER ==> $[NUMBER] // PG compatible
** LABEL ==> $.LABEL // PG compatible
** [NUMBER] ==> $[NUMBER] // Not PG. Purely for convenience
*/
jsonStringInit(&jx, ctx);
if( sqlite3_value_type(argv[i])==SQLITE_INTEGER ){
jsonAppendRawNZ(&jx, "[", 1);
jsonAppendRaw(&jx, zPath, nPath);
jsonAppendRawNZ(&jx, "]", 2);
}else if( jsonAllAlphanum(zPath, nPath) ){
jsonAppendRawNZ(&jx, ".", 1);
jsonAppendRaw(&jx, zPath, nPath);
}else if( zPath[0]=='[' && nPath>=3 && zPath[nPath-1]==']' ){
( run in 0.264 second using v1.01-cache-2.11-cpan-cc502c75498 )