-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
datasette.yaml
plugin support
#2183
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
da111fc
Checkpoint, moving top-level plugin config to datasette.json
asg017 2ad9e53
Support database-level and table-level plugin configuration in datase…
asg017 0c5545b
typo
asg017 2a05f97
fmt
asg017 740c9f2
documentation
asg017 2869835
cog
asg017 659dcbd
Fixed metadata example that is now datasette.yaml
simonw acca338
Move configuration up next to installation in menu
simonw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,101 @@ | ||
.. _configuration: | ||
|
||
Configuration | ||
======== | ||
============= | ||
|
||
Datasette offers many way to configure your Datasette instances: server settings, plugin configuration, authentication, and more. | ||
Datasette offers several ways to configure your Datasette instances: server settings, plugin configuration, authentication, and more. | ||
|
||
To facilitate this, You can provide a `datasette.yaml` configuration file to datasette with the ``--config``/ ``-c`` flag: | ||
To facilitate this, You can provide a ``datasette.yaml`` configuration file to datasette with the ``--config``/ ``-c`` flag: | ||
|
||
.. code-block:: bash | ||
|
||
datasette mydatabase.db --config datasette.yaml | ||
|
||
.. _configuration_reference: | ||
|
||
``datasette.yaml`` reference | ||
---------------------------- | ||
|
||
Here's a full example of all the valid configuration options that can exist inside ``datasette.yaml``. | ||
|
||
.. tab:: YAML | ||
|
||
.. code-block:: yaml | ||
|
||
# Datasette settings block | ||
settings: | ||
default_page_size: 50 | ||
sql_time_limit_ms: 3500 | ||
max_returned_rows: 2000 | ||
|
||
# top-level plugin configuration | ||
plugins: | ||
datasette-my-plugin: | ||
key: valueA | ||
|
||
# Database and table-level configuration | ||
databases: | ||
your_db_name: | ||
# plugin configuration for the your_db_name database | ||
plugins: | ||
datasette-my-plugin: | ||
key: valueA | ||
tables: | ||
your_table_name: | ||
# plugin configuration for the your_table_name table | ||
# inside your_db_name database | ||
plugins: | ||
datasette-my-plugin: | ||
key: valueB | ||
|
||
.. _configuration_reference_settings: | ||
Settings configuration | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
:ref:`settings` can be configured in ``datasette.yaml`` with the ``settings`` key. | ||
|
||
.. tab:: YAML | ||
|
||
.. code-block:: yaml | ||
|
||
# inside datasette.yaml | ||
settings: | ||
default_allow_sql: off | ||
default_page_size: 50 | ||
|
||
|
||
.. _configuration_reference_plugins: | ||
Plugin configuration | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Configuration for plugins can be defined inside ``datasette.yaml``. For top-level plugin configuration, use the ``plugins`` key. | ||
|
||
.. tab:: YAML | ||
|
||
.. code-block:: yaml | ||
|
||
# inside datasette.yaml | ||
plugins: | ||
datasette-my-plugin: | ||
key: my_value | ||
|
||
For database level or table level plugin configuration, nest it under the appropriate place under ``databases``. | ||
|
||
.. tab:: YAML | ||
|
||
.. code-block:: yaml | ||
|
||
# inside datasette.yaml | ||
databases: | ||
my_database: | ||
# plugin configuration for the my_database database | ||
plugins: | ||
datasette-my-plugin: | ||
key: my_value | ||
my_other_database: | ||
tables: | ||
my_table: | ||
# plugin configuration for the my_table table inside the my_other_database database | ||
plugins: | ||
datasette-my-plugin: | ||
key: my_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ Contents | |
|
||
getting_started | ||
installation | ||
configuration | ||
ecosystem | ||
cli-reference | ||
pages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you updated this too. Trying that myself: