{"database": "bibliothek", "private": false, "path": "/bibliothek", "size": 212992, "tables": [{"name": "comment", "columns": ["id", "uuid", "copy_id", "body", "created_at", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 0, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "copy", "column": "copy_id", "other_column": "id"}]}, "private": false}, {"name": "copy", "columns": ["id", "uuid", "media_id", "location_id", "ownership", "read_status", "notes", "updated_at", "deleted_at", "rating", "read_at", "progress_page", "progress_chapter"], "primary_keys": ["id"], "count": 133, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "loan", "column": "id", "other_column": "copy_id"}, {"other_table": "comment", "column": "id", "other_column": "copy_id"}, {"other_table": "reading", "column": "id", "other_column": "copy_id"}], "outgoing": [{"other_table": "location", "column": "location_id", "other_column": "id"}, {"other_table": "media", "column": "media_id", "other_column": "id"}]}, "private": false}, {"name": "genre", "columns": ["id", "uuid", "name", "updated_at"], "primary_keys": ["id"], "count": 28, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "media_genre", "column": "id", "other_column": "genre_id"}], "outgoing": []}, "private": false}, {"name": "loan", "columns": ["id", "uuid", "copy_id", "person_id", "direction", "start_date", "due_date", "returned_date", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 3, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "person", "column": "person_id", "other_column": "id"}, {"other_table": "copy", "column": "copy_id", "other_column": "id"}]}, "private": false}, {"name": "location", "columns": ["id", "uuid", "room", "shelf", "slot", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 29, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "copy", "column": "id", "other_column": "location_id"}], "outgoing": []}, "private": false}, {"name": "media", "columns": ["id", "uuid", "media_type", "title", "creator", "barcode", "isbn13", "publisher", "year", "cover_path", "meta_status", "updated_at", "deleted_at", "language", "series", "series_no", "pages", "pages_source"], "primary_keys": ["id"], "count": 137, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "media_genre", "column": "id", "other_column": "media_id"}, {"other_table": "wish", "column": "id", "other_column": "media_id"}, {"other_table": "copy", "column": "id", "other_column": "media_id"}], "outgoing": []}, "private": false}, {"name": "media_genre", "columns": ["media_id", "genre_id"], "primary_keys": ["media_id", "genre_id"], "count": 168, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "genre", "column": "genre_id", "other_column": "id"}, {"other_table": "media", "column": "media_id", "other_column": "id"}]}, "private": false}, {"name": "person", "columns": ["id", "uuid", "name", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 2, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "loan", "column": "id", "other_column": "person_id"}], "outgoing": []}, "private": false}, {"name": "reading", "columns": ["id", "uuid", "copy_id", "state", "started_at", "finished_at", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 45, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "copy", "column": "copy_id", "other_column": "id"}]}, "private": false}, {"name": "wish", "columns": ["id", "uuid", "media_id", "note", "created_at", "updated_at", "deleted_at"], "primary_keys": ["id"], "count": 0, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "media", "column": "media_id", "other_column": "id"}]}, "private": false}, {"name": "setting", "columns": ["key", "value"], "primary_keys": ["key"], "count": 0, "hidden": true, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}], "hidden_count": 1, "views": [], "queries": [{"title": "Regal (Daten f\u00fcr die Regal-Ansicht)", "description_html": "Alle Medien im Haus mit Standort. Bildlich: <a href=\"/regal\">Regal-Ansicht</a>", "sql": "SELECT c.id, m.title, m.creator, m.year, m.publisher, m.media_type AS type, m.pages, m.language, m.isbn13 AS isbn, m.series, m.series_no, m.cover_path AS cover, m.meta_status = 'pending' AS pending, l.room, l.shelf, l.slot, c.read_status AS status, c.ownership, c.rating, c.progress_page AS progress, (SELECT count(*) FROM reading r WHERE r.copy_id = c.id AND r.state = 'finished' AND r.deleted_at IS NULL) AS times_read, (SELECT group_concat(g.name, ', ') FROM media_genre mg JOIN genre g ON g.id = mg.genre_id WHERE mg.media_id = m.id) AS genres, (SELECT ln.direction || '|' || p.name || '|' || coalesce(ln.due_date, '') FROM loan ln JOIN person p ON p.id = ln.person_id WHERE ln.copy_id = c.id AND ln.returned_date IS NULL AND ln.deleted_at IS NULL LIMIT 1) AS loan FROM copy c JOIN media m ON m.id = c.media_id LEFT JOIN location l ON l.id = c.location_id AND l.deleted_at IS NULL WHERE c.deleted_at IS NULL AND m.deleted_at IS NULL AND c.ownership <> 'returned' ORDER BY m.title COLLATE NOCASE", "name": "regal", "private": false}], "allow_execute_sql": true, "query_ms": 10.694323107600212}