question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serve all db files in a folder

See original GitHub issue

I tried to get the serve command to serve all the .db files in the /mnt folder but is seems that the server does not refresh the list of files.

In more detail:

  • Starting datasette as a docker container with:
docker run -p 8001:8001 -v `pwd`:/mnt \
    datasetteproject/datasette \
    datasette -p 8001 -h 0.0.0.0 /mnt
  • Datasette correctly serves all the *.db files found in the /mnt folder
  • When the server is running, if I copy a new file in the $PWD folder, Datasette does not seem to see the new files, forcing me to restart Docker.

Is there an option/setting that I overlooked, or is this something missing?

BTW, the --reload setting, although at first glance is what you think you need, does not seem to do anything in regards of seeing all *.db files.

Thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Segerbergcommented, Nov 13, 2021

@glasnt yeah I guess that could be an option. I run datasette on large databases > 75gb and the startup time is a bit slow for me even with -i --inspect-file options. Here’s a quick sketch for a plugin that will reload db’s in a folder that you set for the plugin in metadata.json. If you request /-reload-db new db’s will be added. (You probably want to implement some authentication for this =) )

https://gist.github.com/Segerberg/b96a0e0a5389dce2396497323cda7042

0reactions
glasntcommented, Nov 13, 2021

Would it make sense to run datasette with a fswatch/inotifywait on a folder, then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run all SQL files in a directory
open the folder in Explorer · select all script files · press Shift · right click the selection and select "Copy as path"...
Read more >
Database Files and Filegroups - SQL Server
Learn about database files and how to create filegroups in SQL Server for allocation and administrative purposes. View examples, rules, and ...
Read more >
How to move the system database files in SQL Server - YouTube
Sometimes installation defaults are missed, or storage is added, and you need to move the system database files to a new location.
Read more >
Change default database file and backup paths in SQL ...
Let us go to the default path (/var/opt/mssql/data). Here we can view the content using the 'ls -lrt' command. You can find all...
Read more >
SQL SERVER - Find Current Location of Data and Log File of ...
I often go to that folder and clean up all unnecessary files I have ... do documentation of which files are in being...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found