-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.h
30 lines (18 loc) · 949 Bytes
/
database.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2022 Perets Dmytro
// Author: Perets Dmytro <[email protected]>
//
// Personal usage is allowed only if this comment was not changed or deleted.
// Commercial usage must be agreed with the author of this comment.
#ifndef FILESTORAGE_DATABASE_H
#define FILESTORAGE_DATABASE_H
#include <mariadb/conncpp.hpp>
#include "constants.hpp"
#include "mongoose.h"
void mariadb_create_db(const char* db_user_password);
void mariadb_drop_db(const char* db_user_password);
std::unique_ptr<sql::Connection> mariadb_connect_to_db(const char* db_user_password);
void mariadb_create_table(sql::Connection* connection);
int mariadb_user_insert(sql::Connection* connection, const char* login, const char* password);
void mariadb_user_update(sql::Connection* connection, const char* login, const char* password);
const char* mariadb_user_get_password(sql::Connection* connection, const char* login);
#endif //FILESTORAGE_DATABASE_H