Skip to content

Adding a --pre option for install/add/sync #289

Closed

Description

@zeroshade

Similar to the --pre option when using pip/uv we want to allow installing pre-releases of drivers via dbc. Both uv and pip have different behaviors for this so we should decide how we want to handle this.

pip's behavior is very simplistic: Without the --pre option, pre-release versions of packages are never considered and essentially don't exist. The benefit here is that it's very simple to implement via filtering versions when reading package metadata.

uv's behavior provides more options. Via either the --prerelease option or via a UV_PRERELEASE environment variable, one of the following options can be chosen to control the behavior:

  • disallow: never allow pre-release versions (the same as pip without the --pre option)
  • allow: allow pre-release versions, e.g. treat them as normal versions for consideration. This would mean that the "latest" version could be a pre-release (1.1.0-beta1 > 1.0.0)
  • if-necessary: allow pre-release versions if a package only has pre-release versions, ignore them otherwise
  • explicit: allow a pre-release version if explicitly asked for, ignore them otherwise
  • if-necessary-or-explicit: allow a pre-release version if there are only pre-release versions for a package or if the pre-release version is explicitly asked for

My personal preference is to follow pip's behavior, but I'm not opposed to mirroring the behavior of uv. Thoughts?

Activity

  1. self-assigned this
    on Feb 4, 2026
  2. amoeba commented on Feb 4, 2026

    @amoeba
    Member

    What are the current and future use cases? I think these are current:

    1. Let driver authors publish pre-release versions their users can install with dbc
    2. Let us completely and seamlessly replace a driver with another using the same path but do it as a pre-release

    I can see how just a simple --pre handles (1) nicely. We publish the pre-release versions to the main driver registry index and dbc gains the smarts to handle pre- and non-pre versions.

    (2) I'm not so sure about since the metadata changes. Do we have to punt on (2) for today and do something different for that?

  3. Mandukhai-Alimaa commented on Feb 4, 2026

    @Mandukhai-Alimaa
    Member

    Can we combine pip's behavior with uv’s "if-necessary-or-explicit" logic? If we went with a strict pip mirror, dbc install would just error out if only pre-releases existed. By adding this logic, it finds the driver even without the --pre flag if there’s no stable alternative. I think this approach is simple enough for users to control whether they want pre-releases, while also preventing unnecessary errors when a pre-release is the only option for a specific driver.

  4. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    @Mandukhai-Alimaa My thinking is that we should hide pre-release drivers if the user does not specify --pre. dbc install wouldn't install them and dbc search wouldn't show them. That allows us to use --pre as a kind of "early access channel" for drivers that we don't yet have enough confidence in.

    In other words: my thinking is that if you do dbc install foo but the only available versions of driver foo are pre-releases, then dbc should fail and not install anything. (But maybe it could print a nice error message saying that a pre-release is available by using --pre.)

  5. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    @amoeba I'm not sure I understand what you mean by this:

    1. Let us completely and seamlessly replace a driver with another using the same path but do it as a pre-release

    Can you elaborate please? What's the series of steps the user takes?

  6. amoeba commented on Feb 4, 2026

    @amoeba
    Member

    If someone writes an SQLite ADBC driver in Rust and we like it enough to make it installable with dbc install sqlite, we could just wholesale replace the sqlite entry in the index with the information for the new driver. But if we wanted to let users try it while in beta, we wouldn't be able to tell them to run dbc install --pre sqlite because of our index structure.

  7. zeroshade commented on Feb 4, 2026

    @zeroshade
    MemberAuthor

    I'm not so sure about since the metadata changes. Do we have to punt on (2) for today and do something different for that?

    How does the metadata change? It's just a version change?

  8. zeroshade commented on Feb 4, 2026

    @zeroshade
    MemberAuthor

    But if we wanted to let users try it while in beta, we wouldn't be able to tell them to run dbc install --pre sqlite because of our index structure.

    We could tell them to run dbc install --pre sqlite if we push the new rust version as a pre-release for a new version of the sqlite driver.

  9. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    A few other notes / thoughts:

    • From my perspective, I think we can keep this simple and follow pip's behavior and pip's interface (just --pre). I don't see the practical benefit of adding more complexity (like what uv provides) at this stage. Does anyone else?
    • If we keep it simple for now, later could we extend this so that:
      • dbc install driver is an alias for dbc install driver --pre disallow (the default behavior)
      • dbc install driver --pre is an alias for dbc install driver --pre allow
      • we also allow users to explicitly specify --pre disallow, --pre allow, --pre if-necessary, etc?
    • I don't think dbc sync needs to take --pre. All the information about whether dbc sync can install pre-releases should be encoded in the driver list and lock file. We will need to add an optional field to the driver list to store this.
  10. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    One caveat to my comment above:

    I tend to think that

    dbc install driver=X.Y.Z-beta.1
    

    (without --pre)

    should succeed (like uv's explicit behavior).

    not fail (like uv's disallow behavior).

    I think maybe explicit is better. If the user is explicitly saying they want version X.Y.Z-beta.1 then surely they know it's a pre-release, so why fail? Thoughts?

  11. amoeba commented on Feb 4, 2026

    @amoeba
    Member

    How does the metadata change? It's just a version change?

    Every field in the index entry changes except pkg_info unless I'm misunderstanding. (name, description, license, urls, docs_url, etc, etc can change). If this isn't in scope that's fine, I'm not sure it has to be for today.

  12. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    For the new field in the driver list, how about we use uv's option values, like this:

    [drivers]
    
    [drivers.mysql]
    
    [drivers.duckdb]
    prerelease = 'allow'
    
    [drivers.postgresql]
    version = '=1.2.3-beta2'

    The default value of prerelease is explicit, so this this list would install pre-releases versions of the drivers for both DuckDB (if it were present and the newest version) and PostgreSQL.

  13. zeroshade commented on Feb 4, 2026

    @zeroshade
    MemberAuthor

    Every field in the index entry changes except pkg_info unless I'm misunderstanding. (name, description, license, urls, docs_url, etc, etc can change). If this isn't in scope that's fine, I'm not sure it has to be for today.

    In theory the name and description shouldn't change in the scenario we're describing. the urls/docs_url could change, hopefully not the license. If the name would change, then we should do an entirely separate driver, not as a pre-release. That's my opinion at least

  14. ianmcook commented on Feb 4, 2026

    @ianmcook
    Member

    If someone writes an SQLite ADBC driver in Rust and we like it enough to make it installable with dbc install sqlite, we could just wholesale replace the sqlite entry in the index with the information for the new driver. But if we wanted to let users try it while in beta, we wouldn't be able to tell them to run dbc install --pre sqlite because of our index structure.

    I don't think we should ever wholesale replace like this. We should just push new drivers with incremented version numbers—initially prerelease version numbers, and later release versions numbers that are higher than the previous versions' numbers.

    Or if we're pushing a driver that needs to update the metadata (e.g. because it's from a different source), then we should do it as a separate driver with a different name (like Matt says above).

  15. added this to the 0.2.0 milestone on Feb 4, 2026
  16. lidavidm commented on Feb 5, 2026

    @lidavidm
    Member

    Mimicking pip's --pre sounds good to me. I don't think we have enough packages to justify uv's fine-grained behavior.

  17. ianmcook commented on Feb 5, 2026

    @ianmcook
    Member

    Here's my attempt to synthesize everything above and add a bit more specificity:

    We will add a --pre flag to dbc install, dbc add, and dbc search.

    We will not support a single-letter alias for --pre.

    This is just a Boolean flag. It doesn't take an option.

    When the user does not specify --pre, dbc acts like prereleases don't exist, unless the user specifies a version constraint that unambiguously indicates that they want a prerelease. In ambiguous cases like if there is a driver named driver with two versions on the registry: 0.1.0 and 0.1.1-beta.1, then dbc install driver>0.1.0 will fail instead of installing 0.1.1-beta.1. The version constraint passed by the user needs to explicitly have a prerelease suffix in it for dbc to install the prerelease without --pre. For example dbc install driver>=0.1.1-beta.1 would succeed.

    When the user does dbc add driver --pre, dbc adds this to the driver list:

    [drivers.driver]
    prerelease = 'allow'

    If the user calls dbc add without --pre and specifies a prerelease version number in the version constraint, dbc does not add prerelease = 'allow' to the driver list. It just adds the version constraint as usual, and dbc sync interprets the version constraint to decide whether to install a prerelease, just the same as described above.

  18. added a commit that references this issue on Feb 7, 2026
    351a413
  19. added a commit that references this issue on Apr 17, 2026
    94328f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions