-
-
Notifications
You must be signed in to change notification settings - Fork 702
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
Document (and reconsider design of) Database.execute() and Database.execute_against_connection_in_thread() #685
Comments
Current implementations: datasette/datasette/database.py Lines 103 to 168 in a093c5f
At the very least the method name |
Working with this in simonw/datasette-media#2 made me really want to redesign this API: simonw/datasette-media@be23ec3 |
I'm going to rename |
The API design for the That object encapsulates the returned data, the named columns and whether or not the result was truncated.
The Here's the current class implementation: datasette/datasette/utils/__init__.py Lines 54 to 68 in 0784f2e
|
Maybe all I really want here is to add length and access-by-index methods to the Results class? So I don't have to do Also how about a |
I'm going to add |
I'll write the API documentation first, in a branch. |
I'm not going to do |
Documentation for improved design: https://github.com/simonw/datasette/pull/763/files#diff-87703da03a02e0f8dae01f39abd6250f |
This code should live somewhere other than |
I'll move the code into |
[ Fun aside: I implemented and shipped this entire branch in my browser using the beta of GitHub's new Codespaces ] |
New documentation is live here: https://datasette.readthedocs.io/en/latest/internals.html#database-class |
I'm going to ship a release with just this change purely so I can start depending on it from my in-development https://github.com/simonw/datasette-media plugin. |
Re-opening this ticket because I forgot to document |
Using new .first() method from simonw/datasette#685
In #683 I started a new section of internals documentation covering the
Database
class: https://datasette.readthedocs.io/en/latest/internals.html#database-classI decided not to document
.execute()
and.execute_against_connection_in_thread()
yet because I'm not 100% happy with their API design yet.The text was updated successfully, but these errors were encountered: