db_connection.h
Go to the documentation of this file.
/*
* Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
* Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
* Copyright (c) 2014 OpenDNSSEC AB (svb)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __db_connection_h
#define __db_connection_h
struct db_connection;
typedef struct db_connection db_connection_t;
#include "db_configuration.h"
#include "db_backend.h"
#include "db_result.h"
#include "db_object.h"
#include "db_join.h"
#include "db_clause.h"
struct db_connection {
const db_configuration_list_t* configuration_list;
db_backend_t* backend;
};
extern db_connection_t* db_connection_new(void);
extern void db_connection_free(db_connection_t* connection);
extern int db_connection_set_configuration_list(db_connection_t* connection, const db_configuration_list_t* configuration_list);
extern int db_connection_setup(db_connection_t* connection);
extern int db_connection_connect(const db_connection_t* connection);
extern int db_connection_create(const db_connection_t* connection, const db_object_t* object, const db_object_field_list_t* object_field_list, const db_value_set_t* value_set);
extern db_result_list_t* db_connection_read(const db_connection_t* connection, const db_object_t* object, const db_join_list_t* join_list, const db_clause_list_t* clause_list);
extern int db_connection_update(const db_connection_t* connection, const db_object_t* object, const db_object_field_list_t* object_field_list, const db_value_set_t* value_set, const db_clause_list_t* clause_list);
extern int db_connection_delete(const db_connection_t* connection, const db_object_t* object, const db_clause_list_t* clause_list);
extern int db_connection_count(const db_connection_t* connection, const db_object_t* object, const db_join_list_t* join_list, const db_clause_list_t* clause_list, size_t* count);
#endif
db_backend.h
db_clause.h
db_configuration.h
db_connection_create
int db_connection_create(const db_connection_t *connection, const db_object_t *object, const db_object_field_list_t *object_field_list, const db_value_set_t *value_set)
Definition db_connection.c:102
db_connection_connect
int db_connection_connect(const db_connection_t *connection)
Definition db_connection.c:88
db_connection_new
db_connection_t * db_connection_new(void)
Definition db_connection.c:38
db_connection_setup
int db_connection_setup(db_connection_t *connection)
Definition db_connection.c:66
db_connection_delete
int db_connection_delete(const db_connection_t *connection, const db_object_t *object, const db_clause_list_t *clause_list)
Definition db_connection.c:156
db_connection_free
void db_connection_free(db_connection_t *connection)
Definition db_connection.c:45
db_connection_set_configuration_list
int db_connection_set_configuration_list(db_connection_t *connection, const db_configuration_list_t *configuration_list)
Definition db_connection.c:54
db_connection_read
db_result_list_t * db_connection_read(const db_connection_t *connection, const db_object_t *object, const db_join_list_t *join_list, const db_clause_list_t *clause_list)
Definition db_connection.c:122
db_connection_update
int db_connection_update(const db_connection_t *connection, const db_object_t *object, const db_object_field_list_t *object_field_list, const db_value_set_t *value_set, const db_clause_list_t *clause_list)
Definition db_connection.c:136
db_connection_count
int db_connection_count(const db_connection_t *connection, const db_object_t *object, const db_join_list_t *join_list, const db_clause_list_t *clause_list, size_t *count)
Definition db_connection.c:170
db_join.h
db_object.h
db_result.h
db_backend
Definition db_backend.h:384
db_clause_list
Definition db_clause.h:226
db_configuration_list
Definition db_configuration.h:93
db_connection
Definition db_connection.h:46
db_connection::configuration_list
const db_configuration_list_t * configuration_list
Definition db_connection.h:47
db_connection::backend
db_backend_t * backend
Definition db_connection.h:48
db_join_list
Definition db_join.h:94
db_object_field_list
Definition db_object.h:142
db_object
Definition db_object.h:201
db_result_list
Definition db_result.h:114
db_value_set
Definition db_value.h:281