Simon Willison
7a5adb592a
Docs on temporary plugins in fixtures, closes #2234
2024-01-12 14:12:14 -08:00
Simon Willison
a25bf6bea7
fmt: off to fix problem with Black, closes #2231
2024-01-10 14:12:20 -08:00
Simon Willison
7506a89be0
Docs on datasette.client for tests, closes #1830
...
Also covers ds.client.actor_cookie() helper
2024-01-10 13:04:34 -08:00
Simon Willison
2ff4d4a60a
Test for ?_extra=count, refs #262
2024-01-08 13:14:25 -08:00
Simon Willison
0b2c6a7ebd
Fix for ?_extra=columns bug, closes #2230
...
Also refs #262 - started a test suite for extras.
2024-01-08 13:12:57 -08:00
Simon Willison
c7a4706bcc
jinja2_environment_from_request() plugin hook
...
Closes #2225
2024-01-05 14:33:23 -08:00
Simon Willison
872dae1e1a
Fix for CSV labels=on missing foreign key bug, closes #2214
2023-12-22 15:08:11 -08:00
Simon Willison
4284c74bc1
db.execute_isolated_fn() method ( #2220 )
...
Closes #2218
2023-12-19 10:51:03 -08:00
Alex Garcia
3d6d1e3050
Raise an exception if a "plugins" block exists in metadata.json
2023-10-12 09:20:50 -07:00
Alex Garcia
35deaabcb1
Move non-metadata configuration from metadata.yaml to datasette.yaml
...
* Allow and permission blocks moved to datasette.yaml
* Documentation updates, initial framework for configuration reference
2023-10-12 09:16:37 -07:00
Simon Willison
b7cf0200e2
Swap order of config and metadata options, refs #2194
2023-09-21 13:22:40 -07:00
Simon Willison
80a9cd9620
test-datasette-load-plugins now fails correctly, refs #2193
2023-09-21 12:55:50 -07:00
Simon Willison
6ed7908580
Simplified test for #2189
...
This now executes two facets, in the hope that parallel facet execution
would illustrate the bug - but it did not illustrate the bug.
2023-09-18 10:44:13 -07:00
Simon Willison
f56e043747
test_facet_against_in_memory_database, refs #2189
...
This is meant to illustrate a crashing bug but it does not trigger it.
2023-09-18 10:39:11 -07:00
Simon Willison
852f501485
Switch from pkg_resources to importlib.metadata in app.py, refs #2057
2023-09-16 09:35:18 -07:00
Alex Garcia
b2ec8717c3
Plugin configuration now lives in datasette.yaml/json
...
* Checkpoint, moving top-level plugin config to datasette.json
* Support database-level and table-level plugin configuration in datasette.yaml
Refs #2093
2023-09-13 14:06:25 -07:00
Simon Willison
b645174271
actors_from_ids plugin hook and datasette.actors_from_ids() method ( #2181 )
...
* Prototype of actors_from_ids plugin hook, refs #2180
* datasette-remote-actors example plugin, refs #2180
2023-09-07 21:23:59 -07:00
Simon Willison
c26370485a
Label expand permission check respects cascade, closes #2178
2023-09-07 16:28:30 -07:00
Simon Willison
dbfad6d220
Foreign key label expanding respects table permissions, closes #2178
2023-09-07 15:51:09 -07:00
Simon Willison
2200abfa17
Fix for flaky test_hidden_sqlite_stat1_table, closes #2179
2023-09-07 15:49:50 -07:00
Simon Willison
98ffad9aed
execute-sql now implies can view instance/database, closes #2169
2023-08-31 15:46:26 -07:00
Simon Willison
6bfe104d47
DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins
...
Closes #2164
* Load only specified plugins for DATASETTE_LOAD_PLUGINS=datasette-one,datasette-two
* Load no plugins if DATASETTE_LOAD_PLUGINS=''
* Automated tests in a Bash script for DATASETTE_LOAD_PLUGINS
2023-08-30 15:12:24 -07:00
Simon Willison
bb12229794
Rename core_ to catalog_, closes #2163
2023-08-29 10:01:28 -07:00
Simon Willison
50da908213
Cascade for restricted token view-table/view-database/view-instance operations ( #2154 )
...
Closes #2102
* Permission is now a dataclass, not a namedtuple - refs https://github.com/simonw/datasette/pull/2154/#discussion_r1308087800
* datasette.get_permission() method
2023-08-29 09:32:34 -07:00
Alex Garcia
92b8bf38c0
Add new `--internal internal.db` option, deprecate legacy `_internal` database
...
Refs:
- #2157
---------
Co-authored-by: Simon Willison <swillison@gmail.com>
2023-08-28 20:24:23 -07:00
Simon Willison
2e2825869f
Test for --get --actor, refs #2153
2023-08-28 13:18:24 -07:00
Simon Willison
d8351b08ed
datasette --get --actor 'JSON' option, closes #2153
...
Refs #2154
2023-08-28 13:15:38 -07:00
Simon Willison
d9aad1fd04
-s/--setting x y gets merged into datasette.yml, refs #2143 , #2156
...
This change updates the `-s/--setting` option to `datasette serve` to allow it to be used to set arbitrarily complex nested settings in a way that is compatible with the new `-c datasette.yml` work happening in:
- #2143
It will enable things like this:
```
datasette data.db --setting plugins.datasette-ripgrep.path "/home/simon/code"
```
For the moment though it just affects [settings](https://docs.datasette.io/en/1.0a4/settings.html ) - so you can do this:
```
datasette data.db --setting settings.sql_time_limit_ms 3500
```
I've also implemented a backwards compatibility mechanism, so if you use it this way (the old way):
```
datasette data.db --setting sql_time_limit_ms 3500
```
It will notice that the setting you passed is one of Datasette's core settings, and will treat that as if you said `settings.sql_time_limit_ms` instead.
2023-08-28 13:06:14 -07:00
Simon Willison
527cec66b0
utils.pairs_to_nested_config(), refs #2156 , #2143
2023-08-24 11:21:15 -07:00
Simon Willison
2ce7872e3b
-c shortcut for --config - refs #2143 , #2149
2023-08-22 19:33:26 -07:00
Alex Garcia
17ec309e14
Start datasette.json, re-add --config, rm settings.json
...
The first step in defining the new `datasette.json/yaml` configuration mechanism.
Refs #2093 , #2143 , #493
2023-08-22 18:26:11 -07:00
Simon Willison
01e0558825
Merge pull request from GHSA-7ch3-7pp7-7cpq
...
* API explorer requires view-instance permission
* Check database/table permissions on /-/api page
* Release notes for 1.0a4
Refs #2119 , #2133 , #2138 , #2140
Refs https://github.com/simonw/datasette/security/advisories/GHSA-7ch3-7pp7-7cpq
2023-08-22 10:10:01 -07:00
Simon Willison
4535568f2c
Fixed display of database color
...
Closes #2139 , closes #2119
2023-08-10 22:16:19 -07:00
Simon Willison
a3593c9015
on_success_message_sql, closes #2138
2023-08-09 17:32:07 -07:00
Simon Willison
4a42476bb7
datasette plugins --requirements, closes #2133
2023-08-09 15:04:16 -07:00
Simon Willison
e34d09c6ec
Don't include columns in query JSON, refs #2136
2023-08-09 12:01:59 -07:00
Simon Willison
26be9f0445
Refactored canned query code, replaced old QueryView, closes #2114
2023-08-09 08:26:52 -07:00
Simon Willison
cd57b0f712
Brought back parameter fields, closes #2132
2023-08-08 06:45:04 -07:00
Simon Willison
1377a290cd
New JSON design for query views ( #2118 )
...
* Refs #2111 , closes #2110
* New Context dataclass/subclass mechanism, refs #2127
* Define QueryContext and extract get_tables() method, refs #2127
* Fix OPTIONS bug by porting DaatbaseView to be a View subclass
* Expose async_view_for_class.view_class for test_routes test
* Error/truncated aruments for renderers, closes #2130
2023-08-07 18:47:39 -07:00
Simon Willison
8cd60fd1d8
Homepage test now just asserts isinstance(x, int) - closes #2092
2023-06-29 08:24:09 -07:00
Simon Willison
c39d600aef
Fix all E741 Ambiguous variable name warnings, refs #2090
2023-06-29 08:05:24 -07:00
Simon Willison
dda99fc09f
New View base class ( #2080 )
...
* New View base class, closes #2078
* Use new View subclass for PatternPortfolioView
2023-05-25 17:18:43 -07:00
Simon Willison
b49fa446d6
--cors Access-Control-Max-Age: 3600, closes #2079
2023-05-25 15:05:58 -07:00
Simon Willison
9584879534
Rename callable.py to check_callable.py, refs #2078
2023-05-25 11:49:40 -07:00
Simon Willison
2e43a14da1
datasette.utils.check_callable(obj) - refs #2078
2023-05-25 11:35:34 -07:00
Simon Willison
0b0c5cd7a9
Hopeful fix for Python 3.7 httpx failure, refs #2066
2023-04-26 21:20:38 -07:00
Simon Willison
d97e82df3c
?_extra= support and TableView refactor to table_view
...
* Implemented ?_extra= option for JSON views, refs #262
* New dependency: asyncinject
* Remove now-obsolete TableView class
2023-03-22 15:49:39 -07:00
Simon Willison
25fdbe6b27
use tmpdir instead of isolated_filesystem, refs #2037
...
Should hopefully get tests passing for #2036 too.
2023-03-08 12:33:23 -08:00
Simon Willison
bd39cb4805
Use service-specific image ID for Cloud Run deploys, refs #2036
2023-03-08 12:25:55 -08:00
Simon Willison
1ad92a1d87
datasette install -r requirements.txt, closes #2033
2023-03-06 14:27:30 -08:00