stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.64k stars 1.56k forks source link

FTS5Config Unavailable on Linux #1007

Closed mathetesxristou closed 2 years ago

mathetesxristou commented 4 years ago

SQLite.swift (0.12.0) works well on the Linux implementation of my project, until I added an FTS5 search function. FTS5 works well on macOS. However, I get the following error on Linux:

error: use of unresolved identifier 'FTS5Config'

Are FTS5 extensions not available in SQLite.swift when running on Linux? If it is not currently supported, are there plans to include support for FTS5 on SQLite.swift running on Linux?

nathanfallet commented 3 years ago

SQLite.swift was developed for iOS, macOS, tvOS and watchOS. I'm not sure that Linux support was intentional if it is supporting it, but at least, it could be an enhancement.

nathanfallet commented 3 years ago

Linked to #1064

jberkel commented 3 years ago

The FTS5 code is currently excluded on Linux. For some reason there is a dependency to SQLiteObjc, which cannot be compiled on Linux.

/root/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h:36:86: error: nullability specifier '_Nullable' cannot be applied to non-pointer type 'int'
int _SQLiteRegisterTokenizer(sqlite3 *db, const char *module, const char *tokenizer, _Nullable _SQLiteTokenizerNextCallback callback);
                                                                                     ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/root/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h"
         ^
/root/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h:37:1: error: unknown type name 'NS_ASSUME_NONNULL_END'
NS_ASSUME_NONNULL_END
^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/root/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h"
         ^
/root/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h:38:1: error: expected identifier or '('

^
/root/SQLite.swift/Sources/SQLite/Extensions/FTS4.swift:26:8: error: could not build C module 'SQLiteObjc'
import SQLiteObjc
       ^
[2/7] Compiling SQLite FTS4.swift
error: fatalError
jberkel commented 2 years ago

Fixed in 0.14.0