SQCloudResultIsOK
bool SQCloudResultIsOK (SQCloudResult *result);
Description
Check if the opaque datatype result is an OK message.
Parameters
- result: A valid SQCloudResult pointer returned by an SQCloud function.
Return value
true
if result is OK, otherwise false
.
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
SQCloudResult *r = SQCloudExec(conn, "USE DATABASE mydatabase.sqlite;");
if (SQCloudResultIsOK(r)) {
printf("USE DATABASE succesfully executed.\n");
} else {
printf("An error occurred while processing the USE DATABASE command.\n");
}
// ...
}