tauri-plugin-sql icon indicating copy to clipboard operation
tauri-plugin-sql copied to clipboard

No way to close an exsisting connection.

Open 4silvertooth opened this issue 3 years ago • 4 comments

I didn't find a way to close an existing connection either from rust or script.

4silvertooth avatar May 16 '22 13:05 4silvertooth

What's the use case you're solving for @4silvertooth? In most use cases keeping an open connection pool between front and backend is desirable but i have no doubt that closing the connection may be a desired state to manually put the connection into (especially for non-Sqlite based DBs). Just looking for some additional context on what you were hoping to achieve.

yankeeinlondon avatar Jul 21 '22 03:07 yankeeinlondon

For desktop environment application can have multiple database files, (a financial application with multiple companies can have individual db file), to switch between these database files it's required to close the previous connection and open a new connection with a different database file.

4silvertooth avatar Jul 21 '22 08:07 4silvertooth

I see. Just out of curiosity, is this a regulatory requirement or a functional goal for better isolation? In either case, I think the ability to do this makes sense as a feature going forward.

On Thu, Jul 21, 2022 at 1:14 AM Viral Ghelani @.***> wrote:

For desktop environment application can have multiple database files, (a financial application with multiple companies can have individual db file), to switch between these database files it's required to close the previous connection and open a new connection with a different database file.

— Reply to this email directly, view it on GitHub https://github.com/tauri-apps/tauri-plugin-sql/issues/102#issuecomment-1191183756, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHPOFPXCIYXREMYBAMJB43VVEBH5ANCNFSM5WBPKO3Q . You are receiving this because you commented.Message ID: @.***>

yankeeinlondon avatar Jul 22 '22 14:07 yankeeinlondon

I was evaluating tauri with sqlite plugin for a project. It's not a regulatory requirement, but accountants usually has really large set of company data they work with, so it makes sense to isolate individual company data into seperate db file.

4silvertooth avatar Jul 24 '22 11:07 4silvertooth

I believe this is an essential part of the plugin functionality and it should be supported.

Even for the case of SQLite the connection should be closed properly when it's not needed anymore. Otherwise, SQLite would be forced to leave own temporary files on disk, e.g. when running in WAL-mode.

alllex avatar Sep 22 '22 21:09 alllex