Simon Willison

Results 2427 comments of Simon Willison

How about if `Permission` looked like this instead? ```python class Permission: name: str abbr: Optional[str] description: Optional[str] resources: Tuple[str, ...] ``` Then a permission might look like this: ```python Permission(...

Maybe a `register_resource_types()` plugin hook is called for here?

I like the idea of registering resource classes - maybe with a naming convention like `DatabaseResource` etc to differentiate from existing `Database` class. Then could do this: ```python Permission( name="view-table",...

I fixed this in Datasette 1.0a20. A `resource` is now a `TableResource` or `DatabaseResource` or `QueryResource` or a new subclass of `datasette.resources.Resource` that is defined by a plugin.

Maybe fix this bug first: - https://github.com/simonw/datasette-remote-metadata/issues/6

I'm going to create a minimal `sqlite-vec` database to commit to our repo for the tests.

Creating it with `sqlite-utils`: ```bash sqlite-utils install sqlite-utils-sqlite-vec echo '{"point": "[1,2,3]"}' | sqlite-utils insert vec.db vectors - sqlite-utils vec.db 'create virtual table vec_vectors using vec0(point float[3]);' sqlite-utils vec.db 'insert into...

This conflicts slightly with Datasette's existing design with respect to SpatiaLite: currently Datasette shows you a useful error if you try to load a SpatiaLite database without activating the extension:...

One solution: turn this into a warning that gets dumped to the console but Datasette still starts up as usual. Could even expand that a bit, so it knows a...

Relevant code: https://github.com/simonw/datasette/blob/05dfd34fd0dff34b64fb47e0dd1716c8bdbddfac/datasette/cli.py#L791-L825 Which runs `check_connection()`: https://github.com/simonw/datasette/blob/05dfd34fd0dff34b64fb47e0dd1716c8bdbddfac/datasette/utils/__init__.py#L965-L981