|
10 | 10 | */
|
11 | 11 | #pragma once
|
12 | 12 |
|
| 13 | +#include <SQLiteCpp/SQLiteCppExport.h> |
13 | 14 | #include <SQLiteCpp/Column.h>
|
14 | 15 |
|
15 | 16 | // c++17: MinGW GCC version > 8
|
@@ -84,37 +85,37 @@ namespace SQLite
|
84 | 85 | // Those public constants enable most usages of SQLiteCpp without including <sqlite3.h> in the client application.
|
85 | 86 |
|
86 | 87 | /// The database is opened in read-only mode. If the database does not already exist, an error is returned.
|
87 |
| -extern const int OPEN_READONLY; // SQLITE_OPEN_READONLY |
| 88 | +SQLITECPP_API extern const int OPEN_READONLY; // SQLITE_OPEN_READONLY |
88 | 89 | /// The database is opened for reading and writing if possible, or reading only if the file is write protected
|
89 | 90 | /// by the operating system. In either case the database must already exist, otherwise an error is returned.
|
90 |
| -extern const int OPEN_READWRITE; // SQLITE_OPEN_READWRITE |
| 91 | +SQLITECPP_API extern const int OPEN_READWRITE; // SQLITE_OPEN_READWRITE |
91 | 92 | /// With OPEN_READWRITE: The database is opened for reading and writing, and is created if it does not already exist.
|
92 |
| -extern const int OPEN_CREATE; // SQLITE_OPEN_CREATE |
| 93 | +SQLITECPP_API extern const int OPEN_CREATE; // SQLITE_OPEN_CREATE |
93 | 94 | /// Enable URI filename interpretation, parsed according to RFC 3986 (ex. "file:data.db?mode=ro&cache=private")
|
94 |
| -extern const int OPEN_URI; // SQLITE_OPEN_URI |
| 95 | +SQLITECPP_API extern const int OPEN_URI; // SQLITE_OPEN_URI |
95 | 96 | /// Open in memory database
|
96 |
| -extern const int OPEN_MEMORY; // SQLITE_OPEN_MEMORY |
| 97 | +SQLITECPP_API extern const int OPEN_MEMORY; // SQLITE_OPEN_MEMORY |
97 | 98 | /// Open database in multi-thread threading mode
|
98 |
| -extern const int OPEN_NOMUTEX; // SQLITE_OPEN_NOMUTEX |
| 99 | +SQLITECPP_API extern const int OPEN_NOMUTEX; // SQLITE_OPEN_NOMUTEX |
99 | 100 | /// Open database with thread-safety in serialized threading mode
|
100 |
| -extern const int OPEN_FULLMUTEX; // SQLITE_OPEN_FULLMUTEX |
| 101 | +SQLITECPP_API extern const int OPEN_FULLMUTEX; // SQLITE_OPEN_FULLMUTEX |
101 | 102 | /// Open database with shared cache enabled
|
102 |
| -extern const int OPEN_SHAREDCACHE; // SQLITE_OPEN_SHAREDCACHE |
| 103 | +SQLITECPP_API extern const int OPEN_SHAREDCACHE; // SQLITE_OPEN_SHAREDCACHE |
103 | 104 | /// Open database with shared cache disabled
|
104 |
| -extern const int OPEN_PRIVATECACHE; // SQLITE_OPEN_PRIVATECACHE |
| 105 | +SQLITECPP_API extern const int OPEN_PRIVATECACHE; // SQLITE_OPEN_PRIVATECACHE |
105 | 106 | /// Database filename is not allowed to be a symbolic link (Note: only since SQlite 3.31.0 from 2020-01-22)
|
106 |
| -extern const int OPEN_NOFOLLOW; // SQLITE_OPEN_NOFOLLOW |
| 107 | +SQLITECPP_API extern const int OPEN_NOFOLLOW; // SQLITE_OPEN_NOFOLLOW |
107 | 108 |
|
108 | 109 |
|
109 |
| -extern const int OK; ///< SQLITE_OK (used by check() bellow) |
| 110 | +SQLITECPP_API extern const int OK; ///< SQLITE_OK (used by check() bellow) |
110 | 111 |
|
111 |
| -extern const char* const VERSION; ///< SQLITE_VERSION string from the sqlite3.h used at compile time |
112 |
| -extern const int VERSION_NUMBER; ///< SQLITE_VERSION_NUMBER from the sqlite3.h used at compile time |
| 112 | +SQLITECPP_API extern const char* const VERSION; ///< SQLITE_VERSION string from the sqlite3.h used at compile time |
| 113 | +SQLITECPP_API extern const int VERSION_NUMBER; ///< SQLITE_VERSION_NUMBER from the sqlite3.h used at compile time |
113 | 114 |
|
114 | 115 | /// Return SQLite version string using runtime call to the compiled library
|
115 |
| -const char* getLibVersion() noexcept; |
| 116 | +SQLITECPP_API const char* getLibVersion() noexcept; |
116 | 117 | /// Return SQLite version number using runtime call to the compiled library
|
117 |
| -int getLibVersionNumber() noexcept; |
| 118 | +SQLITECPP_API int getLibVersionNumber() noexcept; |
118 | 119 |
|
119 | 120 | // Public structure for representing all fields contained within the SQLite header.
|
120 | 121 | // Official documentation for fields: https://www.sqlite.org/fileformat.html#the_database_header
|
@@ -160,7 +161,7 @@ struct Header {
|
160 | 161 | * because of the way it shares the underling SQLite precompiled statement
|
161 | 162 | * in a custom shared pointer (See the inner class "Statement::Ptr").
|
162 | 163 | */
|
163 |
| -class Database |
| 164 | +class SQLITECPP_API Database |
164 | 165 | {
|
165 | 166 | friend class Statement; // Give Statement constructor access to the mSQLitePtr Connection Handle
|
166 | 167 |
|
@@ -265,7 +266,7 @@ class Database
|
265 | 266 | // Deleter functor to use with smart pointers to close the SQLite database connection in an RAII fashion.
|
266 | 267 | struct Deleter
|
267 | 268 | {
|
268 |
| - void operator()(sqlite3* apSQLite); |
| 269 | + SQLITECPP_API void operator()(sqlite3* apSQLite); |
269 | 270 | };
|
270 | 271 |
|
271 | 272 | /**
|
|
0 commit comments