-
Notifications
You must be signed in to change notification settings - Fork 71
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
Node wrapper #70
Comments
Can you tell me how i can run this? I have always been curious about 2016-02-05 15:18 GMT+01:00 Wouter Hager [email protected]:
|
Simply install node and run |
Docs for node-ref: https://tootallnate.github.io/ref/ |
I got it running. When I insert a lot of "console.log()" statements, then I see that it I tried to change the declaration of ups_strerror to
but this still did not work. When I remove the call to ups_strerror then opened env <Buffer@0xa87170 00 00 00 00 00 00 00 00> /mnt/f139c910-8da7-4153-a314-ca180468b45b/prj/nodejs/node_modules/ffi/lib/_foreign_function.js:55 Do you know how to fix ups_strerror? It looks to me like node is not able 2016-02-05 15:36 GMT+01:00 Wouter Hager [email protected]:
|
@cruppstahl Ah yes, I was looking in the wrong place. You're right, |
@cruppstahl the status is stringified in the line before the actual call to |
@cruppstahl Ah of course, I think it says 'unknown error' because there is none. Please ignore the previous comment, the data of status is empty every time! |
@cruppstahl I've updated the gist to a working script, but I don't understand the values of the buffers. It's getting late, I'll continue tomorrow. |
@cruppstahl Are you still interested in supporting node? I would like to give this another try, but I'm having trouble with doing inserts, as I don't have the correct key/record types. |
If you want to work on it then go ahead, but I'm so swamped right now that I won't be able to help much. It does not have high priority for me, though. |
@cruppstahl Ok, thanks for your reply, I figured you would be. I hope and assume your hard work will pay off. I made little progress, but it seems I was able to remove some data. One of the problems is that node can't seem to write an empty db file on its own, so I wondered if that is something you could help with. |
Ah my bad, I was using the wrong function to create a db file. |
Feel free to send me the code in case you get stuck.
Am 29.03.2017 13:20 schrieb "Wouter Hager" <[email protected]>:
… Ah my bad, I was using the wrong function to create a db file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#70 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMxg4A4S6-TB9aC7SXFcWt3jEjU3oghks5rqj5sgaJpZM4HUTiU>
.
|
Hi, I got something working! I've updated the gist (https://gist.github.com/wshager/edf7bb5d58d4873fea88). Some things to consider:
Thanks in advance for your response. |
Aargh I'm not sharp enough for this job... Ignore the last bit, I forgot to close the db. Will update the gist now. |
@cruppstahl I can't set parameters on |
Persistence pays off once again. I got the parameter array working. The trick was to pass var Struct = require('ref-struct');
var ArrayType = require('ref-array');
var ups_parameter_t = Struct({
'name': ref.types.uint32,
'value': ref.types.uint64
});
const UPS_PARAM_KEY_TYPE = 0x00000104;
const UPS_TYPE_UINT32 = 7;
var Params = ArrayType(ups_parameter_t);
var db = ref.alloc('pointer');
var params = new Params(2);
params[0] = new ups_parameter_t({
name: UPS_PARAM_KEY_TYPE,
value: UPS_TYPE_UINT32
});
params[1] = new ups_parameter_t({
name: 0,
value:0
});
var st = ups.ups_env_create_db(env.deref(), db, nr, 0, params.buffer); |
Hello Wouter and Christoph, sorry to "revive" this old issue. I would like to ask Wouter if the Node wrapper worked and ask Christoph if you are still using UpscaleDB in production, because it seems really mature. Thanks! |
Hi @paulocoghi - mature yes, but I'm no longer actively maintaining upscaledb. Using it is at your own risk! |
I'm trying to create a node wrapper using node-ffi. It seems pretty straightforward, but I get a segfault when trying to work with cursors. Please consider the code: https://gist.github.com/wshager/edf7bb5d58d4873fea88
The text was updated successfully, but these errors were encountered: