Skip to content

Builder::create / open ambiguity #303

@imbolc

Description

@imbolc

I was surprised by absence of the Builder::open_or_create method. But then I looked at redb::Builder::create to which native_db::Builder::create is meant to be similar, and it actually is an "open or create":

Opens the specified file as a redb database.

  • if the file does not exist, or is an empty file, a new database will be initialized in it
  • if the file is a valid redb database, it will be opened
  • otherwise this function will return an error

It seems that, if the methods are meant to be consistent, native_db should also upgrade the db on create. Though for me the redb naming seems unintuitive. Why not explicitly call it open_or_create?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions