File: Driver.h

package info (click to toggle)
storm-lang 0.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 52,004 kB
  • sloc: ansic: 261,462; cpp: 140,405; sh: 14,891; perl: 9,846; python: 2,525; lisp: 2,504; asm: 860; makefile: 678; pascal: 70; java: 52; xml: 37; awk: 12
file content (43 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

/**
 * Includes required to include the "mysql.h" file on the current system.
 *
 * On Linux, we typically use the header found in the system. On Windows, we use (and compile) a
 * copy of the library ourselves.
 */

#ifdef MARIADB_LOCAL_DRIVER
#include "Windows/mariadb/include/mysql.h"
#include "Windows/mariadb/include/mysqld_error.h"
#else

// This is available in C++17 and above:
#if __has_include(<mariadb/mysql.h>)
#include <mariadb/mysql.h>
#include <mariadb/mysqld_error.h>
#else
#include <mysql/mysql.h>
#include <mysql/mysqld_error.h>
#endif

#endif


namespace sql {

	/**
	 * Allow loading the mariadb/mysql driver dynamically when needed.
	 *
	 * This means that we only need the dynamic library to be present when we actually need it.
	 */

	// Create an instance of the MYSQL object. This can then be used to access the entire
	// MySQL/MariaDB API. Loads the mariadb library as needed.
	MYSQL *createMariaDBDriver(Engine &e);

	// Destroy an instance of a driver. This allows the implementation to reference count and
	// determine when/if to unload the mysql library.
	void destroyMariaDBDriver(MYSQL *driver);

}