-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to upgrade sqlite version fast? #2301
Comments
I assume you're running those tests as unit tests? In that case, the sqlite3 version from your operating system will be used (and we have no way of changing that currently - To test drift itself, I'm using this file and I'm calling |
On which operating system are you on though? Windows doesn't bundle sqlite3, so you have probably downloaded it and can download a more recent version. macOS tends to ship somewhat recent sqlite3 builds too, and there's an easy way to in install up-to-date sqlite3 libraries for almost all Linux distributions as well. So maybe there's a way to update sqlite3 on your system and avoid the local workarounds. |
It is Ubuntu 20.04 LTS but accoding to this post it is not so safe. I guess that with newer destribution comes newer sqlite version. I will stick to the file you provided for now |
I also ran into this problem on macos, and couldn't upgrade the user's macos version. Is there any way to specify the runtime version of sqlite3 on macos? @simolus3 |
Using |
I tried to add this, but the result is that the value obtained by sqlite3.version is still the version number of sqlite that comes with macOS. And I also tried using brew to install a new version of sqlite and set environment variables. However, the runtime uses either the sqlite that comes with the system. |
If you run this integration test (with If it's only broken in your app, I wonder if this snippet works for you? |
Sorry, I can't test it on that machine at the moment. |
That makes it kind of hard for me to help diagnose the problem. I don't see a general issue with |
MacOS has been always been a bit more complicated with brew and now even more especially on Apple silicon. I am using code like this: if (Platform.isMacOS) {
os = OperatingSystem.macOS;
/// First check if the Arm64 binary installed via Homebrew exists.
/// The homebrew binary path is different for x86 and Arm64
library = File('/opt/homebrew/opt/sqlite/bin/sqlite3');
if (!library.existsSync()) {
/// Next check the x86 Homebrew binary.
library = File('/usr/local/homebrew/opt/sqlite/bin/sqlite3');
}
if (!library.existsSync()) {
/// If Homebrew binaries are not found, lastly check the system default.
/// This may be an outdated version on older MacOS systems.
library = File('/usr/local/opt/sqlite/bin/sqlite3');
}
} else if (Platform.isLinux) {
os = OperatingSystem.linux;
library = File('/usr/local/lib/libsqlite3.so');
} else {
throw AssertionError('Linux or MacOS is required to run database tests!');
}
open.overrideFor(os, () => DynamicLibrary.open(library.absolute.path)); |
This seems like a good idea. But if it is in the production release version, rather than doing integration testing, more robustness processing may be required. thanks~ |
I am getting this error
because my sqlite version is 3.31.0 and I want to upgrade.
I put
sqlite3_flutter_libs: ^0.5.12
to mypubspec.yaml
but it does not help.Btw I need this for testing where I initialize my database like this:
The text was updated successfully, but these errors were encountered: