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

WIP implementation of writable canned queries #703

Closed
wants to merge 91 commits into from
Closed

Conversation

simonw
Copy link
Owner

@simonw simonw commented Mar 21, 2020

Refs #698.

@simonw simonw force-pushed the writable-canned branch from c06e180 to b07fd41 Compare April 2, 2020 22:10
@simonw
Copy link
Owner Author

simonw commented Apr 2, 2020

I'm going to split canned queries out from arbitrary queries to make the code easier to follow.

simonw added 2 commits April 27, 2020 15:02
It wasn't adding anything, and it was confusing when run in
conjunction with the new config directory mode from #731
@simonw
Copy link
Owner Author

simonw commented Apr 29, 2020

Adding some still-to-do items to a checklist in the description.

write_ok = await self.ds.databases[database].execute_write(
sql, params, block=True
)
return self.redirect(request, request.path + '?_success=Query+executed_successfully')
Copy link
Owner Author

@simonw simonw Apr 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing ?_success like this isn't necessarily the best approach. Potential improvements include:

  • Signing this message so it can't be tampered with (I could generate a signing secret on startup)
  • Using a cookie with a temporary flash message in it instead
  • Using HTML5 history API to remove the ?_success= from the URL bar when the user lands on the page

If I add an option to redirect the user to another page after success I may need a mechanism to show a flash message on that page as well, in which case I'll need a general flash message solution that works for any page.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could add itsdangerous as a signing dependency, which delightfully has zero dependencies of its own: https://pypi.org/project/itsdangerous

simonw and others added 22 commits April 30, 2020 11:31
Also documented ?_searchmode=raw - closes #748
Refs #754

Updates the requirements on [aiofiles](https://github.com/Tinche/aiofiles) to permit the latest version.
- [Release notes](https://github.com/Tinche/aiofiles/releases)
- [Commits](Tinche/aiofiles@v0.4.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Updates the requirements on [mergedeep](https://github.com/clarketm/mergedeep) to permit the latest version.
- [Release notes](https://github.com/clarketm/mergedeep/releases)
- [Commits](clarketm/mergedeep@v1.1.1...v1.3.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Updates the requirements on [janus](https://github.com/aio-libs/janus) to permit the latest version.
- [Release notes](https://github.com/aio-libs/janus/releases)
- [Changelog](https://github.com/aio-libs/janus/blob/master/CHANGES.rst)
- [Commits](aio-libs/janus@v0.4.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Updates the requirements on [jinja2](https://github.com/pallets/jinja) to permit the latest version.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](pallets/jinja@2.10.3...2.11.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.2.2...5.4.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
The ASGI spec
(https://asgi.readthedocs.io/en/latest/specs/www.html#http) seems to
imply that `None` is a valid value, so we need to check the value
itself, not just whether the key is present.

In particular, the [mangum](https://github.com/erm/mangum) adapter
passes `None` for this key.
Updates the requirements on [beautifulsoup4](http://www.crummy.com/software/BeautifulSoup/bs4/) to permit the latest version.

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Updates the requirements on [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.10.0...v0.12.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Less intimidating than Docker, hopefully.
Simplifies things now that we also talk about pipx.
simonw added 19 commits May 30, 2020 07:38
Request is more useful to most people than Database.
It duplicated the functionality of db.foreign_keys_for_table.
Also added datasette argument to permission_allowed hook
Also added JSON highlighting to introspection documentation.
Also started the authentication.rst docs page, refs #786.

Part of authentication work, refs #699.
@simonw simonw mentioned this pull request Jun 1, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 2, 2020

This pull request got too messy. I'm going to abandon this and start a new one.

@simonw simonw closed this Jun 2, 2020
simonw added a commit that referenced this pull request Jun 3, 2020
simonw added a commit that referenced this pull request Jun 3, 2020
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

Successfully merging this pull request may close these issues.

2 participants