AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Namespaces | |
test | |
Classes | |
class | SQLiteDatabase |
class | SQLiteMiscStorage |
class | SQLiteStatement |
Functions | |
sqlite3 * | createSQLiteDatabase (const std::string &filePath) |
sqlite3 * | openSQLiteDatabase (const std::string &filePath) |
bool | closeSQLiteDatabase (sqlite3 *dbHandle) |
bool | performQuery (sqlite3 *dbHandle, const std::string &sqlString) |
bool | getNumberTableRows (SQLiteDatabase *db, const std::string &tableName, int *numberRows) |
bool | getTableMaxIntValue (SQLiteDatabase *db, const std::string &tableName, const std::string &columnName, int *maxId) |
bool | tableExists (sqlite3 *dbHandle, const std::string &tableName) |
bool | clearTable (sqlite3 *dbHandle, const std::string &tableName) |
bool | dropTable (sqlite3 *dbHandle, const std::string &tableName) |
bool alexaClientSDK::storage::sqliteStorage::clearTable | ( | sqlite3 * | dbHandle, |
const std::string & | tableName | ||
) |
Deletes all records from a table.
dbHandle | A SQLite handle to an open database. |
tableName | The name of the table from which all rows should be deleted. |
bool alexaClientSDK::storage::sqliteStorage::closeSQLiteDatabase | ( | sqlite3 * | dbHandle | ) |
Closes a SQLite database.
The | handle to sqlite database. |
sqlite3* alexaClientSDK::storage::sqliteStorage::createSQLiteDatabase | ( | const std::string & | filePath | ) |
Creates a SQLite database at the given filePath. If a file at the given path already exists, this function will fail.
filePath | The location where the database should be created. |
nullptr
is returned. bool alexaClientSDK::storage::sqliteStorage::dropTable | ( | sqlite3 * | dbHandle, |
const std::string & | tableName | ||
) |
Drops a table from the database. Important note - per SQL mechanics, this single command will erase all records that may be stored in the table being dropped. This action cannot be undone.
dbHandle | A SQLite handle to an open database. |
tableName | The name of the table to be dropped. |
bool alexaClientSDK::storage::sqliteStorage::getNumberTableRows | ( | SQLiteDatabase * | db, |
const std::string & | tableName, | ||
int * | numberRows | ||
) |
Acquires the number of rows in a table within an open database.
db | A SQLite database object. | |
tableName | The name of the table to be queried. | |
[out] | numberRows | Where the number of rows will be stored on a successful lookup. |
bool alexaClientSDK::storage::sqliteStorage::getTableMaxIntValue | ( | SQLiteDatabase * | db, |
const std::string & | tableName, | ||
const std::string & | columnName, | ||
int * | maxId | ||
) |
Queries a specified column in a SQLite table, and identifies the highest value across all rows. This function requires that the table and column exists, and that the column is of integer type.
db | A SQLite database object. | |
tableName | The name of the table to be queried. | |
columnName | The name of the column in the table to be queried. | |
[out] | maxId | Where the maximum id will be stored on a successful lookup. |
sqlite3* alexaClientSDK::storage::sqliteStorage::openSQLiteDatabase | ( | const std::string & | filePath | ) |
Opens a SQLite database that will be stored at the given (already existing) filePath. If the database file does not already exist at the given filePath, this function will fail.
filePath | The location of the database file to be opened. |
nullptr
is returned. bool alexaClientSDK::storage::sqliteStorage::performQuery | ( | sqlite3 * | dbHandle, |
const std::string & | sqlString | ||
) |
Performs a SQL query, and does not inspect any result. This is an appropriate function to call for simple queries, which do not require bound parameters, such as when creating tables in a database.
dbHandle | A SQLite handle to an open database. |
sqlString | The SQL string which contains the full query to be performed. |
bool alexaClientSDK::storage::sqliteStorage::tableExists | ( | sqlite3 * | dbHandle, |
const std::string & | tableName | ||
) |
Queries if a table exists within a given open database.
dbHandle | A SQLite handle to an open database. |
tableName | The name of the table to be tested for. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0