Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
DatabaseSetupRuntime.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_DATABASE_SETUP_RUNTIME_H
7#define SKYFIRE_DATABASE_SETUP_RUNTIME_H
8
9#include "DatabaseSetup.h"
10
11#include <cstddef>
12#include <filesystem>
13#include <string>
14
15struct MYSQL;
16struct MySQLConnectionInfo;
17
18namespace Skyfire
19{
20namespace Database
21{
23 {
24 char const* LogFilter = "";
25 char const* ConfigPrefix = "";
26 char const* DatabaseName = "";
27 char const* DatabaseNameWithArticle = "";
28 char const* DatabaseNameTitle = "";
29 char const* SqlExecutionContext = "";
30 };
31
32 std::filesystem::path GetDatabaseBaseSqlPath(SetupOptions const& options);
33 std::filesystem::path GetDatabaseBaseSqlPath(SetupOptions const& options, std::string const& baseFileName);
34 bool ConnectToMySQLServer(MySQLConnectionInfo const& connectionInfo, char const* databaseName, MYSQL*& handle,
35 SetupRuntimeContext const& context);
36 bool EnsureDatabaseExists(MySQLConnectionInfo const& connectionInfo, SetupOptions const& options,
37 SetupRuntimeContext const& context);
38 bool LoadDatabaseSetupState(MYSQL* setupConnection, SetupOptions const& options, SetupState& state,
39 SetupRuntimeContext const& context);
40 bool ExecuteSqlFile(MYSQL* setupConnection, std::filesystem::path const& path, std::string& contents,
41 SetupRuntimeContext const& context);
42 void LogSetupPlan(SetupPlan const& plan, std::size_t discoveredUpdateCount, bool appliesRequiredSql,
43 SetupRuntimeContext const& context);
44 bool EnsureSetupTrackingTables(MYSQL* setupConnection, SetupRuntimeContext const& context);
45 bool BaselineSetupUpdates(MYSQL* setupConnection, SetupOptions const& options, SetupPlan const& plan,
46 SetupRuntimeContext const& context);
47 bool ApplyPendingSetupUpdates(MYSQL* setupConnection, SetupOptions const& options, SetupPlan const& plan,
48 SetupRuntimeContext const& context);
49}
50}
51
52#endif
bool EnsureDatabaseExists(MySQLConnectionInfo const &connectionInfo, SetupOptions const &options, SetupRuntimeContext const &context)
bool LoadDatabaseSetupState(MYSQL *setupConnection, SetupOptions const &options, SetupState &state, SetupRuntimeContext const &context)
bool ConnectToMySQLServer(MySQLConnectionInfo const &connectionInfo, char const *databaseName, MYSQL *&handle, SetupRuntimeContext const &context)
bool ExecuteSqlFile(MYSQL *setupConnection, std::filesystem::path const &path, std::string &contents, SetupRuntimeContext const &context)
bool BaselineSetupUpdates(MYSQL *setupConnection, SetupOptions const &options, SetupPlan const &plan, SetupRuntimeContext const &context)
std::filesystem::path GetDatabaseBaseSqlPath(SetupOptions const &options)
void LogSetupPlan(SetupPlan const &plan, std::size_t discoveredUpdateCount, bool appliesRequiredSql, SetupRuntimeContext const &context)
bool EnsureSetupTrackingTables(MYSQL *setupConnection, SetupRuntimeContext const &context)
bool ApplyPendingSetupUpdates(MYSQL *setupConnection, SetupOptions const &options, SetupPlan const &plan, SetupRuntimeContext const &context)