I’m brand new to couchbase, and I’m developing a client which needs to issue prepared/parameterized n1ql queries via the c++ client library (https://github.com/couchbaselabs/libcouchbase-cxx). Issuing static queries is straightforward, but I haven’t been able to find the correct process for issuing prepared queries. Has anybody been able to do this?
@mnunberg can you provide insight on this issue?
the C++11 project is not supported or recommended for production use, and its API may change altogether. If you are building your own library on top of ours, I would definitely recommend using the raw C API.
That being said, you can use
QueryCommand::named_param for example,
QueryCommand cmd("SELECT META().id FROM users WHERE name=$1 OR email=$2");
Thanks @nmnumber, are there any plans for official support of a C++ based API?
It may be supported in the future. In essence however there is little to support: it’s just a set of header wrappers over the C library. In essence when I say support, I mean the C++ API (-cxx) may change or may be buggy; but it should always work with the C library.
@mnunberg we couldn’t find any licensing info for libcouchbase-cxx, is it apache 2?
For anybody interested, @mnunberg has updated the project w/ Apache 2 license.