blob: da3c0b55ca4b48007dc72d47b3db519610ac72f1 [file] [log] [blame]
Alison Craig2a4d5282015-04-10 12:00:02 -06001/** NDN-Atmos: Cataloging Service for distributed data originally developed
2 * for atmospheric science data
3 * Copyright (C) 2015 Colorado State University
4 *
5 * NDN-Atmos is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * NDN-Atmos is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NDN-Atmos. If not, see <http://www.gnu.org/licenses/>.
17**/
18
19#ifndef ATMOS_UTIL_CONNECTION_DETAILS_HPP
20#define ATMOS_UTIL_CONNECTION_DETAILS_HPP
21
22#include "mysql/mysql.h"
23
24#include <memory>
25#include <string>
26
27namespace atmos {
28namespace util {
29struct ConnectionDetails {
30public:
31 std::string server;
32 std::string user;
33 std::string password;
34 std::string database;
35
36 ConnectionDetails(const std::string& serverInput, const std::string& userInput,
37 const std::string& passwordInput, const std::string& databaseInput);
38};
39
40std::shared_ptr<MYSQL>
41MySQLConnectionSetup(ConnectionDetails& details);
42
43std::shared_ptr<MYSQL_RES>
44PerformQuery(std::shared_ptr<MYSQL> connection, const std::string& sql_query);
45
46} // namespace util
47} // namespace atmos
48#endif //ATMOS_UTIL_CONNECTION_DETAILS_HPP