DuroDBMS API  1.7
Functions
Database environment functions

Functions

RDB_environment * RDB_open_env (const char *path, int flags, RDB_exec_context *ecp)
 
RDB_environment * RDB_create_env (const char *path, RDB_exec_context *ecp)
 
int RDB_close_env (RDB_environment *envp, RDB_exec_context *ecp)
 
void RDB_env_set_trace (RDB_environment *envp, unsigned level)
 
void RDB_env_set_errfile (RDB_environment *envp, FILE *file)
 
FILE * RDB_env_get_errfile (const RDB_environment *envp)
 

Detailed Description

#include <rec/env.h>

Function Documentation

◆ RDB_close_env()

int RDB_close_env ( RDB_environment *  envp,
RDB_exec_context *  ecp 
)

RDB_close_env closes the database environment specified by envp.

Parameters
envpthe pointer to the environment.
Returns
RDB_OK on success, RDB_ERROR if an error occurred.
Errors:
See the documentation of the Berkeley function DB_ENV->close for details.

Referenced by Duro_destroy_interp().

◆ RDB_create_env()

RDB_environment* RDB_create_env ( const char *  path,
RDB_exec_context *  ecp 
)

Creates a database environment identified by the system resource path.

Parameters
pathpathname of the direcory where the data is stored.
envpplocation where the pointer to the environment is stored.
Returns
On success, a pointer to the environment is returned. On failure, NULL is returned and an error value is stored in *ecp.

◆ RDB_env_get_errfile()

FILE* RDB_env_get_errfile ( const RDB_environment *  envp)

Get error output stream.

References RDB_raise_no_memory().

◆ RDB_env_set_errfile()

void RDB_env_set_errfile ( RDB_environment *  envp,
FILE *  file 
)

Set error output stream.

◆ RDB_env_set_trace()

void RDB_env_set_trace ( RDB_environment *  envp,
unsigned  level 
)

Set trace level. Zero means no trace messages.

Parameters
envpthe pointer to the environment.
levelthe new trace level.

◆ RDB_open_env()

RDB_environment* RDB_open_env ( const char *  path,
int  flags,
RDB_exec_context *  ecp 
)

RDB_open_env opens a database environment identified by the system resource path.

In the current implementation, the path passed to RDB_open_env is a Berkeley DB database environment directory. To create a new empty environment, simply pass an empty directory to RDB_open_env. If DuroDBMS has been built with PostgreSQL support, path can be a PostgreSQL URI. If DuroDBMS has been built with FoundationDB support, path can be a URI of the form foundationdb://<file> where file is a cluster file path.

Parameters
pathpathname of the direcory where the data is stored.
flagscan be zero or RDB_RECOVER. If it is RDB_RECOVER, all necessary files will be created.
Returns
On success, a pointer to the environment is returned. On failure, NULL is returned and an error value is stored in *ecp.