Wykres commitów

110 Commity (b49fa446d683ddcaf6faf2944dacc0d866bf2d70)

Autor SHA1 Wiadomość Data
Simon Willison b49fa446d6 --cors Access-Control-Max-Age: 3600, closes #2079 2023-05-25 15:05:58 -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 f0fadc28dd Access-Control-Allow-Headers: Authorization, Content-Type - refs #1922 2022-11-30 15:11:18 -08:00
Simon Willison 6bfd71f5c6 Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS - refs #1922 2022-11-30 12:25:12 -08:00
Simon Willison ee64130fa8 Refactor to use new resolve_database/table/row methods, refs #1896 2022-11-18 14:46:25 -08:00
Simon Willison b597bb6b3e Better comment handling in SQL regex, refs #1860 2022-10-27 11:52:06 -07:00
Simon Willison af5d5d0243 Allow leading comments on SQL queries, refs #1860 2022-10-26 20:14:59 -07:00
Simon Willison 02ae1a0029 Upgrade Docker images to Python 3.11, closes #1853 2022-10-25 12:04:25 -07:00
Simon Willison d0737e4de5 truncate_cells_html now affects URLs too, refs #1805 2022-09-06 16:50:43 -07:00
Simon Willison fd1086c686 Applied Black, refs #1789 2022-08-23 11:35:41 -07:00
Alex Garcia 1d64c9a8da
Add new entrypoint option to --load-extensions. (#1789)
Thanks, @asg017
2022-08-23 11:34:30 -07:00
Simon Willison 080d4b3e06 Switch to python:3.10.6-slim-bullseye for datasette publish - refs #1768 2022-08-14 08:49:14 -07:00
Simon Willison 143c105f87 Removed rogue print 2022-04-12 11:43:32 -07:00
Simon Willison 90d1be9952 Tilde encoding now encodes space as plus, closes #1701
Refs #1657
2022-04-06 08:55:01 -07:00
Simon Willison 72bfd75fb7 Drop n=1 threshold down to <= 20ms, closes #1679 2022-03-21 14:55:50 -07:00
Simon Willison 1a7750eb29 Documented datasette.check_visibility() method, closes #1678 2022-03-21 12:01:37 -07:00
Simon Willison 798f075ef9 Read format from route captures, closes #1667
Refs #1660
2022-03-19 13:32:29 -07:00
Simon Willison 711767bcd3 Refactored URL routing to add tests, closes #1666
Refs #1660
2022-03-18 21:03:08 -07:00
Simon Willison a35393b29c
Tilde encoding (#1659)
Closes #1657

Refs #1439
2022-03-15 11:01:57 -07:00
Simon Willison 77e718c3ff Revert "Fix bug with percentage redirects, close #1650"
This reverts commit c85d669de3.

Refs #1658
2022-03-15 08:37:31 -07:00
Simon Willison c85d669de3 Fix bug with percentage redirects, close #1650 2022-03-07 11:26:08 -08:00
Simon Willison 1baa030eca
Switch to dash encoding for table/database/row-pk in paths
* Dash encoding functions, tests and docs, refs #1439
* dash encoding is now like percent encoding but with dashes
* Use dash-encoding for row PKs and ?_next=, refs #1439
* Use dash encoding for table names, refs #1439
* Use dash encoding for database names, too, refs #1439

See also https://simonwillison.net/2022/Mar/5/dash-encoding/
2022-03-07 07:38:29 -08:00
Dan Peterson de810f49cc
Add /opt/homebrew to where spatialite extension can be found (#1649)
Helps homebrew on Apple Silicon setups find spatialite without needing
a full path.

Similar to #1114

Thanks, @danp
2022-03-06 11:39:15 -08:00
Simon Willison 458f03ad3a More SpatiaLite details on /-/versions, closes #1607 2022-02-08 22:32:19 -08:00
Simon Willison d9b508ffaa @documented decorator plus unit test plus sphinx.ext.autodoc
New mechanism for marking datasette.utils functions that should be covered by the
documentation, then testing that they have indeed been documented.

Also enabled sphinx.ext.autodoc which can now be used to embed the documented
versions of those functions.

Refs #1176
2022-02-06 22:31:06 -08:00
Simon Willison 3ef47a0896 Link rel=alternate header for tables and rows
Also added Access-Control-Expose-Headers: Link to --cors mode.

Closes #1533

Refs https://github.com/simonw/datasette-notebook/issues/2

LL#	metadata.json.1
2022-02-01 23:49:09 -08:00
Simon Willison 63537dd3de Allow 'explain query plan' with more whitespace, closes #1588 2022-01-13 12:34:55 -08:00
Simon Willison 8584993529 --cors Access-Control-Allow-Headers: Authorization
Refs #1467, refs https://github.com/simonw/datasette-auth-tokens/issues/4
2021-10-14 12:03:28 -07:00
Simon Willison 0d5cc20aef Revert "asyncio_run helper to deal with a 3.10 warning, refs #1482"
This reverts commit 98dcabccbb.
2021-10-09 18:25:33 -07:00
Simon Willison 98dcabccbb asyncio_run helper to deal with a 3.10 warning, refs #1482 2021-10-08 17:32:11 -07:00
Simon Willison b1fed48a95 derive_named_parameters falls back to regex on SQL error, refs #1421 2021-08-08 20:26:08 -07:00
Simon Willison fc4846850f New way of deriving named parameters using explain, refs #1421 2021-08-08 20:21:13 -07:00
Simon Willison dd5ee8e668 Removed some unused imports
I found these with:

    flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Brandon Roberts baf986c871
New get_metadata() plugin hook for dynamic metadata
The following hook is added:

    get_metadata(
      datasette=self, key=key, database=database, table=table,
      fallback=fallback
    )

This gets called when we're building our metdata for the rest
of the system to use. We merge whatever the plugins return
with any local metadata (from metadata.yml/yaml/json) allowing
for a live-editable dynamic Datasette.

As a security precation, local meta is *not* overwritable by
plugin hooks. The workflow for transitioning to live-meta would
be to load the plugin with the full metadata.yaml and save.
Then remove the parts of the metadata that you want to be able
to change from the file.

* Avoid race condition: don't mutate databases list

This avoids the nasty "RuntimeError: OrderedDict mutated during
iteration" error that randomly happens when a plugin adds a
new database to Datasette, using `add_database`. This change
makes the add and remove database functions more expensive, but
it prevents the random explosion race conditions that make for
confusing user experience when importing live databases.

Thanks, @brandonrobertz
2021-06-26 15:24:54 -07:00
Simon Willison 0f1e47287c Fixed bug with detect_fts for table with single quote in name, closes #1257 2021-06-01 20:27:04 -07:00
Simon Willison d1d06ace49 ?_trac=1 for CSV, plus ?_nofacets=1 when rendering CSV
Closes #1351, closes #1350
2021-06-01 08:49:50 -07:00
Konstantin Baikov 8e18c79431
Use context manager instead of plain open (#1211)
Context manager with open closes the files after usage.

When the object is already a pathlib.Path i used read_text
write_text functions

In some cases pathlib.Path.open were used in context manager,
it is basically the same as builtin open.

Thanks, Konstantin Baikov!
2021-03-11 08:15:49 -08:00
Simon Willison 640ac7071b Better PRAGMA error message, closes #1185 2021-01-12 14:26:19 -08:00
Miroslav Šedivý a882d67962
Modernize code to Python 3.6+ (#1158)
* Compact dict and set building
* Remove redundant parentheses
* Simplify chained conditions
* Change method name to lowercase
* Use triple double quotes for docstrings

Thanks, @eumiro!
2020-12-23 09:04:32 -08:00
Simon Willison 810853c5f2 Use time.perf_counter() instead of time.time(), closes #1157 2020-12-21 13:49:14 -08:00
Simon Willison dcdfb2c301 Rename _schemas to _internal, closes #1156 2020-12-21 11:48:06 -08:00
Simon Willison ebc7aa287c In-memory _schemas database tracking schemas of attached tables, closes #1150 2020-12-18 14:34:05 -08:00
Simon Willison 17cbbb1f7f
generated_columns table in fixtures.py, closes #1119 2020-11-30 16:28:02 -08:00
Simon Willison 461670a0b8
Support for generated columns
* Support for generated columns, closes #1116
* Show SQLite version in pytest report header
* Use table_info() if SQLite < 3.26.0
* Cache sqlite_version() rather than re-calculate every time
* Adjust test_database_page for SQLite 3.26.0 or higher
2020-11-30 13:29:57 -08:00
Simon Willison dea3c508b3 Revert "Support for generated columns, closes #1116" - it failed CI
This reverts commit 37f87b5e52.
2020-11-30 12:09:32 -08:00
Simon Willison 37f87b5e52 Support for generated columns, closes #1116 2020-11-30 12:01:15 -08:00
Simon Willison deb0be4ae5 Fix bug where compound foreign keys produced broken links, closes #1098 2020-11-29 11:30:17 -08:00
Simon Willison e800ffcf7c
/usr/local/lib/mod_spatialite.so
Closes #1114
2020-11-29 09:37:43 -08:00
Simon Willison 37d18a5bce datasette publish cloudrun --apt-get-install, closes #1110 2020-11-24 19:05:35 -08:00
Simon Willison 33eadb8782 config.json is now settings.json, closes #1104 2020-11-24 12:37:29 -08:00