Skip to content

API to manage database lifecycle and use handle outside of withDB bracket #5

@epoberezkin

Description

@epoberezkin

Currently there are two problems with the API:

  • you cannot open database once, when the server starts, and close on exit, instead it would need to be opened and closed on every operation - this is likely to be inefficient.
  • API doesn't differentiate between opening and creating database - this is error prone and it is better to manage in the application, where the application can potentially warn user about the missing database instead of creating a new one.

While the current withDB API needs to be preserved both for backwards compatibility and for simple testing, what is missing for production use is open/close/create APIs.

Happy to contribute if it's acceptable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions