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

Datasette doesn't reload when database file changes #431

Closed
psychemedia opened this issue Apr 13, 2019 · 3 comments
Closed

Datasette doesn't reload when database file changes #431

psychemedia opened this issue Apr 13, 2019 · 3 comments

Comments

@psychemedia
Copy link
Contributor

My understanding of the --reload option was that if the database file changed datasette would automatically reload.

I'm running on a Mac and from the datasette UI queries don't seem to be picking up data in a newly changed db (I checked the db timestamp - it certainly updated).

I was also expecting to see some sort of log statement in the datasette logging to say that it had detected a file change and restarted, but don't see anything there?

Will try to check on an Ubuntu box when I get a chance to see if this is a Mac thing.

@psychemedia psychemedia changed the title Datasette reload when database file changes Datasette doesn't reload when database file changes Apr 13, 2019
@simonw
Copy link
Owner

simonw commented Apr 13, 2019

You should be able to see the reload happening in the console logs:

tmp_—_sqlite3_fixtures_db_—_80×25_and_tmp_—_Python_◂_datasette_--reload_fixtures_db_-p_8052_—_154×57_and_datasette_—_python3_7__usr_local_Cellar_pipenv_2018_11_26_libexec_bin_pipenv_shell_▸_bash_—_147×43

I'm doing some work at the moment to handle mutating files MUCH better - #419 - my goal is to have Datasette work against SQLite files that are being updated out-of-the box, and change the current immutable behaviour to be an option rather than the default.

@psychemedia
Copy link
Contributor Author

Hmm... nope... I see an updated timestamp from ls -al on the db but no reload?

@simonw
Copy link
Owner

simonw commented May 2, 2019

Datasette master now treats databases as readonly but NOT immutable. This means you can make changes to those databases from another process and those changes will be instantly reflected in the Datasette interface.

As such, reloading on database change is no longer necessary. Closing this ticket.

@simonw simonw closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants