Mercurial > malikania
comparison database/postgresql/src/driver.hpp @ 33:d4f5f7231b84
Misc: switch to .hpp, dos2unix everything while here, #478
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 17 Jun 2016 13:12:35 +0200 |
parents | database/postgresql/src/driver.h@99792c6c8b06 |
children |
comparison
equal
deleted
inserted
replaced
32:81292e0651d2 | 33:d4f5f7231b84 |
---|---|
1 /* | |
2 * driver.hpp -- PostgreSQL database driver | |
3 * | |
4 * Copyright (c) 2013-2016 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef MALIKANIA_POSTGRESQL_DRIVER_HPPPP | |
20 #define MALIKANIA_POSTGRESQL_DRIVER_HPPPP | |
21 | |
22 #include <memory> | |
23 #include <string> | |
24 | |
25 #include <libpq-fe.h> | |
26 | |
27 namespace pgsql { | |
28 | |
29 extern PGconn *connection; | |
30 | |
31 std::shared_ptr<PGresult> exec(const std::string &sql); | |
32 | |
33 std::string escape(const std::string &input); | |
34 | |
35 } // !pgsql | |
36 | |
37 #endif // !MALIKANIA_POSTGRESQL_DRIVER_HPPPP |