Loading...
Searching...
No Matches
Initialize and cosing connection functions

## Functions

int | h_close_db (struct _h_connection *conn)
int | h_clean_connection (struct _h_connection *conn)
struct _h_connection * | h_connect_sqlite (const char *db_path)
void | h_close_sqlite (struct _h_connection *conn)
struct _h_connection * | h_connect_mariadb (const char *host, const char *user, const char *passwd, const char *db, const unsigned int port, const char *unix_socket)
void | h_close_mariadb (struct _h_connection *conn)
struct _h_connection * | h_connect_pgsql (const char *conninfo)
void | h_close_pgsql (struct _h_connection *conn)

## Detailed Description

## Function Documentation

## h_clean_connection()

int h_clean_connection | ( | struct _h_connection * | conn | ) |

h_clean_connection free memory allocated by the struct _h_connection

Parameters

  conn | the connection to the database

Returns
  H_OK on success

h_clean_connection free memory allocated by the struct _h_connection return H_OK on success

## h_close_db()

int h_close_db | ( | struct _h_connection * | conn | ) |

Close a database connection

Parameters

  conn | the connection to the database

Returns
  H_OK on success

Close a database connection return H_OK on success

## h_close_mariadb()

void h_close_mariadb | ( | struct _h_connection * | conn | ) |

close connection to database

## h_close_pgsql()

void h_close_pgsql | ( | struct _h_connection * | conn | ) |

close a pgsql connection

Parameters

  conn | the connection to the database

## h_close_sqlite()

void h_close_sqlite | ( | struct _h_connection * | conn | ) |

close a sqlite3 connection

Parameters

  conn | the connection to the database

## h_connect_mariadb()

struct _h_connection * h_connect_mariadb | ( | const char * | host,
|  | const char * | user,
|  | const char * | passwd,
|  | const char * | db,
|  | const unsigned int | port,
|  | const char * | unix_socket
| ) |  |

h_connect_mariadb Opens a database connection to a mariadb server

Parameters

  host | the hostname of the database server
  user | the username to connect to the database
  passwd | the password to connect to the database
  db | the database name
  port | the TCP port number for the database connection, 0 means system default
  unix_socket | a UNIX socket to use for the connection, optional

Returns
  pointer to a struct _h_connection * on success, NULL on error

Hoel database abstraction library

hoel-mariadb.c: Maria DB/Mysql specific functions

Copyright 2015-2020 Nicolas Mora mail@.nosp@m.babe.nosp@m.loues.nosp@m.t.or.nosp@m.g

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/. Dummy functions when Hoel is not built with MariaDB

## h_connect_pgsql()

struct _h_connection * h_connect_pgsql | ( | const char * | conninfo | ) |

h_connect_pgsql Opens a database connection to a PostgreSQL server

Parameters

  conninfo | the connection info to connect to the pgsql database

Returns
  pointer to a struct _h_connection * on sucess, NULL on error

Hoel database abstraction library

hoel-pgsql.c: Postgre SQL specific functions

Copyright 2015-2020 Nicolas Mora mail@.nosp@m.babe.nosp@m.loues.nosp@m.t.or.nosp@m.g

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/. Dummy functions when Hoel is not built with PostgreSQL

## h_connect_sqlite()

struct _h_connection * h_connect_sqlite | ( | const char * | db_path | ) |

h_connect_sqlite Opens a database connection to a sqlite3 db file

Parameters

  db_path | the path to the sqlite db file

Returns
  pointer to a struct _h_connection * on sucess, NULL on error

Hoel database abstraction library

hoel-sqlite.c: Sqlite3 specific functions

Copyright 2015-2020 Nicolas Mora mail@.nosp@m.babe.nosp@m.loues.nosp@m.t.or.nosp@m.g

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/. Dummy functions when Hoel is not built with SQLite