38#ifndef __STUMPLESS_TARGET_SQLITE3_H
39#define __STUMPLESS_TARGET_SQLITE3_H
43#include <stumpless/config.h>
52#define STUMPLESS_DEFAULT_SQLITE3_INSERT_SQL \
53"INSERT INTO " STUMPLESS_DEFAULT_SQLITE3_TABLE_NAME_STRING " " \
54"( prival, version, timestamp, hostname, app_name, procid, msgid," \
55" structured_data, message ) " \
56"VALUES ( $prival, 1, $timestamp, $hostname, $app_name, $procid, $msgid, " \
57 "$structured_data, $message )"
72( *stumpless_sqlite3_prepare_func_t )(
const struct stumpless_entry *entry,
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
Definition config.h:31
Types and functions for creating and modifying entries.
void *(* stumpless_sqlite3_prepare_func_t)(const struct stumpless_entry *entry, void *data, size_t *count)
A function for generating SQLite3 prepared statements for a given entry.
Definition sqlite3.h:72
STUMPLESS_PUBLIC_FUNCTION const char * stumpless_get_sqlite3_insert_sql(const struct stumpless_target *target)
Gets the SQL statement used to insert entries into the database.
STUMPLESS_PUBLIC_FUNCTION void stumpless_close_sqlite3_target_only(const struct stumpless_target *target)
Closes a SQLite3 target, but does not touch the database handle.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_open_sqlite3_target_with_options(const char *name, int flags, const char *vfs)
Opens a SQLite3 target with the provided options.
STUMPLESS_PUBLIC_FUNCTION bool stumpless_close_sqlite3_target_and_db(const struct stumpless_target *target)
Closes a SQLite3 target and its database handle.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_set_sqlite3_insert_sql(struct stumpless_target *target, const char *sql)
Sets the SQL statement used to insert entries into the database.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_open_sqlite3_target_from_db(void *db)
Opens a SQLite3 target with an already-open database handle.
STUMPLESS_PUBLIC_FUNCTION void * stumpless_sqlite3_prepare(const struct stumpless_entry *entry, void *data, size_t *count)
The default prepare function used for SQLite3 targets.
STUMPLESS_PUBLIC_FUNCTION stumpless_sqlite3_prepare_func_t stumpless_get_sqlite3_prepare(const struct stumpless_target *target, void **data)
Gets the preparation function and data pointer used to prepare statements for insertion into the data...
STUMPLESS_PUBLIC_FUNCTION void * stumpless_get_sqlite3_db(const struct stumpless_target *target)
Gets the SQLite3 database handle used by the target.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_create_default_sqlite3_table(struct stumpless_target *target)
Creates a table in the target's database for use with the default SQLite3 insertion behavior.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_set_sqlite3_prepare(struct stumpless_target *target, stumpless_sqlite3_prepare_func_t preparer, void *data)
Set the function used to prepare statements for entries to this target.
STUMPLESS_PUBLIC_FUNCTION struct stumpless_target * stumpless_open_sqlite3_target(const char *name)
Opens a SQLite3 target.
A log entry.
Definition entry.h:60
A target that log entries can be sent to.
Definition target.h:140
char * name
The name of this target.
Definition target.h:157
General types and functions for working with all targets.