SQCloudResultLen
uint32_t SQCloudResultLen (SQCloudResult *result)
Description
Return the length of the raw buffer contained in the result opaque datatype.
Parameters
- result: A valid SQCloudResult pointer returned by an SQCloud function.
Return value
An uint32_t
length value.
Example
int main (int argc, const char * argv[]) {
// setup config
SQCloudConfig config = {0};
config.username = "myusername";
config.password = "mypassword"
SQCloudConnection *conn = SQCloudConnect("myproject.sqlite.cloud", SQCLOUD_DEFAULT_PORT, &config);
if (SQCloudIsError(conn)) {
printf("ERROR connecting: %s (%d)\n", SQCloudErrorMsg(conn), SQCloudErrorCode(conn));
return -1;
} else {
printf("Connection to host OK...\n\n");
}
// choose a database first (no error check)
SQCloudResult *r = SQCloudExec(conn, "USE DATABASE mydatabase.sqlite;");
// perform a query (no error check)
SQCloudResult *r2 = SQCloudExec(conn, "SELECT * FROM table1;");
int32_t len = SQCloudResultLen(r2);
printf("Query size: %d\n", len);
// ...
}