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

Need improvements around missing database files #17

Open
jmeaster30 opened this issue Nov 29, 2024 · 0 comments
Open

Need improvements around missing database files #17

jmeaster30 opened this issue Nov 29, 2024 · 0 comments
Labels
Improvement Not a bug but a problem that needs improving Inky dinky make ya thinky Needs to have some questions resolved or thought through more

Comments

@jmeaster30
Copy link
Owner

connection: Connection::open(database_file).unwrap(),

This unwraps the connection which can't be made if the db file doesn't exist so it panics

Two options for solving IMO:

  1. Return a result from the SimpleDatabase constructor.
    • Error should indicate to the user that they need to run the init command to set up database file.
    • PRO: Easier
    • CON: Infectious error handling (not TERRIBLE because explicit is better but complicates code a bit)
  2. Just initialize the database right there.
    • PRO: User doesn't have to run a separate command and we can probably remove the init command possibly
    • CON: Need consideration in implementation with multiple threads and what not
@jmeaster30 jmeaster30 added Inky dinky make ya thinky Needs to have some questions resolved or thought through more Improvement Not a bug but a problem that needs improving labels Nov 29, 2024
@jmeaster30 jmeaster30 added this to the Home Network Complete milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Not a bug but a problem that needs improving Inky dinky make ya thinky Needs to have some questions resolved or thought through more
Projects
None yet
Development

No branches or pull requests

1 participant