mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
SPM: export CSQLite package
This commit is contained in:
1 parent
d72000c6a3
commit
5727163966
4 files changed
+6
-2
No files matched your search
@@ -0,0 +1,5 @@
|
||||
module CSQLite {
|
||||
header "shim.h"
|
||||
link "sqlite3"
|
||||
export *
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <sqlite3.h>
|
||||
|
||||
typedef void(*errorLogCallback)(void *pArg, int iErrCode, const char *zMsg);
|
||||
|
||||
/// Wrapper around sqlite3_config(SQLITE_CONFIG_LOG, ...) which is a variadic
|
||||
/// function that can't be used from Swift.
|
||||
static inline void registerErrorLogCallback(errorLogCallback callback) {
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, callback, 0);
|
||||
}
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3029000
|
||||
/// Wrapper around sqlite3_db_config() which is a variadic function that can't
|
||||
/// be used from Swift.
|
||||
static inline void disableDoubleQuotedStringLiterals(sqlite3 *db) {
|
||||
sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, (void *)0);
|
||||
sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, (void *)0);
|
||||
}
|
||||
|
||||
/// Wrapper around sqlite3_db_config() which is a variadic function that can't
|
||||
/// be used from Swift.
|
||||
static inline void enableDoubleQuotedStringLiterals(sqlite3 *db) {
|
||||
sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 1, (void *)0);
|
||||
sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 1, (void *)0);
|
||||
}
|
||||
#else
|
||||
static inline void disableDoubleQuotedStringLiterals(sqlite3 *db) { }
|
||||
static inline void enableDoubleQuotedStringLiterals(sqlite3 *db) { }
|
||||
#endif
|
||||
Reference in new issue
Block a user