FS-11827: [Core] Add feature allowing FreeSWITCH to store CORE DB (SQLite) fully in memory (core-db-dsn).

This commit is contained in:
Andrey Volk
2019-09-15 23:56:04 +04:00
parent e753e615ca
commit 20295c53ef
5 changed files with 121 additions and 27 deletions
+11
View File
@@ -51,6 +51,12 @@ SWITCH_BEGIN_EXTERN_C
* following opaque structure.
*/
typedef struct sqlite3 switch_core_db_t;
struct switch_core_db_handle {
switch_bool_t in_memory;
switch_core_db_t *handle;
};
typedef struct sqlite3_stmt switch_core_db_stmt_t;
typedef int (*switch_core_db_callback_func_t) (void *pArg, int argc, char **argv, char **columnNames);
@@ -102,6 +108,11 @@ SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db);
*/
SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb);
/**
Same as switch_core_db_open() but additionally allows SQLITE_OPEN_URI
*/
SWITCH_DECLARE(int) switch_core_db_open_v2(const char *filename, switch_core_db_t **ppDb);
/**
* ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(),
* even empty strings, are always zero-terminated. ^The return