databases icon indicating copy to clipboard operation
databases copied to clipboard

Expand documentation

Open lovelydinosaur opened this issue 6 years ago • 6 comments

In particular:

  • More examples of queries.
  • Examples of using JSON field.
  • Examples with joining tables.
  • Getting PK of inserted rows.
  • Properly document return types of the databases API.

lovelydinosaur avatar Feb 28 '19 13:02 lovelydinosaur

See also #31

lovelydinosaur avatar Feb 28 '19 13:02 lovelydinosaur

Getting PK of inserted rows.

Is this currently possible?

mivade avatar Sep 06 '19 21:09 mivade

Digging into the code, it looks like it is in the same way as with SQLAlchemy (i.e., it gets returned when calling execute on an insert statement). Unfortunately this doesn't always return the primary key though. For example, with SQLite, the last "rowid" gets returned which corresponds to an integer primary key (in cases where the primary key is an integer) or the "undeclared" ROWID column: https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.lastrowid

mivade avatar Sep 06 '19 22:09 mivade

Hey everyone, I am using databases for two of my products and would like to work on the documentation issue. I see this is still open. Since this GitHub issue is very old I would like to know if the issue points are still valid. I will go through the documentation again today just to double check. Any pointers would be helpful as I am a bit hesitant to contribute to such an important project. Thanks

brainless avatar Apr 19 '21 06:04 brainless

@brainless would be great tbh, currently stuck with joining tables :)

hp0404 avatar Jul 11 '21 18:07 hp0404

Is there any update on this? This is a pretty good async library, but lack of documentation (+ generic name) makes it difficult to find/google anything complex..

Pk13055 avatar Dec 30 '22 21:12 Pk13055