Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration directory mode does not pick up other file extensions than .db #1646

Closed
dnsos opened this issue Mar 2, 2022 · 3 comments
Closed

Comments

@dnsos
Copy link

dnsos commented Mar 2, 2022

Hello, I've been trying to run Datasette with the configuration directory mode with a structure such as this one:

some-directory/
    example.sqlite3
    another-example.db
    one-more.custom
    [...]

(In my scenario I can't just change the filename extension without other problems arising)

Now databases with the .sqlite3 or the custom filename extension are ignored by Datasette in this case. I'm aware that the docs state that a .db extension is required, but I was wondering if there is a reason for restricting this or any workaround available? When I run datasette example.sqlite3 or datasette one-more.custom the databases are served by Datasette without a problem.

@mustafa0x
Copy link

I'm affected by this as well. Would be nice to be able to pass in an extension, eg --extension=sqlite3.

@simonw
Copy link
Owner

simonw commented Jul 2, 2022

Adding .sqlite3 to this feature makes sense to me.

I don't think it's worth having a --extensión option - it's possible right now to write a Datasette plugin that loads additional databases on startup, there's an example of how to do that in the source code for https://github.com/simonw/datasette-upload-dbs

Here: https://github.com/simonw/datasette-upload-dbs/blob/81510ef4f0004371a3adda18100936b430535cc1/datasette_upload_dbs/__init__.py#L41-L50

@simonw
Copy link
Owner

simonw commented Oct 7, 2022

simonw added a commit that referenced this issue Oct 24, 2022
@simonw simonw mentioned this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants