tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!
https://tauri.app
Apache License 2.0
758 stars 202 forks source link

Tauri SQL plugin not working on Debian/Ubuntu/Linux in production #1386

Open jLynx opened 1 month ago

jLynx commented 1 month ago

Hi, I have a project I am working on which requires tauri-plugin-sql, it works perfectly fine on Windows and Mac, but when I do a production build for Ubuntu, it doesn't want to work work. It create an empty database file (around 4kb) but wont create any tables, it just just stuck and hangs on await db.execute(sqlCommand). I have a try/catch around it, but it never gets caught, it just hangs.

What is strange though, if I run it in dev mode npm run tauri dev it works fine, but if I build it, it hangs npm run tauri build -- --debug.

Keep in mind this works perfectly find for production for both Windows and Mac in both dev and production builds.

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/plugins-workspace"
branch = "v1"
features = ["sqlite"]

Testing on Ubuntu 23.04

I am not sure how I can further debug what is going on. Is this a known issue?

FabianLars commented 1 month ago

It create an empty database file (around 4kb) but wont create any tables

Just so we're on the same page, where does it create it and are you sure it's not a leftover from dev?

jLynx commented 1 month ago

It creates it in ~/.config/com.my.program/program.db

Its called program.db and when I have my dev instance its program_local.db

FabianLars commented 1 month ago

Okay thanks.

Did you try starting the compiled binary from inside a terminal so you hopefully get some logs?

Also, does this concern the binary, .deb, or .appimage or all of them?

jLynx commented 1 month ago

I have only tried with .deb. When I launched from terminal, I didnt get any output related to the db or sql sadly

jLynx commented 1 month ago

Also side note. I "think" it works on 24.04 as I can see all the correct console log message I have been printed out and the db seems to have all the related tables. But the issue with 24.04 is that the UI freezes and I cant click on anything, even though it seems to be working fine behind the UI as the messages are still coming out in console.log even though the UI is locked up. I think there was a bug or two about that somewhere already