Skip to content
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

Fix DB #143

Merged
merged 6 commits into from Mar 28, 2024
Merged

Fix DB #143

merged 6 commits into from Mar 28, 2024

Conversation

poundifdef
Copy link
Contributor

This PR:

  • Adds back the "static" database which just maintains a default state
  • Changes config format slightly
  • Supports sqlite and postgres

@poundifdef poundifdef requested a review from a team March 27, 2024 21:50
pkg/storage/services.go Outdated Show resolved Hide resolved
func NewDatabaseConnection(conf config.Database, destinations []config.Destination, adminKeys []config.APIKey) (Database, error) {
switch conf.Type {
case "static":
return static.NewStaticDatabase(conf, destinations, adminKeys)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a separate static database, what about an in-memory sqlite database that has an option passed to it to make all operations read only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with doing this and started the work on a new branch. However, there are a lot of things that need to be implemented first (for example, CreateDestination() which I believe you're working on now.) So let's leave this static for now, and feel free to auto-generate stubs, and then we can revisit.

@poundifdef poundifdef merged commit a252cbe into main Mar 28, 2024
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.

None yet

2 participants