{"database": "canalmidi", "private": false, "path": "/canalmidi", "size": 16384, "tables": [{"name": "locks", "columns": ["id", "pk", "number", "name", "type", "count", "depth"], "primary_keys": ["id"], "count": 62, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "ports", "columns": ["id", "pk", "name", "options"], "primary_keys": [], "count": 7, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}], "hidden_count": 0, "views": [{"name": "_LOCKS", "private": false}], "queries": [{"title": "Lock details", "sql": "select pk, number, name, type, count, depth, 'Distance to ' || lag(name) over ( order by number asc ) || ': ' || round( ( pk - nullif( lag(                                pk) over ( order by number asc ), 0.0 ) ), 2 ) as distance_previous, 'Distance to ' || lead(name) over ( order by number asc ) || ': ' || round( ( nullif( le                                ad(pk) over ( order by number asc ), 0.0 ) - pk ), 2 ) as distance_next from locks where pk between :minpk and :maxpk", "hide_sql": true, "name": "locks_detail_between", "private": false}, {"title": "Lock stats", "sql": "select count(1) as groups_number, sum( count ) as locks_number, ( count(1) * 5 ) as groups_duration, ( sum( count ) * 10 ) as locks_duratio                                n, ( count(1) * 5 ) + ( sum( count ) * 10 ) as total_duration, min( depth ) || ' - ' || max( depth ) as span_depth, avg( depth ) as average_depth, sum( depth                                 ) total_depth from locks where pk between :minpk and :maxpk", "hide_sql": true, "name": "locks_stats_between", "private": false}], "allow_execute_sql": true, "query_ms": 3.2951029716059566}