Mercurial > malikania
view database/postgresql/src/driver.hpp @ 116:d7025649d85c
Server: add database account
Implement accounts using a abstract factory mechanism, the database object
creates abstract account which are implemented differently depending on the
backend.
See:
- test_database,
- test_account
- broken_account
Refs #687, #682
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 11 Sep 2017 13:18:43 +0200 |
parents | d4f5f7231b84 |
children |
line wrap: on
line source
/* * driver.hpp -- PostgreSQL database driver * * Copyright (c) 2013-2016 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef MALIKANIA_POSTGRESQL_DRIVER_HPPPP #define MALIKANIA_POSTGRESQL_DRIVER_HPPPP #include <memory> #include <string> #include <libpq-fe.h> namespace pgsql { extern PGconn *connection; std::shared_ptr<PGresult> exec(const std::string &sql); std::string escape(const std::string &input); } // !pgsql #endif // !MALIKANIA_POSTGRESQL_DRIVER_HPPPP