You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uses of SQLite can be categorized into two ways: reading and writing complex application state, and reading from an existing dataset. AFAIK this is OLTP and OLAP, respectively.
For complex state, it is appropriate for the file to be created and managed in appDataDir. However, for the case where the developer is bringing existing data to query (and only needs read-only access), it should be possible to access a database file as a resource directly. Right now, plugin-sql does not allow this.
(This situation happens in other frameworks as well, where the sqlite adapter does not provide read-only access to bundled databases. The common, and I'd argue ugly, work around is to copy the bundled database to appDataDir's equivalents, doubling the storage use for no good reason.)
TL;DR and proposed solution
It would be nice if plugin-sql provides read-only access to sqlite databases bundled as resources. This can be done, perhaps, by having plugin.rs recognize a different type, perhaps sqlite-resource:<path>, where path is resolved as a resource and errors if it doesn't exist.
This should not have safety implications, I think, as it only allows the developer to decide to access bundled resources.
The text was updated successfully, but these errors were encountered:
Why
Uses of SQLite can be categorized into two ways: reading and writing complex application state, and reading from an existing dataset. AFAIK this is OLTP and OLAP, respectively.
For complex state, it is appropriate for the file to be created and managed in appDataDir. However, for the case where the developer is bringing existing data to query (and only needs read-only access), it should be possible to access a database file as a resource directly. Right now, plugin-sql does not allow this.
(This situation happens in other frameworks as well, where the sqlite adapter does not provide read-only access to bundled databases. The common, and I'd argue ugly, work around is to copy the bundled database to appDataDir's equivalents, doubling the storage use for no good reason.)
TL;DR and proposed solution
It would be nice if plugin-sql provides read-only access to sqlite databases bundled as resources. This can be done, perhaps, by having plugin.rs recognize a different type, perhaps
sqlite-resource:<path>
, wherepath
is resolved as a resource and errors if it doesn't exist.This should not have safety implications, I think, as it only allows the developer to decide to access bundled resources.
The text was updated successfully, but these errors were encountered: