Skip to content

Rationalize locations where dbc configs are stored #230

Closed

Description

@ianmcook

Currently on macOS:

  • uid.uuid is created in ~/Library/Application Support/Columnar/dbc
  • The credentials subdirectory (which contains columnar.lic and credentials.toml) is created in into ~/Library/dbc

Shouldn't we have these be in the same place?

Activity

  1. amoeba commented on Dec 12, 2025

    @amoeba
    Member

    Yes. That was missed during review. These two categories of file use different code paths so we should refactor them into a common one too.

  2. added theissue type on Dec 12, 2025
  3. self-assigned this
    on Dec 12, 2025
  4. amoeba commented on Dec 12, 2025

    @amoeba
    Member

    I'll put a PR up for this later today.

  5. amoeba commented on Dec 13, 2025

    @amoeba
    Member

    The actual bug was me here, sorry @zeroshade.

    I suggested XDG_DATA_DIR and @zeroshade told me exactly where the credentials were going to go based on that (~/Library/dbc) and it didn't immediately strike me as odd. Looking around, it's not odd and it's even recommended,

    Note: The ~/Library/Application Support directory is reserved for non-essential application resources like templates or plug-ins which may be changed by the user. It should not be used to store irreplaceable user data.

    See https://developer.apple.com/library/archive/qa/qa1170/_index.html. Credentials could fall under this category, I'm not sure. Applications having a ~/Library/$app folder is not universal but it's not rare.

    But I kept researching and we can make a pretty good argument that all of this guidance we're pulling from Apple is talking about Applications and we can further make the argument that dbc isn't an Application (for various reasons), so we're kind of making stuff up here even with using ~/Library at all. By some argument, we should've used ~/.config/dbc which is more common for CLI tools on macOS in my sampling. The reality is that no one is consistent about any of this.

    If I were to do it again, I think I'd suggest we follow XDG more literally on macOS and use (1) ~/.config/dbc for config and (2) ~/.local/share/dbc for data/credentials which is how I interpret XDG.

    Do you have any thoughts on this @ianmcook? I see an advantage to just having one folder on all platforms for all of dbc's files. I might sit on this for a couple of days and come at it with fresh eyes.

  6. added this to the 0.1.x milestone on Jan 7, 2026
  7. amoeba commented on Jan 17, 2026

    @amoeba
    Member

    We closed #231 without merging since it wasn't really clear a change was needed. My latest thoughts are in #231 (comment). Still would appreciate feedback @ianmcook or @esadek if either of you want to read up.

  8. ianmcook commented on Jan 17, 2026

    @ianmcook
    MemberAuthor

    After looking at this again, I think we should just put the credentials subdirectory in ~/Library/Application Support/Columnar/dbc alongside uid.uuid.

    Using ~/Library/Application Support like this is extremely common across macOS apps today, and everyone seems to agree that it's fine.

  9. amoeba commented on Jan 17, 2026

    @amoeba
    Member

    I'm fine doing that but what I found suggests against it more than suggests for it. Even though it's technically wrong, I don't think it will ever come up for us as a problem. i.e., leaving it as-is will lead to the same outcome as changing it.

    So here's the summary of where we'll store stuff with this new proposal:

    UUIDs, other config, etc:

    • macOS: $HOME/Library/Application Support/Columnar/dbc
    • Linux: $XDG_CONFIG_HOME or $HOME/.config/dbc
    • Windows: %APPDATA% ($HOME/AppData/Roaming)

    Credentials:

    • macOS: $HOME/Library/Application Support/Columnar/dbc
    • Linux: $XDG_DATA_DIR or $HOME/.local/share/dbc
    • Windows: %LOCALAPPDATA% ($HOME/AppData/Local)

    Which means:

    • macOS only has one dir for all dbc files
    • Linux: Separates config dir from credentials dir
    • Windows: Separates config dir from credentials dir
  10. ianmcook commented on Jan 17, 2026

    @ianmcook
    MemberAuthor

    I'm confused about why it's "technically wrong."

    The link in your comment above which suggests not using ~/Library/Application Support to store "irreplaceable user data" is outdated. Apple gave different guidance in more recent docs. For example, this more recent one says that the Application Support subdirectory:

    Contains all app-specific data and support files. These are the files that your app creates and manages on behalf of the user and can include files that contain user data.

    The former is from 2010; the latter is from 2018.

  11. ianmcook commented on Jan 17, 2026

    @ianmcook
    MemberAuthor

    Which means:

    • macOS only has one dir for all dbc files
    • Linux: Separates config dir from credentials dir
    • Windows: Separates config dir from credentials dir

    I think this is the correct approach despite the superficial discordance

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions