Groonga
Loading...
Searching...
No Matches
db.h
Go to the documentation of this file.
1/*
2 Copyright(C) 2009-2018 Brazil
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17*/
18
19#pragma once
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
26
31
43grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg);
44
45#define GRN_DB_OPEN_OR_CREATE(ctx, path, optarg, db) \
46 (((db) = grn_db_open((ctx), (path))) || \
47 (db = grn_db_create((ctx), (path), (optarg))))
48
58grn_db_open(grn_ctx *ctx, const char *path);
67GRN_API void
124GRN_API uint32_t
126GRN_API bool
132
133#define GRN_DB_EACH_BEGIN_FLAGS(ctx, cursor, id, flags) \
134 GRN_TABLE_EACH_BEGIN_FLAGS(ctx, grn_ctx_db((ctx)), cursor, id, flags)
135
136#define GRN_DB_EACH_BEGIN_BY_ID(ctx, cursor, id) \
137 GRN_DB_EACH_BEGIN_FLAGS(ctx, \
138 cursor, \
139 id, \
140 GRN_CURSOR_BY_ID | GRN_CURSOR_ASCENDING)
141
142#define GRN_DB_EACH_BEGIN_BY_KEY(ctx, cursor, id) \
143 GRN_DB_EACH_BEGIN_FLAGS(ctx, \
144 cursor, \
145 id, \
146 GRN_CURSOR_BY_KEY | GRN_CURSOR_ASCENDING)
147
148#define GRN_DB_EACH_END(ctx, cursor) GRN_TABLE_EACH_END(ctx, cursor)
149
150#ifdef __cplusplus
151}
152#endif
struct _grn_cache grn_cache
Cache object.
Definition cache.h:32
GRN_API grn_rc grn_db_unmap(grn_ctx *ctx, grn_obj *db)
Unmaps all opened tables and columns in the passed database. Resources used by these opened tables an...
GRN_API grn_obj * grn_db_open(grn_ctx *ctx, const char *path)
Open the database.
GRN_API bool grn_db_is_dirty(grn_ctx *ctx, grn_obj *db)
GRN_API grn_rc grn_db_set_cache(grn_ctx *ctx, grn_obj *db, grn_cache *cache)
GRN_API void grn_db_touch(grn_ctx *ctx, grn_obj *db)
Update the last modified time of db to the current time. The last modified time is used,...
GRN_API grn_cache * grn_db_get_cache(grn_ctx *ctx, grn_obj *db)
GRN_API uint32_t grn_db_get_last_modified(grn_ctx *ctx, grn_obj *db)
GRN_API grn_rc grn_db_recover(grn_ctx *ctx, grn_obj *db)
Check the passed database and recover it if it is broken and it can be recovered.
GRN_API grn_obj * grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg)
Create new database.
grn_rc
Definition groonga.h:61
#define GRN_API
Definition groonga.h:39
Definition groonga.h:351
Definition db.h:27
char ** builtin_type_names
Definition db.h:28
int n_builtin_type_names
Definition db.h:29
Definition groonga.h:919