simonw / datasette
Showing 1 of 3 files from the diff.

@@ -64,7 +64,7 @@
Loading
64 64
65 65
# Can replace this with Column from sqlite_utils when I add that dependency
66 66
Column = namedtuple(
67 -
    "Column", ("cid", "name", "type", "notnull", "default_value", "is_pk", "hidden")
67 +
    "Column", ("cid", "name", "type", "notnull", "default_value", "is_pk")
68 68
)
69 69
70 70
@@ -460,11 +460,11 @@
Loading
460 460
    " Figure out primary keys for a table. "
461 461
    table_info_rows = [
462 462
        row
463 -
        for row in conn.execute(f'PRAGMA table_xinfo("{table}")').fetchall()
464 -
        if row["pk"]
463 +
        for row in conn.execute(f'PRAGMA table_info("{table}")').fetchall()
464 +
        if row[-1]
465 465
    ]
466 -
    table_info_rows.sort(key=lambda row: row["pk"])
467 -
    return [str(r["name"]) for r in table_info_rows]
466 +
    table_info_rows.sort(key=lambda row: row[-1])
467 +
    return [str(r[1]) for r in table_info_rows]
468 468
469 469
470 470
def get_outbound_foreign_keys(conn, table):
@@ -572,7 +572,7 @@
Loading
572 572
def table_column_details(conn, table):
573 573
    return [
574 574
        Column(*r)
575 -
        for r in conn.execute(f"PRAGMA table_xinfo({escape_sqlite(table)});").fetchall()
575 +
        for r in conn.execute(f"PRAGMA table_info({escape_sqlite(table)});").fetchall()
576 576
    ]
577 577
578 578
Files Coverage
datasette 91.49%
Project Totals (30 files) 91.49%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        informational: true
6
    patch:
7
      default:
8
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading