Hi everyone,
background for my question:
I’m currently working (just started) to create a swift package ( swift couchbase client ) around the c sdk for apple’s opensourced swift language/compiler ( mac/linux (ubunut just now)).
Not used the C SDK direktyl until now ( only the php sdk in php ) i looked into the php extension code how it is done to get a clue about the working and choose a correct implementation way for swift.
The problem is not to get a connection it self, because it is pretty good documentated in the c sdk documentation.
But what got me wondering was, that in the cluser implementation of the php sdk a create options construct will be created like the following: ( not copy pasted from there ):
struct lcb_create_st cropts;
memset(&cropts, 0, sizeof cropts);
cropts.version = 3;
cropts.v.v3.connstr = "couchbase://localhost/mybucket";
cropts.v.v3.passwd = "topsecret";
cropts.v.v3.type = LCB_TYPE_CLUSTER
the bucket implementation using LCB_TYPE_BUCKET as cropts.v.v3.type.
So the main question is, what is the different of these two type constant ? Because i didn’t found any reference which calls needs what kind of server handle with a corresponding type, i decieded to ask before i loose several hours of testint to find out the differences between them.
Because of the constant description here ( http://docs.couchbase.com/sdk-api/couchbase-c-client-2.4.4/group__lcb-init.html#ggafb00d9eefaf18691d951141d1ee9b43baeaa2b53de032faf8cf26644019be2b50 ):
LCB_TYPE_BUCKET Handle for data access (default)
LCB_TYPE_CLUSTER Handle for administrative access.
Because of the “Handle for administrative access” i thought to use a dsn/connstr without a bucket name and provide the administrativ user name and password in the struct, but that do not worked. only with bucket and pw ( bucket name and bucket pw ) i could create a connection to the cluster.
Okay, the administrative stuff is done over the http_request stuff/calls, right ? so there should the admin name and pw provided. But why these different types for the normal client handles ?
I’m just very confused for now. So if someone can gibe some simple explentation or just documents to get these things sorted out would be very nice. (I do not need any coding help … just some answers to dig into the right direction and to build a robust swift couchbase client sdk/classes ).
So long
Stefan