Definice maker |
#define | CR_DB_CACHE_DBVERSION 10 |
#define | CR_DB_ERROR cr_db_error_quark() |
#define | cr_db_open_primary(PATH, ERR) cr_db_open(PATH, CR_DB_PRIMARY, ERR) |
#define | cr_db_open_filelists(PATH, ERR) cr_db_open(PATH, CR_DB_FILELISTS, ERR) |
#define | cr_db_open_other(PATH, ERR) cr_db_open(PATH, CR_DB_OTHER, ERR) |
#define | cr_db_close_primary(DB, ERR) cr_db_close(DB, CR_DB_PRIMARY, ERR) |
#define | cr_db_close_filelists(DB, ERR) cr_db_close(DB, CR_DB_FILELISTS, ERR) |
#define | cr_db_close_other(DB, ERR) cr_db_close(DB, CR_DB_OTHER, ERR) |
Definice typů |
typedef struct
_DbPrimaryStatements * | cr_DbPrimaryStatements |
typedef struct
_DbFilelistsStatements * | cr_DbFilelistsStatements |
typedef struct _DbOtherStatements * | cr_DbOtherStatements |
Funkce |
GQuark | cr_db_error_quark (void) |
sqlite3 * | cr_db_open (const char *path, cr_DatabaseType db_type, GError **err) |
cr_DbPrimaryStatements | cr_db_prepare_primary_statements (sqlite3 *db, GError **err) |
cr_DbFilelistsStatements | cr_db_prepare_filelists_statements (sqlite3 *db, GError **err) |
cr_DbOtherStatements | cr_db_prepare_other_statements (sqlite3 *db, GError **err) |
void | cr_db_destroy_primary_statements (cr_DbPrimaryStatements stmts) |
void | cr_db_destroy_filelists_statements (cr_DbFilelistsStatements stmts) |
void | cr_db_destroy_other_statements (cr_DbOtherStatements stmts) |
void | cr_db_add_primary_pkg (cr_DbPrimaryStatements stmts, cr_Package *pkg) |
void | cr_db_add_filelists_pkg (cr_DbFilelistsStatements stmts, cr_Package *pkg) |
void | cr_db_add_other_pkg (cr_DbOtherStatements stmts, cr_Package *pkg) |
void | cr_db_dbinfo_update (sqlite3 *db, const char *checksum, GError **err) |
void | cr_db_close (sqlite3 *db, cr_DatabaseType db_type, GError **err) |
Detailní popis
Module for writing sqlite metadata databases.
Example:
sqlite3 *primary_db;
cr_DbPrimary_Statements primary_statements;
Dokumentace k definicím maker
#define CR_DB_CACHE_DBVERSION 10 |
Version of DB api
Definice je uvedena na řádku 63 v souboru sqlite.h.
Macro over cr_db_close function. Close db.
- creates indexes on tables
- commits transaction
- closes db
- Parametry:
-
DB | open db connection |
ERR | **GError |
Definice je uvedena na řádku 130 v souboru sqlite.h.
Macro over cr_db_close function. Close db.
- creates indexes on tables
- commits transaction
- closes db
- Parametry:
-
DB | open db connection |
ERR | **GError |
Definice je uvedena na řádku 139 v souboru sqlite.h.
Macro over cr_db_close function. Close db.
- creates indexes on tables
- commits transaction
- closes db
- Parametry:
-
DB | open db connection |
ERR | **GError |
Definice je uvedena na řádku 121 v souboru sqlite.h.
Macro over cr_db_open function. Open (create new) filelists sqlite sqlite db.
- creates db file
- creates filelists tables
- creates info table
- tweak some db params
- Parametry:
-
PATH | Path to the db file. |
ERR | **GError |
- Návratová hodnota:
- open db pointer
Definice je uvedena na řádku 100 v souboru sqlite.h.
Macro over cr_db_open function. Open (create new) other sqlite sqlite db.
- creates db file
- opens transaction
- creates other tables
- creates info table
- tweak some db params
- Parametry:
-
PATH | Path to the db file. |
ERR | **GError |
- Návratová hodnota:
- open db connection
Definice je uvedena na řádku 112 v souboru sqlite.h.
Macro over cr_db_open function. Open (create new) primary sqlite sqlite db.
- creates db file
- creates primary tables
- creates info table
- tweak some db params
- Parametry:
-
PATH | Path to the db file. |
ERR | **GError |
- Návratová hodnota:
- open db pointer
Definice je uvedena na řádku 89 v souboru sqlite.h.
Dokumentace výčtových typů
Database type.
- Hodnoty výčtu:
CR_DB_PRIMARY |
primary
|
CR_DB_FILELISTS |
filelists
|
CR_DB_OTHER |
other
|
Definice je uvedena na řádku 74 v souboru sqlite.h.
Dokumentace funkcí
void cr_db_add_filelists_pkg |
( |
cr_DbFilelistsStatements |
stmts, |
|
|
cr_Package * |
pkg |
|
) |
| |
Add package into the database.
- Parametry:
-
stmts | object with compiled statements |
pkg | package object |
void cr_db_add_other_pkg |
( |
cr_DbOtherStatements |
stmts, |
|
|
cr_Package * |
pkg |
|
) |
| |
Add package into the database.
- Parametry:
-
stmts | object with compiled statements |
pkg | package object |
void cr_db_add_primary_pkg |
( |
cr_DbPrimaryStatements |
stmts, |
|
|
cr_Package * |
pkg |
|
) |
| |
Add package into the database.
- Parametry:
-
stmts | object with compiled statements |
pkg | package object |
Close db.
- creates indexes on tables
- commits transaction
- closes db
- Parametry:
-
db | open db connection |
db_type | Type of database (primary, filelists, other) |
err | **GError |
void cr_db_dbinfo_update |
( |
sqlite3 * |
db, |
|
|
const char * |
checksum, |
|
|
GError ** |
err |
|
) |
| |
Insert record into the updateinfo table
- Parametry:
-
db | open db connection |
checksum | compressed xml file checksum |
err | **GError |
void cr_db_destroy_filelists_statements |
( |
cr_DbFilelistsStatements |
stmts | ) |
|
Frees cr_DbFilelistsStatements object.
- Parametry:
-
void cr_db_destroy_other_statements |
( |
cr_DbOtherStatements |
stmts | ) |
|
Frees cr_DbOtherStatements object.
- Parametry:
-
void cr_db_destroy_primary_statements |
( |
cr_DbPrimaryStatements |
stmts | ) |
|
Frees cr_DbPrimaryStatements object.
- Parametry:
-
sqlite3* cr_db_open |
( |
const char * |
path, |
|
|
cr_DatabaseType |
db_type, |
|
|
GError ** |
err |
|
) |
| |
Open (create new) other sqlite sqlite db.
- creates db file
- opens transaction
- creates other tables
- creates info table
- tweak some db params
- Parametry:
-
path | Path to the db file. |
db_type | Type of database (primary, filelists, other) |
err | **GError |
- Návratová hodnota:
- open db connection
cr_DbFilelistsStatements cr_db_prepare_filelists_statements |
( |
sqlite3 * |
db, |
|
|
GError ** |
err |
|
) |
| |
Prepare compiled statements for use in the cr_db_add_filelists_pkg function.
- Parametry:
-
db | Open db connection |
err | **GError |
- Návratová hodnota:
- cr_DbFilelistsStatements object
cr_DbOtherStatements cr_db_prepare_other_statements |
( |
sqlite3 * |
db, |
|
|
GError ** |
err |
|
) |
| |
Prepare compiled statements for use in the cr_db_add_other_pkg function.
- Parametry:
-
db | Open db connection |
err | **GError |
- Návratová hodnota:
- cr_DbOtherStatements object
cr_DbPrimaryStatements cr_db_prepare_primary_statements |
( |
sqlite3 * |
db, |
|
|
GError ** |
err |
|
) |
| |
Prepare compiled statements for use in the cr_db_add_primary_pkg function.
- Parametry:
-
db | Open db connection |
err | **GError |
- Návratová hodnota:
- cr_DbPrimaryStatements object