basex-node does not cope with raw data #7

Closed
opened 2012-10-26 16:23:49 +01:00 by RemiArnaud · 3 comments
RemiArnaud commented 2012-10-26 16:23:49 +01:00 (Migrated from github.com)

node.js breaks in:

\node_modules\basex\lib\parser.js:35
+ ":" + buf;
^
expected status marker at2=65533:

When the query is:

session.query("declare option output:method 'raw'; db:retrieve('assets', '"+asset+"')");

node.js breaks in: \node_modules\basex\lib\parser.js:35 + ":" + buf; ^ expected status marker at2=65533: When the query is: session.query("declare option output:method 'raw'; db:retrieve('assets', '"+asset+"')");
apb2006 commented 2012-10-26 23:02:20 +01:00 (Migrated from github.com)

Yes, I am aware of this. I think it needs to use node buffers in place of strings (and implement the BaseX \0 escape protocol). I plan to fix this, and ideally implement a stream interface.

Yes, I am aware of this. I think it needs to use node buffers in place of strings (and implement the BaseX \0 escape protocol). I plan to fix this, and ideally implement a stream interface.
RemiArnaud commented 2012-10-27 05:47:43 +01:00 (Migrated from github.com)

Thanks a lot!

I have a work around for now (accessing directly the file in the database
raw folder), but won't work long term as I intent to generate the data on
the fly.

BTW, I was wondering if it would be possible to have basex-node in the
basex documentation - along with the PHP chapter?

Best Regards
-- Rémi

On Fri, Oct 26, 2012 at 3:02 PM, Andy Bunce notifications@github.comwrote:

Yes, I am aware of this. I think it needs to use node buffers in place of
strings (and implement the BaseX \0 escape protocol). I plan to fix this,
and ideally implement a stream interface.


Reply to this email directly or view it on GitHubhttps://github.com/apb2006/basex-node/issues/7#issuecomment-9828507.

Thanks a lot! I have a work around for now (accessing directly the file in the database raw folder), but won't work long term as I intent to generate the data on the fly. BTW, I was wondering if it would be possible to have basex-node in the basex documentation - along with the PHP chapter? Best Regards -- Rémi On Fri, Oct 26, 2012 at 3:02 PM, Andy Bunce notifications@github.comwrote: > Yes, I am aware of this. I think it needs to use node buffers in place of > strings (and implement the BaseX \0 escape protocol). I plan to fix this, > and ideally implement a stream interface. > > — > Reply to this email directly or view it on GitHubhttps://github.com/apb2006/basex-node/issues/7#issuecomment-9828507.
apb2006 commented 2012-12-30 18:19:30 +00:00 (Migrated from github.com)

This error is fixed in ver 0.6, which implements the BaseX FF escape protocol. See examples raw.js and 'RawExample.js`

More work is required to make this fully useful, and stream-able, but I think this will require changes to the interface.

Currently binary results are returned as a string in the reply object.

andy@ThinkPad-T42:~/workspace/basex-node$ node examples/raw.js 
{ result: '�PNG\r\n\u001a\n�\u0000�\u0000�\u0000\rIHDR�\u0000�\u0000�\u0000\b�\u0000�\u0000�\u0000\b\b\u0006�\u0000�\u0000�\u0000�\u000f���\u0000�\u0000�\u0000\u0004sBIT\b\b\b\b|\bd��\u0000�\u0000�\u0000/IDAT\u0018�c�������\u0006<�\t�$\u0003\u0003\u0003\u0003\u000b\u0003\u0003\u0003C\u0003##�`\u0003��\u0004M ���bG\u0012T�\u0000�\u0000�b\u000b\t����\u0000�\u0000�\u0000�\u0000IEND�B`�',
  info: '\nQuery executed in 0.88 ms.\n',
  ok: true }
This error is fixed in ver 0.6, which implements the BaseX FF escape protocol. See examples `raw.js` and 'RawExample.js` More work is required to make this fully useful, and stream-able, but I think this will require changes to the interface. Currently binary results are returned as a string in the reply object. ``` andy@ThinkPad-T42:~/workspace/basex-node$ node examples/raw.js { result: '�PNG\r\n\u001a\n�\u0000�\u0000�\u0000\rIHDR�\u0000�\u0000�\u0000\b�\u0000�\u0000�\u0000\b\b\u0006�\u0000�\u0000�\u0000�\u000f���\u0000�\u0000�\u0000\u0004sBIT\b\b\b\b|\bd��\u0000�\u0000�\u0000/IDAT\u0018�c�������\u0006<�\t�$\u0003\u0003\u0003\u0003\u000b\u0003\u0003\u0003C\u0003##�`\u0003��\u0004M ���bG\u0012T�\u0000�\u0000�b\u000b\t����\u0000�\u0000�\u0000�\u0000IEND�B`�', info: '\nQuery executed in 0.88 ms.\n', ok: true } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quodatum/basex-node#7
No description provided.