mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add new --internal internal.db option, deprecate legacy _internal database
Refs: - #2157 --------- Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
d28f12092d
commit
92b8bf38c0
13 changed files with 108 additions and 90 deletions
|
|
@ -120,7 +120,7 @@ def permission_allowed(datasette, actor, action):
|
|||
assert (
|
||||
2
|
||||
== (
|
||||
await datasette.get_database("_internal").execute("select 1 + 1")
|
||||
await datasette.get_internal_database().execute("select 1 + 1")
|
||||
).first()[0]
|
||||
)
|
||||
if action == "this_is_allowed_async":
|
||||
|
|
@ -142,7 +142,8 @@ def startup(datasette):
|
|||
async def inner():
|
||||
# Run against _internal so tests that use the ds_client fixture
|
||||
# (which has no databases yet on startup) do not fail:
|
||||
result = await datasette.get_database("_internal").execute("select 1 + 1")
|
||||
internal_db = datasette.get_internal_database()
|
||||
result = await internal_db.execute("select 1 + 1")
|
||||
datasette._startup_hook_calculation = result.first()[0]
|
||||
|
||||
return inner
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue