-
Notifications
You must be signed in to change notification settings - Fork 0
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
Example #1
Comments
Hi, This project is far from finished, and the API isn't stable yet. At any rate the idea is to use the interfaces in combination with Vibe's Rest client generator to provide a direct mapping of the Arango APIs, and to layer something easier to use on top later. The arango API is defined here: A small example of something that already works (untested, I'm not at my pc right now): import arangoclient;
auto db = arangoClient("http://localhost:port", "myTestDatabase", "userName", "password");
static struct Message
{
string name, message;
}
db.document.add("messages", "someKey", Message("foo", "bar"));
static struct QueryArgs { string name; }
foreach(message; db.cursor.query!Message("FOR message IN messages FILTER message.name == @name RETURN message.data", QueryArgs("foo")))
{
writeln(message);
} The reason for using If vibe-d/vibe.d#1676 gets pulled I'll be able to clean this up. |
Thanks for response! Is there difference between working with http and some more native drivers? I thought that native drivers should work faster because afaik they use some compact binary protocols. |
To my knowledge all ArangoDB drivers use the HTTP interface under the hood. AFAIK it's the only interface to the database. It's true that a binary protocol might be a bit smaller, but since ArangoDB data model is based on free form JSON documents you'll always get the fieldname: value overhead on some form or another. But compression of the requests and responses should already take care of the bulk of it ;) |
Oh! Very interesting project!
Could you give examples how to use it?
P.S. there is very good lib for work with http https://github.com/ikod/dlang-requests it maybe helpfull.
The text was updated successfully, but these errors were encountered: