Wykres commitów

11 Commity (main)

Autor SHA1 Wiadomość Data
Alex Garcia 1d64c9a8da
Add new entrypoint option to --load-extensions. (#1789)
Thanks, @asg017
2022-08-23 11:34:30 -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 1a513ed092 Ignore node_modules 2020-12-31 13:26:37 -08:00
Simon Willison da0b3ce2b7 New run_sanity_checks mechanism, for SpatiLite
Moved VirtualSpatialIndex check into a new mechanism that should allow
us to add further sanity checks in the future.

To test this I've had to commit a binary sample SpatiaLite database to
the repository. I included a build script for creating that database.

Closes #466
2019-05-11 15:55:30 -07:00
Simon Willison ad789eaaea Added some things to .gitignore 2019-05-09 22:28:16 -07:00
Simon Willison 1a6cfcc10f Added a .dockerignore
Figured this would be useful while testing out 03572ae355
2017-11-17 06:18:23 -08:00
Jeff Triplett 06a826c318 🔥 Removes DS_Store (#81)
* 🔥 Removes .DS_Store

Signed-off-by: Jeff Triplett <jeff.triplett@gmail.com>

* ❄️ Adds .DS_Store to gitignore

Signed-off-by: Jeff Triplett <jeff.triplett@gmail.com>
2017-11-13 14:16:54 -08:00
Simon Willison b2372605d6 Implemented multi-db support plus initial URL structure
Refs #24

Fixes #15
2017-10-23 19:00:37 -07:00
Simon Willison 6a0c5de615 ensure_build_metadata() function for metadata
This will be run at compile time - the goal is to generate a build-
metadata.json file with a bunch of useful facts about the databases that could
be expensive to generate at run-time.

Example metadata:

    {
        "flights": {
        "file": "flights.db",
        "tables": {
            "airlines": 6048,
            "airports": 8107,
            "routes": 67663
        },
        "hash": "07d1283e07786b1235bb7041ea445ae103d1571565580a29eab0203c555725fd"
    }

So far we have a sha256 hash of the database file itself, plus a row count for
each table.

Fixes #11
2017-10-23 09:02:40 -07:00
Simon Willison de04d7a854 Initial working proof of concept 2017-10-22 17:41:19 -07:00
Simon Willison ac9d66817d Initial commit 2017-10-22 17:39:03 -07:00