Search code examples
ccouchbasesql++

Couchbase C API doesn't have n1ql.h anymore?


A couple years ago I wrote a small utility program for my employer, which accessed a Couchbase cluster via the Couchbase C SDK. I've just returned to it to add some new features, installed the Couchbase C SDK on my Ubuntu 20.04 development system via the instructions found here, and tried to compile my code, and it complains that it can't find libcouchbase/n1ql.h. When I checked, sure enough, the file is nowhere to be found on my machine.

I've tried installing all of the packages provided by their repository, none of which seem to provide that file. I've also tried removing them all and installing libcouchbase from source, with no luck (the instructions seem completely out of date); searched it manually but that file isn't in there either. Even grepping for other items that I know have to be in there, like lcb_N1QLHANDLE, doesn't turn up anything.

There's obviously something I'm missing, but I can't even see the shape of it. Have they moved the N1QL code to a separate repository? Gotten rid of it entirely? Renamed it without updating the documentation?


Solution

  • The utility you wrote was probably built using an older version of libcouchbase than what's in the "master" branch on GitHub. If you check out the tag 2.10.7 you can see the n1ql.h header here:

    https://github.com/couchbase/libcouchbase/tree/2.10.7/include/libcouchbase

    Installation instructions and other documentation for version 2.10 are here:

    https://docs.couchbase.com/c-sdk/2.10/start-using-sdk.html