SQCloudBlobClose
bool SQCloudBlobClose (SQCloudBlob *blob);
Description
This function closes an open BLOB handle. The BLOB handle is closed unconditionally. Even if this routine returns an error code, the handle is still closed. This function resembles the sqlite3_blob_close SQLite API.
Parameters
- blob: a valid SQCloudBlob opaque datatype obtained by SQCloudBlobOpen
Return value
true
if operation succed, 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;");
// open a BLOB for reading
SQCloudBlobOpen *blob = SQCloudBlobOpen(conn, NULL, "mytable", "mycolumn", 1, 0);
// ...
// close BLOB
SQCloudBlobClose(blob);
}