Skip to content

Allow customizing Storage database name#428

Open
joekrill wants to merge 1 commit into
OP-Engineering:mainfrom
joekrill:customize-storage-db-name
Open

Allow customizing Storage database name#428
joekrill wants to merge 1 commit into
OP-Engineering:mainfrom
joekrill:customize-storage-db-name

Conversation

@joekrill

Copy link
Copy Markdown

This allows overriding the filename used by the Key-Value Storage (from the default __opsqlite_storage.sqlite).

I'm not sure if there was any particular reason for not being able to override this?

@ospfranco

Copy link
Copy Markdown
Contributor

what's the point of overriding this? The intention is to keep the API as simple as possible to avoid people messing up stuff

@joekrill

Copy link
Copy Markdown
Author

what's the point of overriding this? The intention is to keep the API as simple as possible to avoid people messing up stuff

As an example: you may want a key-value store for app configuration items, and a separate one for cached data. The cached data can be deleted/wiped without affecting the app preferences.

It's already possible to create multiple instances - it's just that currently there's a requirement that they be in different locations. So this actually makes that use-case simpler and less complex in those cases.

@ospfranco

Copy link
Copy Markdown
Contributor

eh... you might as well save your configurations under a different key than a whole new database?

This API was created as a convenience for people who didn't want to add another package like MMKV but it's meant to be simple and dumb AF... otherwise people mess up their dbs, get connection problems, memory problems and then they complain the package doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants