Skip to content

Make ConfigOptions easier to work with #3886

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In order to use the ConfigOptions structure in more places, it was changed to be an Arc<RwLock<ConfigOptions>> by @waitingkuo in #3455 which is good

The usecase there was so that the configuration was owned by SessionContext but other parts could read it if necessary -- specifically, information_schema.df_settings / SHOW ALL initially.

I have been trying to consolidate these settings (see #3822) but find that working with ConfigOptions is somewhat of a pain (as you have to type Arc<RwLock> a bunch and then to update values you have to call read() and write()

Describe the solution you'd like

I would like to move the mutability handling into ConfigOption so this looks like

#[impl(Clone)]
struct ConfigOptions { 
  data: Arc<RwLock<...>>
}

And change all places in the code that use

Arc<RwLock<ConfigOptions>>

to

ConfigOptions

That would hide the details of shared ownership more nicely I think

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Came up here with @thinkharderdev : #3822 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions