mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Display column type in column action menu, closes #993
Also added new documented db.table_column_details() introspection method.
This commit is contained in:
parent
e807c4eac0
commit
5a184a5d21
8 changed files with 103 additions and 28 deletions
|
|
@ -500,6 +500,9 @@ The ``Database`` class also provides properties and methods for introspecting th
|
|||
``await db.table_columns(table)`` - list of strings
|
||||
Names of columns in a specific table.
|
||||
|
||||
``await db.table_column_details(table)`` - list of named tuples
|
||||
Full details of the columns in a specific table. Each column is represented by a ``Column`` named tuple with fields ``cid`` (integer representing the column position), ``name`` (string), ``type`` (string, e.g. ``REAL`` or ``VARCHAR(30)``), ``notnull`` (integer 1 or 0), ``default_value`` (string or None), ``is_pk`` (integer 1 or 0).
|
||||
|
||||
``await db.primary_keys(table)`` - list of strings
|
||||
Names of the columns that are part of the primary key for this table.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue