Module for writing sqlite metadata databases.
Example:
#define CR_DB_CACHE_DBVERSION 10 |
Version of DB api
Definition at line 59 of file 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
- Parameters
-
PATH | Path to the db file. |
ERR | **GError |
- Returns
- Opened db or NULL on error
Definition at line 116 of file 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
- Parameters
-
PATH | Path to the db file. |
ERR | **GError |
- Returns
- Opened db or NULL on error
Definition at line 128 of file 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
- Parameters
-
PATH | Path to the db file. |
ERR | **GError |
- Returns
- Opened db or NULL on error
Definition at line 105 of file sqlite.h.
Compiled filelists database statements
Definition at line 72 of file sqlite.h.
Compiled other database statements
Definition at line 74 of file sqlite.h.
Compiled primary database statements
Definition at line 70 of file sqlite.h.
Database type.
Enumerator |
---|
CR_DB_PRIMARY |
primary
|
CR_DB_FILELISTS |
filelists
|
CR_DB_OTHER |
other
|
CR_DB_SENTINEL |
sentinel of the list
|
Definition at line 63 of file sqlite.h.
Add package into the database.
- Parameters
-
sqlitedb | open db connection |
pkg | package object |
err | **GError |
- Returns
- cr_Error code
int cr_db_close |
( |
cr_SqliteDb * |
sqlitedb, |
|
|
GError ** |
err |
|
) |
| |
Close db.
- creates indexes on tables
- commits transaction
- closes db
- Parameters
-
sqlitedb | open db connection |
err | **GError |
- Returns
- cr_Error code
int cr_db_dbinfo_update |
( |
cr_SqliteDb * |
sqlitedb, |
|
|
const char * |
checksum, |
|
|
GError ** |
err |
|
) |
| |
Insert record into the updateinfo table
- Parameters
-
sqlitedb | open db connection |
checksum | compressed xml file checksum |
err | **GError |
- Returns
- cr_Error code
Open (create new) other sqlite sqlite db.
- creates db file
- opens transaction
- creates other tables
- creates info table
- tweak some db params
- Parameters
-
path | Path to the db file. |
db_type | Type of database (primary, filelists, other) |
err | **GError |
- Returns
- Opened db or NULL on error