Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a config.yaml file when database server is first run #7980

Open
zachmu opened this issue Jun 7, 2024 · 4 comments
Open

Create a config.yaml file when database server is first run #7980

zachmu opened this issue Jun 7, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zachmu
Copy link
Member

zachmu commented Jun 7, 2024

This is standard practice in the database world: you get a config file with the defaults when you install the server.

https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE

Dolt makes you write your own.

Instead, Dolt should drop a config.yaml file with the default values (modified as necessary for the current execution) in the same location as the database directories when sql-server is run.

@zachmu zachmu added enhancement New feature or request good first issue Good for newcomers labels Jun 7, 2024
@farhanhubble
Copy link

Same goes for config.json. It is mentioned in the docker instructions mapping host directories to docker directories but no standard template is provided anywhere.

@zachmu
Copy link
Member Author

zachmu commented Jun 28, 2024

Thanks for the feedback, agree we could do better here.

@milogreg
Copy link
Contributor

milogreg commented Dec 2, 2024

I'd like to work on this, and would appreciate a little help before I get started.

I plan to use the defaults described in sqlServerDocs in go/cmd/dolt/commands/sqlserver/sqlserver.go. Is there a better canonical set of defaults I should be sourcing from?

I am also not sure how the options with no defined defaults should be handled. Should a comment be left in the file as a placeholder, should they not be included at all, or is there a way to explicitly set a config option to undefined/unset?

Lastly, I'm assuming by "modified as necessary for the current execution" you mean the config file should include the corresponding config options for the flags sql-server is executed with. Is this assumption correct?

Thanks.

@zachmu
Copy link
Member Author

zachmu commented Dec 2, 2024

Hi @milogreg,

Thanks for volunteering!

The function DefaultServerConfig has the defaults for every value (and this is what gets printed by the help text).

The config file is yaml, so the "unset" type for values is usually just the empty string. But there are some types where unset has different semantics than "empty", and in these cases you should comment out the line in the YAML file.

Your other assumptions sound correct.

Let me know if you run into any difficulties or need a pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants