I tried to implement the sqlite3_preupdate_hook(). But in the documentation SQlite docs they have asked to enable the compilation flag to get the method. How to enable the compilation flag and get the access of sqlite3_preupdate_hook().
One option is to integrate SQLite through Swift Package Manager and provide the options you want from there.
Take a look at the Vapor's SQLite-nio implementation: sqlite-nio/Package.swift at main · vapor/sqlite-nio · GitHub
Hey. I integrated SQLite through Swift Package Manager. After integrating, when I tried to use the sqlite3_preupdate_hook() I got this error: "Cannot find 'sqlite3_preupdate_hook' in scope".
If you took the SQLite C code from that package, it's probably
Yeah I took it from NIO. I used this method sqlite_nio_sqlite3_preupdate_hook(). But still I got this "sqlite_nio_sqlite3_preupdate_hook()" not found error.
Did you import CSQLite?
Yes I did
Okay, I tried it myself and it works.
I think you might have some other issue with your implementation and it's hard to find it without knowing your implementation. Is sqlite3_preupdate_hook() the only function that is missing for example? Can you use the rest of the C API? Can you open a connection?
Maybe you can just use the SQLite-nio package? As far as I can see, they already enabled the option you want.
Let me go through the steps I did. I installed SQlite using Swift package manager. Then I imported CSQLite and tried to implement the "sqlite_nio_sqlite3_preupdate_hook()". I got this error.
import SQlite3. If you are going with the SQLite-nio implementation then you will have to use the functions with "sqlite_nio_", so
sqlit3_finalize will become
Can you post your Package.swift? Also, how does your "Frameworks, Libraries, and Embedded Content" section look like in the project settings?