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))))
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)
136#define GRN_DB_EACH_BEGIN_BY_ID(ctx, cursor, id) \
137 GRN_DB_EACH_BEGIN_FLAGS(ctx, \
140 GRN_CURSOR_BY_ID | GRN_CURSOR_ASCENDING)
142#define GRN_DB_EACH_BEGIN_BY_KEY(ctx, cursor, id) \
143 GRN_DB_EACH_BEGIN_FLAGS(ctx, \
146 GRN_CURSOR_BY_KEY | GRN_CURSOR_ASCENDING)
148#define GRN_DB_EACH_END(ctx, cursor) GRN_TABLE_EACH_END(ctx, cursor)
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
char ** builtin_type_names
Definition db.h:28
int n_builtin_type_names
Definition db.h:29