Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
common/database.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2011-2020 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <glib.h>
22#include <sqlite3.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28struct dt_database_t;
29
31struct dt_database_t *dt_database_init(const char *alternative, const gboolean load_data, const gboolean has_gui);
35sqlite3 *dt_database_get(const struct dt_database_t *);
37const gchar *dt_database_get_path(const struct dt_database_t *db);
43void dt_database_optimize(const struct dt_database_t *);
45gboolean dt_database_maybe_maintenance(const struct dt_database_t *db, const gboolean has_gui, const gboolean closing_time);
50gboolean dt_database_snapshot(const struct dt_database_t *db);
52gboolean dt_database_maybe_snapshot(const struct dt_database_t *db);
54char **dt_database_snaps_to_remove(const struct dt_database_t *db);
56gchar *dt_database_get_most_recent_snap(const char* db_filename);
57
58
59// nested transactions support
63
64#define dt_database_start_transaction(db) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_SQL, dt_database_start_transaction_debug, (db))
65#define dt_database_release_transaction(db) DT_DEBUG_TRACE_WRAPPER(DT_DEBUG_SQL, dt_database_release_transaction_debug, (db))
66
67#ifdef __cplusplus
68}
69#endif
70
71// clang-format off
72// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
73// vim: shiftwidth=2 expandtab tabstop=2 cindent
74// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
75// clang-format on
struct dt_database_t * dt_database_init(const char *alternative, const gboolean load_data, const gboolean has_gui)
Definition common/database.c:3039
gchar * dt_database_get_most_recent_snap(const char *db_filename)
Definition common/database.c:4546
void dt_database_cleanup_busy_statements(const struct dt_database_t *db)
Definition common/database.c:3740
sqlite3 * dt_database_get(const struct dt_database_t *)
gboolean dt_database_snapshot(const struct dt_database_t *db)
Definition common/database.c:4003
void dt_database_perform_maintenance(const struct dt_database_t *db)
Definition common/database.c:3759
void dt_database_start_transaction_debug(const struct dt_database_t *db)
Definition common/database.c:4652
void dt_database_optimize(const struct dt_database_t *)
Definition common/database.c:3937
char ** dt_database_snaps_to_remove(const struct dt_database_t *db)
Definition common/database.c:4261
gboolean dt_database_maybe_maintenance(const struct dt_database_t *db, const gboolean has_gui, const gboolean closing_time)
Definition common/database.c:3860
void dt_database_destroy(const struct dt_database_t *)
void dt_database_show_error(const struct dt_database_t *db)
gboolean dt_database_get_lock_acquired(const struct dt_database_t *db)
void dt_database_release_transaction_debug(const struct dt_database_t *db)
Definition common/database.c:4680
const gchar * dt_database_get_path(const struct dt_database_t *db)
Definition common/database.c:3680
void dt_database_rollback_transaction(const struct dt_database_t *db)
Definition common/database.c:4701
gboolean dt_database_maybe_snapshot(const struct dt_database_t *db)
Definition common/database.c:4053
Definition common/database.c:60