SQLite driver. More...
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sqlite3.h>
#include "rlm_sql.h"
#include "config.h"
Go to the source code of this file.
Data Structures | |
struct | rlm_sql_sqlite_config |
struct | rlm_sql_sqlite_conn |
Macros | |
#define | BOOTSTRAP_MAX (1048576 * 10) |
#define | SQLITE_OPEN_NOMUTEX 0 |
Typedefs | |
typedef struct rlm_sql_sqlite_config | rlm_sql_sqlite_config_t |
typedef typedef sqlite3_int64 sqlite_int64 struct rlm_sql_sqlite_conn | rlm_sql_sqlite_conn_t |
Functions | |
static void | _sql_greatest (sqlite3_context *ctx, int num_values, sqlite3_value **values) |
static int | _sql_socket_destructor (rlm_sql_sqlite_conn_t *conn) |
static void | CC_HINT (nonnull(3)) |
static int | CC_HINT (nonnull) |
static int | mod_instantiate (CONF_SECTION *conf, rlm_sql_config_t *config) |
static int | sql_affected_rows (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config) |
static sql_rcode_t | sql_check_error (sqlite3 *db, int status) |
Determine if an error occurred, and what type of error it was. More... | |
static size_t | sql_error (UNUSED TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config) |
Retrieves any errors associated with the connection handle. More... | |
static sql_rcode_t | sql_error_to_rcode (int status) |
Convert an sqlite status code to an sql_rcode_t. More... | |
static sql_rcode_t | sql_fetch_row (rlm_sql_row_t *out, rlm_sql_handle_t *handle, rlm_sql_config_t *config) |
static sql_rcode_t | sql_fields (char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config) |
static sql_rcode_t | sql_finish_query (rlm_sql_handle_t *handle, rlm_sql_config_t *config) |
static sql_rcode_t | sql_free_result (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config) |
static int | sql_num_fields (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config) |
static void | sql_print_error (sqlite3 *db, int status, char const *fmt,...) CC_HINT(format(printf |
Print an error to the global debug log. More... | |
static sql_rcode_t | sql_query (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config, char const *query) |
static sql_rcode_t | sql_select_query (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config, char const *query) |
Variables | |
static const CONF_PARSER | driver_config [] |
rlm_sql_module_t | rlm_sql_sqlite |
SQLite driver.
Definition in file rlm_sql_sqlite.c.
struct rlm_sql_sqlite_config |
Definition at line 57 of file rlm_sql_sqlite.c.
Data Fields | ||
---|---|---|
uint32_t | busy_timeout | |
char const * | filename |
struct rlm_sql_sqlite_conn |
Definition at line 51 of file rlm_sql_sqlite.c.
Data Fields | ||
---|---|---|
int | col_count | |
sqlite3 * | db | |
sqlite3_stmt * | statement |
#define BOOTSTRAP_MAX (1048576 * 10) |
Definition at line 38 of file rlm_sql_sqlite.c.
#define SQLITE_OPEN_NOMUTEX 0 |
Definition at line 44 of file rlm_sql_sqlite.c.
typedef struct rlm_sql_sqlite_config rlm_sql_sqlite_config_t |
typedef typedef sqlite3_int64 sqlite_int64 struct rlm_sql_sqlite_conn rlm_sql_sqlite_conn_t |
|
static |
|
static |
static void CC_HINT | ( | nonnull(3) | ) |
|
static |
|
static |
|
static |
Definition at line 785 of file rlm_sql_sqlite.c.
|
static |
Determine if an error occurred, and what type of error it was.
db | handle to extract error from (may be NULL). |
status | to check (if unused, set to SQLITE_OK). |
Definition at line 123 of file rlm_sql_sqlite.c.
|
static |
Retrieves any errors associated with the connection handle.
ctx | to allocate temporary error buffers in. |
out | Array of sql_log_entrys to fill. |
outlen | Length of out array. |
handle | rlm_sql connection handle. |
config | rlm_sql config. |
Definition at line 763 of file rlm_sql_sqlite.c.
|
static |
Convert an sqlite status code to an sql_rcode_t.
status | to convert. |
Definition at line 77 of file rlm_sql_sqlite.c.
|
static |
|
static |
Definition at line 627 of file rlm_sql_sqlite.c.
|
static |
|
static |
|
static |
|
static |
Print an error to the global debug log.
If status does not indicate success, write an error to the global error log.
db | handle to extract error from (may be NULL). |
status | to check (if unused, set to SQLITE_OK). |
fmt | to preprend. |
... | arguments to fmt. |
Definition at line 171 of file rlm_sql_sqlite.c.
|
static |
|
static |
|
static |
Definition at line 62 of file rlm_sql_sqlite.c.
rlm_sql_module_t rlm_sql_sqlite |
Definition at line 800 of file rlm_sql_sqlite.c.