JULEA
Loading...
Searching...
No Matches
jdb-schema.h
Go to the documentation of this file.
1/*
2 * JULEA - Flexible storage framework
3 * Copyright (C) 2019 Benjamin Warnke
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser 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 * This program 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 Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
23#ifndef JULEA_DB_SCHEMA_H
24#define JULEA_DB_SCHEMA_H
25
26#if !defined(JULEA_DB_H) && !defined(JULEA_DB_COMPILATION)
27#error "Only <julea-db.h> can be included directly."
28#endif
29
30#include <glib.h>
31
32#include <julea.h>
33
34G_BEGIN_DECLS
35
36struct JDBSchemaIndex;
37
39
40struct JDBSchema;
41
42typedef struct JDBSchema JDBSchema;
43
44G_END_DECLS
45
46#include <db/jdb-type.h>
47
48G_BEGIN_DECLS
49
62JDBSchema* j_db_schema_new(gchar const* namespace_, gchar const* name, GError** error);
63
73
79void j_db_schema_unref(JDBSchema* schema);
80
81G_DEFINE_AUTOPTR_CLEANUP_FUNC(JDBSchema, j_db_schema_unref)
82
83
97gboolean j_db_schema_add_field(JDBSchema* schema, gchar const* name, JDBType type, GError** error);
98
114gboolean j_db_schema_get_field(JDBSchema* schema, gchar const* name, JDBType* type, GError** error);
115
134guint32 j_db_schema_get_all_fields(JDBSchema* schema, gchar*** names, JDBType** types, GError** error);
135
151gboolean j_db_schema_add_index(JDBSchema* schema, gchar const** names, GError** error);
152
166gboolean j_db_schema_create(JDBSchema* schema, JBatch* batch, GError** error);
167
181gboolean j_db_schema_get(JDBSchema* schema, JBatch* batch, GError** error);
182
196gboolean j_db_schema_delete(JDBSchema* schema, JBatch* batch, GError** error);
197
212gboolean j_db_schema_equals(JDBSchema* schema1, JDBSchema* schema2, gboolean* equal, GError** error);
213
214G_END_DECLS
215
216#endif
gboolean j_db_schema_create(JDBSchema *schema, JBatch *batch, GError **error)
Definition jdb-schema.c:402
gboolean j_db_schema_add_index(JDBSchema *schema, gchar const **names, GError **error)
Definition jdb-schema.c:274
JDBSchema * j_db_schema_ref(JDBSchema *schema)
Definition jdb-schema.c:64
G_END_DECLS G_BEGIN_DECLS JDBSchema * j_db_schema_new(gchar const *namespace_, gchar const *name, GError **error)
Definition jdb-schema.c:36
gboolean j_db_schema_add_field(JDBSchema *schema, gchar const *name, JDBType type, GError **error)
Definition jdb-schema.c:114
guint32 j_db_schema_get_all_fields(JDBSchema *schema, gchar ***names, JDBType **types, GError **error)
Definition jdb-schema.c:199
gboolean j_db_schema_get(JDBSchema *schema, JBatch *batch, GError **error)
Definition jdb-schema.c:434
gboolean j_db_schema_equals(JDBSchema *schema1, JDBSchema *schema2, gboolean *equal, GError **error)
Definition jdb-schema.c:479
gboolean j_db_schema_delete(JDBSchema *schema, JBatch *batch, GError **error)
Definition jdb-schema.c:459
void j_db_schema_unref(JDBSchema *schema)
Definition jdb-schema.c:76
gboolean j_db_schema_get_field(JDBSchema *schema, gchar const *name, JDBType *type, GError **error)
Definition jdb-schema.c:161
JDBType
Definition jdb-type.h:35
Definition jbatch.c:49
Definition jdb-internal.h:71
Definition jdb-internal.h:78
gchar * name
Definition jdb-internal.h:85