File: db.h

package info (click to toggle)
seafile 6.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,468 kB
  • sloc: ansic: 34,270; python: 5,192; makefile: 249; sh: 239
file content (33 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

#ifndef DB_UTILS_H
#define DB_UTILS_H

#include <sqlite3.h>

int sqlite_open_db (const char *db_path, sqlite3 **db);

int sqlite_close_db (sqlite3 *db);

sqlite3_stmt *sqlite_query_prepare (sqlite3 *db, const char *sql);

int sqlite_query_exec (sqlite3 *db, const char *sql);
int sqlite_begin_transaction (sqlite3 *db);
int sqlite_end_transaction (sqlite3 *db);

gboolean sqlite_check_for_existence (sqlite3 *db, const char *sql);

typedef gboolean (*SqliteRowFunc) (sqlite3_stmt *stmt, void *data);

int
sqlite_foreach_selected_row (sqlite3 *db, const char *sql, 
                             SqliteRowFunc callback, void *data);

int sqlite_get_int (sqlite3 *db, const char *sql);

gint64 sqlite_get_int64 (sqlite3 *db, const char *sql);

char *sqlite_get_string (sqlite3 *db, const char *sql);


#endif