Functions | |
alp_status_t | alp_sal_database_open (AlpSALHandle *sal, const char *dbName) |
alp_status_t | alp_sal_database_close (AlpSALHandle sal) |
alp_status_t | alp_sal_database_create (const char *dbFileName, const char *schemaFileName) |
alp_status_t | alp_sal_transaction_commit (AlpSALHandle sal) |
alp_status_t | alp_sal_transaction_begin (AlpSALHandle sal, char exclusive) |
alp_status_t | alp_sal_transaction_rollback (AlpSALHandle sal) |
alp_status_t | alp_sal_sql_execute (AlpSALHandle sal, const char *sql,...) |
alp_status_t | alp_sal_last_insert_rowid (AlpSALHandle sal, uint32_t *rowID) |
alp_status_t | alp_sal_execute_sql_script (AlpSALHandle sal, FILE *fd) |
alp_status_t | alp_sal_sql_get_value (AlpSALHandle sal, int32_t *value, const char *sql,...) |
const char * | alp_sal_get_error_message (AlpSALHandle sal) |
alp_status_t | alp_sal_string_build (char **combined, const char *sql,...) |
void | alp_sal_string_destroy (char *s) |
|
Closes a given database handle.
|
|
Creates a database and initializes its schema.
|
|
Opens a given database handle. The database should be closed when no longer needed with alp_sal_database_close()
|
|
Reads in all the text from the given file descriptor for a file that contains SQL commands. Once the file is read into memory, it's the executed and the buffer is freed. This is usful for initializing a table or schema using a resource file.
|
|
Returns string describing last error generated by Database
|
|
Assigns rowID to be the last auto-generated primary key created by an SQL INSERT statement
|
|
Executes a sql command given in a string buffer with a variable list of host parameter arguments. After plugging in the host variables to the sql string, the sql is executed and the buffer created by this routine is freed. In addition to the subsitution variables supported by printf, this routine also supports the variable: "%Q". When using Q, the string passed will get single quote escaped, or will get "NULL" if the string is null. If the string contains a single quote, it will be escaped (doubled) to form ''
|
|
Given a SQL statement, usually of the form "SELECT COUNT(*) FROM..." this function will prepare the statement from the SQL string and given host variables, if any, then execute the statement and read back the first column of the first row returned in the result set and assign that to value.
|
|
Creates a copy of the given SQL string returned in the first parameter, that has been resized and had it's substitution variables filled in. The SQL string can embed any of the standard C variable types (ie, "%d", "%s", etc) and it also provides a new variable type: "%q" that should be used for any string substitution which may have a single quotation mark. Single quotation marks are escaped (doubled) when substitution is performed on them. The caller should free the string returned in the first parameter by calling alp_sal_string_destroy
|
|
Frees a string created by SALBuildString. On most platforms (except notably Windows) it should be safe to just call "free" instead of SALStringDestroy(), so this API may be depricated
|
|
Executes "BEGIN TRANSACTION;" on the given Database.
|
|
Executes "COMMIT TRANSACTION;" on the given Database.
|
|
Executes "ROLLBACK TRANSACTION;" on the given Database.
|