Simplify query! string literals
This commit is contained in:
parent
7d80ba4a6b
commit
7a6984aedc
36 changed files with 312 additions and 312 deletions
12
.sqlx/query-09c34c5cef41d9833c345c8447d35a975a4b76dd2c7b3ad169674e3a6acf6862.json
generated
Normal file
12
.sqlx/query-09c34c5cef41d9833c345c8447d35a975a4b76dd2c7b3ad169674e3a6acf6862.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT INTO run_output (\n id,\n line,\n source,\n text\n )\n VALUES (?, ?, ?, ?)\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "09c34c5cef41d9833c345c8447d35a975a4b76dd2c7b3ad169674e3a6acf6862"
|
||||
}
|
||||
12
.sqlx/query-11b41ecfe4b4eae5f36d1c033f831220f9103168bfdce0fa3a676b0ec12b9d11.json
generated
Normal file
12
.sqlx/query-11b41ecfe4b4eae5f36d1c033f831220f9103168bfdce0fa3a676b0ec12b9d11.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT OR IGNORE INTO queue (hash, date, priority)\n SELECT hash, ?, ?\n FROM commits\n LEFT JOIN runs USING (hash)\n WHERE reachable = ? AND id IS NULL\n ORDER BY unixepoch(committer_date) DESC\n LIMIT ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "11b41ecfe4b4eae5f36d1c033f831220f9103168bfdce0fa3a676b0ec12b9d11"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT source, text FROM run_output WHERE id = ? ORDER BY line ASC ",
|
||||
"query": "\n SELECT source, text FROM run_output\n WHERE id = ?\n ORDER BY line ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -22,5 +22,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "bf7e8565a6ddea9d894fbeef3c9e7ed5e71893b920f5f36e80a5e2ed65cc9bb9"
|
||||
"hash": "14dc7ea3da2200eddf0e9087594180f71c52d2107823066681e29bc2711e911f"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT OR IGNORE INTO queue (hash, date, priority) SELECT hash, ?, ? FROM commits LEFT JOIN runs USING (hash) WHERE reachable = ? AND id IS NULL ORDER BY unixepoch(committer_date) DESC LIMIT ? ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "1b572ecd6904a13d78070bc6aeef3a4f349baa5b880aaa1d141b516a34517b4b"
|
||||
}
|
||||
12
.sqlx/query-1d1807ce05adb453b5cfef85cff930e974faa9455e7114a1555d78f2d1911898.json
generated
Normal file
12
.sqlx/query-1d1807ce05adb453b5cfef85cff930e974faa9455e7114a1555d78f2d1911898.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT INTO queue (hash, date, priority) VALUES (?, ?, ?)\n ON CONFLICT (hash) DO UPDATE\n SET priority = excluded.priority WHERE priority < excluded.priority\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "1d1807ce05adb453b5cfef85cff930e974faa9455e7114a1555d78f2d1911898"
|
||||
}
|
||||
12
.sqlx/query-25e9bf1ca16d2ad13900bfbc8908531139b00e341dfa392a9d5136bc180559ac.json
generated
Normal file
12
.sqlx/query-25e9bf1ca16d2ad13900bfbc8908531139b00e341dfa392a9d5136bc180559ac.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT INTO run_measurements (\n id,\n metric,\n value,\n unit\n )\n VALUES (?, ?, ?, ?)\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "25e9bf1ca16d2ad13900bfbc8908531139b00e341dfa392a9d5136bc180559ac"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO refs (name, hash) VALUES (?, ?) ON CONFLICT (name) DO UPDATE SET hash = excluded.hash ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "3204ae1d17471bf90a056119f164dd4f42670801bd647fb962f0ba8de37b050e"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT metric, value, unit FROM run_measurements WHERE id = ? ORDER BY metric ASC ",
|
||||
"query": "\n SELECT\n metric,\n value,\n unit\n FROM run_measurements\n WHERE id = ?\n ORDER BY metric ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
true
|
||||
]
|
||||
},
|
||||
"hash": "185c3516e116876f1783f25ffeb179ca6ecb4f9a001a48127516a81b7a50062a"
|
||||
"hash": "37d23c0a75a66e41fbdc1f26e166a03a685532e5193b0c0ea330157b4334ab4e"
|
||||
}
|
||||
12
.sqlx/query-4b91b7c764b114b401bfe3bff116fc82b21181217463211eec79f92bdc31d687.json
generated
Normal file
12
.sqlx/query-4b91b7c764b114b401bfe3bff116fc82b21181217463211eec79f92bdc31d687.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT OR IGNORE INTO commits (\n hash,\n author,\n author_date,\n committer,\n committer_date,\n message\n )\n VALUES (?, ?, ?, ?, ?, ?)\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "4b91b7c764b114b401bfe3bff116fc82b21181217463211eec79f92bdc31d687"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT child, parent FROM commit_edges JOIN commits ON hash = child WHERE reachable = ? ORDER BY hash ASC ",
|
||||
"query": "\n SELECT child, parent\n FROM commit_edges\n JOIN commits ON hash = child\n WHERE reachable = ?\n ORDER BY hash ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -22,5 +22,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "ba09c191e2a83d4398b26888f041c93095ba82693b0b9c2c2eebd65078f7d168"
|
||||
"hash": "7520b53b64047c62443d415bdf37b875dc4f75a4c953f82aa72c1e42de53e8d2"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "WITH RECURSIVE tracked (hash) AS ( SELECT hash FROM refs WHERE tracked UNION SELECT parent FROM commit_edges JOIN tracked ON hash = child ), reachable (hash) AS ( SELECT hash FROM refs UNION SELECT hash FROM tracked UNION SELECT parent FROM commit_edges JOIN reachable ON hash = child ) UPDATE commits SET reachable = CASE WHEN hash IN tracked THEN ? WHEN hash IN reachable THEN ? ELSE ? END ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "7808509e5f7d1c7e8138ff9e124ab3b1784a05ac771778ff8e503ae20d319c08"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO runs ( id, hash, bench_method, worker_name, worker_info, start, end, exit_code ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 8
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "7af4a1edc6f7cf718fee6562c8c6fb5eaa63a4965082f3c54390ee71e4dd3a15"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, author, message, committer_date AS \"committer_date: OffsetDateTime\" FROM commits WHERE reachable = ? ORDER BY hash ASC ",
|
||||
"query": "\n SELECT\n hash,\n author,\n message,\n committer_date AS \"committer_date: OffsetDateTime\"\n FROM commits\n WHERE reachable = ?\n ORDER BY hash ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -34,5 +34,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "2d4ddb045e286955334793d7610f1f1ee1d7d825031b003db6117231a16d2f50"
|
||||
"hash": "7bdc8131149c3ea2a905e9eba48afaf0ee56f280456879c34b7b1528fd9c8024"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id, start AS \"start: time::OffsetDateTime\" FROM runs WHERE hash = ? ",
|
||||
"query": "\n SELECT\n id,\n start AS \"start: time::OffsetDateTime\"\n FROM runs WHERE hash = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -22,5 +22,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "b43ea10c6fd75dfe251c3dc3001649a13b9893722b23c2bbcec1f015e57b5613"
|
||||
"hash": "808b4cccd8740d62cf860782be780a54e5724c38ce415f852e36e2607e3266f2"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT name, hash, message, reachable AS \"reachable: Reachable\", tracked FROM refs JOIN commits USING (hash) ORDER BY name ASC ",
|
||||
"query": "\n SELECT\n name,\n hash,\n message,\n reachable AS \"reachable: Reachable\",\n tracked\n FROM refs\n JOIN commits USING (hash)\n ORDER BY name ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -40,5 +40,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "1df8ec0b41dbafe191f6990d6be6f6f3c9d86ea9ca8112f16b5735b1193ea243"
|
||||
"hash": "8e1df6095d9c9778e02331e1e1b332ab5fb111c1fc32c5e2f2d6d068b38ff98b"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO run_measurements ( id, metric, value, unit ) VALUES (?, ?, ?, ?) ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "8fa4d1546e559bca47e2fb765ee33b989271492395b43c1887db7d490d9dff8d"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, author, author_date AS \"author_date: time::OffsetDateTime\", committer, committer_date AS \"committer_date: time::OffsetDateTime\", message, reachable AS \"reachable: Reachable\" FROM commits WHERE hash = ? ",
|
||||
"query": "\n SELECT\n hash,\n author,\n author_date AS \"author_date: time::OffsetDateTime\",\n committer,\n committer_date AS \"committer_date: time::OffsetDateTime\",\n message,\n reachable AS \"reachable: Reachable\"\n FROM commits\n WHERE hash = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -52,5 +52,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "c75001269238285e4de8d609a404b7249df61711324b3cae4c21b74b0875100d"
|
||||
"hash": "9ffcba9ec91ee686072b0c06b59d6bbcb59e36c51141ca5ea57ea69c21ba119b"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO queue (hash, date, priority) VALUES (?, ?, ?) ON CONFLICT (hash) DO UPDATE SET priority = excluded.priority WHERE priority < excluded.priority ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "aaf84d58ad3670609cf7cb28243a242829f0b5a65e39e98070664533621bc4c2"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable AS \"reachable: Reachable\", date AS \"date: time::OffsetDateTime\", priority FROM queue JOIN commits USING (hash) ORDER BY priority DESC, unixepoch(date) DESC, hash ASC ",
|
||||
"query": "\n SELECT\n hash,\n message,\n reachable AS \"reachable: Reachable\",\n date AS \"date: time::OffsetDateTime\",\n priority\n FROM queue\n JOIN commits USING (hash)\n ORDER BY priority DESC, unixepoch(date) DESC, hash ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -40,5 +40,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "5da81c9c9875bf4fd4e894ca54be65aee3d76a26c12feb1e4f25e9f482cd153e"
|
||||
"hash": "af399d06762680bbb967bd4665444a816f936e59e89b4042931de82054a2c067"
|
||||
}
|
||||
12
.sqlx/query-b4afdd25b99339034c6c662d16119741d75776ca1a18ee7aaa5be73a2b3455e3.json
generated
Normal file
12
.sqlx/query-b4afdd25b99339034c6c662d16119741d75776ca1a18ee7aaa5be73a2b3455e3.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT INTO refs (name, hash) VALUES (?, ?)\n ON CONFLICT (name) DO UPDATE\n SET hash = excluded.hash\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "b4afdd25b99339034c6c662d16119741d75776ca1a18ee7aaa5be73a2b3455e3"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO run_output ( id, line, source, text ) VALUES (?, ?, ?, ?) ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "c12f5a469c6ad64bcc01f6a095f27f703dba6e519e8e218bffac81c9b8b45b95"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id, hash, bench_method, start AS \"start: time::OffsetDateTime\", end AS \"end: time::OffsetDateTime\", exit_code, message, reachable AS \"reachable: Reachable\" FROM runs JOIN commits USING (hash) WHERE id = ? ",
|
||||
"query": "\n SELECT\n id,\n hash,\n bench_method,\n start AS \"start: time::OffsetDateTime\",\n end AS \"end: time::OffsetDateTime\",\n exit_code,\n message,\n reachable AS \"reachable: Reachable\"\n FROM runs\n JOIN commits USING (hash)\n WHERE id = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -58,5 +58,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "daae5a05af0e8a511f5099820da2ccbeebb577935786fdb1a235d0315bc5a433"
|
||||
"hash": "c1db3ac0f29ccf740eb4a798f00d6e2ecba3aa0239462e71dc8d23e405378ed0"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable AS \"reachable: Reachable\" FROM commits JOIN commit_edges ON hash = parent WHERE child = ? ORDER BY reachable DESC, unixepoch(committer_date) ASC ",
|
||||
"query": "\n SELECT\n hash,\n message,\n reachable AS \"reachable: Reachable\"\n FROM commits\n JOIN queue USING (hash)\n WHERE hash = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "595f95ecdafb7c94bcf4cc81222e207079e2da3779a1ce3c8b5833e335faf130"
|
||||
"hash": "cdc415297929fc696b8633bac5e12e6e3be1fd0dfcf188d0b778ebea92bf4a36"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable AS \"reachable: Reachable\" FROM commits JOIN commit_edges ON hash = child WHERE parent = ? ORDER BY reachable DESC, unixepoch(committer_date) ASC ",
|
||||
"query": "\n SELECT\n hash,\n message,\n reachable AS \"reachable: Reachable\"\n FROM commits\n JOIN commit_edges ON hash = parent\n WHERE child = ?\n ORDER BY reachable DESC, unixepoch(committer_date) ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "3edd8ce2a6fbb36433684d259d073cca1df369461ae8e0c357ebaba2e08186e5"
|
||||
"hash": "db4d8d84fe3f77b35fc9bfc6a8a154cfcd860bf6b73a534cc0c353b306d88b24"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT OR IGNORE INTO commits ( hash, author, author_date, committer, committer_date, message ) VALUES (?, ?, ?, ?, ?, ?) ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e2cffac014ee500f62b785172b5c115a3c504ac7d1df072dfba25ad0ac33702b"
|
||||
}
|
||||
12
.sqlx/query-e857ba884436ab28677883a78b8244d07fefc5160182b2ba1bd53f879c596948.json
generated
Normal file
12
.sqlx/query-e857ba884436ab28677883a78b8244d07fefc5160182b2ba1bd53f879c596948.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n INSERT INTO runs (\n id,\n hash,\n bench_method,\n worker_name,\n worker_info,\n start,\n end,\n exit_code\n )\n VALUES (?, ?, ?, ?, ?, ?, ?, ?)\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 8
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e857ba884436ab28677883a78b8244d07fefc5160182b2ba1bd53f879c596948"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable AS \"reachable: Reachable\" FROM commits JOIN queue USING (hash) WHERE hash = ? ",
|
||||
"query": "\n SELECT\n hash,\n message,\n reachable AS \"reachable: Reachable\"\n FROM commits\n JOIN commit_edges ON hash = child\n WHERE parent = ?\n ORDER BY reachable DESC, unixepoch(committer_date) ASC\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "dcd37f22be87b31a7edaba2c4225d3ddfb9802c532102036e1d2ec3cd1adc51f"
|
||||
"hash": "eb518fcc6d033f05fa6c679b93566b140a548b8695ea698a5cfaa9a6be6451c5"
|
||||
}
|
||||
12
.sqlx/query-f5c0c5d1fc0b1eaf3fd18614c6abd5c261b130e3af0ce0a67780203ec12aefdd.json
generated
Normal file
12
.sqlx/query-f5c0c5d1fc0b1eaf3fd18614c6abd5c261b130e3af0ce0a67780203ec12aefdd.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n WITH RECURSIVE\n tracked (hash) AS (\n SELECT hash FROM refs WHERE tracked\n UNION\n SELECT parent FROM commit_edges\n JOIN tracked ON hash = child\n ),\n reachable (hash) AS (\n SELECT hash FROM refs\n UNION\n SELECT hash FROM tracked\n UNION\n SELECT parent FROM commit_edges\n JOIN reachable ON hash = child\n )\n UPDATE commits\n SET reachable = CASE\n WHEN hash IN tracked THEN ?\n WHEN hash IN reachable THEN ?\n ELSE ?\n END\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "f5c0c5d1fc0b1eaf3fd18614c6abd5c261b130e3af0ce0a67780203ec12aefdd"
|
||||
}
|
||||
|
|
@ -91,23 +91,23 @@ async fn insert_new_commits(
|
|||
let message = commit.message_raw()?.to_string();
|
||||
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT OR IGNORE INTO commits ( \
|
||||
hash, \
|
||||
author, \
|
||||
author_date, \
|
||||
committer, \
|
||||
committer_date, \
|
||||
message \
|
||||
) \
|
||||
VALUES (?, ?, ?, ?, ?, ?) \
|
||||
"
|
||||
INSERT OR IGNORE INTO commits (
|
||||
hash,
|
||||
author,
|
||||
author_date,
|
||||
committer,
|
||||
committer_date,
|
||||
message
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
",
|
||||
hash,
|
||||
author,
|
||||
author_date,
|
||||
committer,
|
||||
committer_date,
|
||||
message
|
||||
message,
|
||||
)
|
||||
.execute(&mut *conn)
|
||||
.await?;
|
||||
|
|
@ -182,13 +182,13 @@ async fn update_refs(conn: &mut SqliteConnection, refs: Vec<Reference>) -> someh
|
|||
let hash = hash.to_string();
|
||||
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT INTO refs (name, hash) VALUES (?, ?) \
|
||||
ON CONFLICT (name) DO UPDATE \
|
||||
SET hash = excluded.hash \
|
||||
"
|
||||
INSERT INTO refs (name, hash) VALUES (?, ?)
|
||||
ON CONFLICT (name) DO UPDATE
|
||||
SET hash = excluded.hash
|
||||
",
|
||||
name,
|
||||
hash
|
||||
hash,
|
||||
)
|
||||
.execute(&mut *conn)
|
||||
.await?;
|
||||
|
|
@ -210,28 +210,28 @@ async fn track_main_branch(conn: &mut SqliteConnection, repo: &Repository) -> so
|
|||
|
||||
async fn update_commit_tracked_status(conn: &mut SqliteConnection) -> somehow::Result<()> {
|
||||
sqlx::query!(
|
||||
"\
|
||||
WITH RECURSIVE \
|
||||
tracked (hash) AS ( \
|
||||
SELECT hash FROM refs WHERE tracked \
|
||||
UNION \
|
||||
SELECT parent FROM commit_edges \
|
||||
JOIN tracked ON hash = child \
|
||||
), \
|
||||
reachable (hash) AS ( \
|
||||
SELECT hash FROM refs \
|
||||
UNION \
|
||||
SELECT hash FROM tracked \
|
||||
UNION \
|
||||
SELECT parent FROM commit_edges \
|
||||
JOIN reachable ON hash = child \
|
||||
) \
|
||||
UPDATE commits \
|
||||
SET reachable = CASE \
|
||||
WHEN hash IN tracked THEN ? \
|
||||
WHEN hash IN reachable THEN ? \
|
||||
ELSE ? \
|
||||
END \
|
||||
"
|
||||
WITH RECURSIVE
|
||||
tracked (hash) AS (
|
||||
SELECT hash FROM refs WHERE tracked
|
||||
UNION
|
||||
SELECT parent FROM commit_edges
|
||||
JOIN tracked ON hash = child
|
||||
),
|
||||
reachable (hash) AS (
|
||||
SELECT hash FROM refs
|
||||
UNION
|
||||
SELECT hash FROM tracked
|
||||
UNION
|
||||
SELECT parent FROM commit_edges
|
||||
JOIN reachable ON hash = child
|
||||
)
|
||||
UPDATE commits
|
||||
SET reachable = CASE
|
||||
WHEN hash IN tracked THEN ?
|
||||
WHEN hash IN reachable THEN ?
|
||||
ELSE ?
|
||||
END
|
||||
",
|
||||
Reachable::FromTrackedRef,
|
||||
Reachable::FromAnyRef,
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ pub async fn post_admin_queue_add(
|
|||
) -> somehow::Result<impl IntoResponse> {
|
||||
let date = OffsetDateTime::now_utc();
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT INTO queue (hash, date, priority) VALUES (?, ?, ?) \
|
||||
ON CONFLICT (hash) DO UPDATE \
|
||||
SET priority = excluded.priority WHERE priority < excluded.priority \
|
||||
"
|
||||
INSERT INTO queue (hash, date, priority) VALUES (?, ?, ?)
|
||||
ON CONFLICT (hash) DO UPDATE
|
||||
SET priority = excluded.priority WHERE priority < excluded.priority
|
||||
",
|
||||
form.hash,
|
||||
date,
|
||||
|
|
@ -71,14 +71,14 @@ pub async fn post_admin_queue_add_batch(
|
|||
) -> somehow::Result<impl IntoResponse> {
|
||||
let date = OffsetDateTime::now_utc();
|
||||
let added = sqlx::query!(
|
||||
"\
|
||||
INSERT OR IGNORE INTO queue (hash, date, priority) \
|
||||
SELECT hash, ?, ? \
|
||||
FROM commits \
|
||||
LEFT JOIN runs USING (hash) \
|
||||
WHERE reachable = ? AND id IS NULL \
|
||||
ORDER BY unixepoch(committer_date) DESC \
|
||||
LIMIT ? \
|
||||
"
|
||||
INSERT OR IGNORE INTO queue (hash, date, priority)
|
||||
SELECT hash, ?, ?
|
||||
FROM commits
|
||||
LEFT JOIN runs USING (hash)
|
||||
WHERE reachable = ? AND id IS NULL
|
||||
ORDER BY unixepoch(committer_date) DESC
|
||||
LIMIT ?
|
||||
",
|
||||
date,
|
||||
form.priority,
|
||||
|
|
@ -132,7 +132,7 @@ pub async fn post_admin_queue_increase(
|
|||
) -> somehow::Result<impl IntoResponse> {
|
||||
sqlx::query!(
|
||||
"UPDATE queue SET priority = priority + 1 WHERE hash = ?",
|
||||
form.hash
|
||||
form.hash,
|
||||
)
|
||||
.execute(&db)
|
||||
.await?;
|
||||
|
|
@ -155,7 +155,7 @@ pub async fn post_admin_queue_decrease(
|
|||
) -> somehow::Result<impl IntoResponse> {
|
||||
sqlx::query!(
|
||||
"UPDATE queue SET priority = priority - 1 WHERE hash = ?",
|
||||
form.hash
|
||||
form.hash,
|
||||
)
|
||||
.execute(&db)
|
||||
.await?;
|
||||
|
|
|
|||
|
|
@ -45,18 +45,18 @@ async fn save_work(
|
|||
let end = run.end.map(|t| t.0).unwrap_or_else(OffsetDateTime::now_utc);
|
||||
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT INTO runs ( \
|
||||
id, \
|
||||
hash, \
|
||||
bench_method, \
|
||||
worker_name, \
|
||||
worker_info, \
|
||||
start, \
|
||||
end, \
|
||||
exit_code \
|
||||
) \
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?) \
|
||||
"
|
||||
INSERT INTO runs (
|
||||
id,
|
||||
hash,
|
||||
bench_method,
|
||||
worker_name,
|
||||
worker_info,
|
||||
start,
|
||||
end,
|
||||
exit_code
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
||||
",
|
||||
run.id,
|
||||
run.hash,
|
||||
|
|
@ -78,14 +78,14 @@ async fn save_work(
|
|||
|
||||
for (metric, measurement) in run.measurements {
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT INTO run_measurements ( \
|
||||
id, \
|
||||
metric, \
|
||||
value, \
|
||||
unit \
|
||||
) \
|
||||
VALUES (?, ?, ?, ?) \
|
||||
"
|
||||
INSERT INTO run_measurements (
|
||||
id,
|
||||
metric,
|
||||
value,
|
||||
unit
|
||||
)
|
||||
VALUES (?, ?, ?, ?)
|
||||
",
|
||||
run.id,
|
||||
metric,
|
||||
|
|
@ -100,14 +100,14 @@ async fn save_work(
|
|||
// Hopefully we won't need more than 4294967296 lines per run :P
|
||||
let line = line as u32;
|
||||
sqlx::query!(
|
||||
"\
|
||||
INSERT INTO run_output ( \
|
||||
id, \
|
||||
line, \
|
||||
source, \
|
||||
text \
|
||||
) \
|
||||
VALUES (?, ?, ?, ?) \
|
||||
"
|
||||
INSERT INTO run_output (
|
||||
id,
|
||||
line,
|
||||
source,
|
||||
text
|
||||
)
|
||||
VALUES (?, ?, ?, ?)
|
||||
",
|
||||
run.id,
|
||||
line,
|
||||
|
|
|
|||
|
|
@ -28,18 +28,18 @@ pub async fn get_commit_by_hash(
|
|||
State(db): State<SqlitePool>,
|
||||
) -> somehow::Result<Response> {
|
||||
let Some(commit) = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
author, \
|
||||
author_date AS \"author_date: time::OffsetDateTime\", \
|
||||
committer, \
|
||||
committer_date AS \"committer_date: time::OffsetDateTime\", \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\" \
|
||||
FROM commits \
|
||||
WHERE hash = ? \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
author,
|
||||
author_date AS "author_date: time::OffsetDateTime",
|
||||
committer,
|
||||
committer_date AS "committer_date: time::OffsetDateTime",
|
||||
message,
|
||||
reachable AS "reachable: Reachable"
|
||||
FROM commits
|
||||
WHERE hash = ?
|
||||
"#,
|
||||
path.hash,
|
||||
)
|
||||
.fetch_optional(&db)
|
||||
|
|
@ -49,16 +49,16 @@ pub async fn get_commit_by_hash(
|
|||
};
|
||||
|
||||
let parents = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\" \
|
||||
FROM commits \
|
||||
JOIN commit_edges ON hash = parent \
|
||||
WHERE child = ? \
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
message,
|
||||
reachable AS "reachable: Reachable"
|
||||
FROM commits
|
||||
JOIN commit_edges ON hash = parent
|
||||
WHERE child = ?
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC
|
||||
"#,
|
||||
path.hash,
|
||||
)
|
||||
.fetch(&db)
|
||||
|
|
@ -67,16 +67,16 @@ pub async fn get_commit_by_hash(
|
|||
.await?;
|
||||
|
||||
let children = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\" \
|
||||
FROM commits \
|
||||
JOIN commit_edges ON hash = child \
|
||||
WHERE parent = ? \
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
message,
|
||||
reachable AS "reachable: Reachable"
|
||||
FROM commits
|
||||
JOIN commit_edges ON hash = child
|
||||
WHERE parent = ?
|
||||
ORDER BY reachable DESC, unixepoch(committer_date) ASC
|
||||
"#,
|
||||
path.hash,
|
||||
)
|
||||
.fetch(&db)
|
||||
|
|
@ -85,13 +85,13 @@ pub async fn get_commit_by_hash(
|
|||
.await?;
|
||||
|
||||
let runs = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
id, \
|
||||
start AS \"start: time::OffsetDateTime\" \
|
||||
FROM runs WHERE hash = ? \
|
||||
",
|
||||
path.hash
|
||||
r#"
|
||||
SELECT
|
||||
id,
|
||||
start AS "start: time::OffsetDateTime"
|
||||
FROM runs WHERE hash = ?
|
||||
"#,
|
||||
path.hash,
|
||||
)
|
||||
.fetch(&db)
|
||||
.map_ok(|r| components::link_run_date(config, r.id, r.start))
|
||||
|
|
|
|||
|
|
@ -93,16 +93,16 @@ pub async fn get_graph_commits(
|
|||
|
||||
// Fetch main commit info
|
||||
let mut rows = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
author, \
|
||||
message, \
|
||||
committer_date AS \"committer_date: OffsetDateTime\" \
|
||||
FROM commits \
|
||||
WHERE reachable = ? \
|
||||
ORDER BY hash ASC \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
author,
|
||||
message,
|
||||
committer_date AS "committer_date: OffsetDateTime"
|
||||
FROM commits
|
||||
WHERE reachable = ?
|
||||
ORDER BY hash ASC
|
||||
"#,
|
||||
Reachable::FromTrackedRef,
|
||||
)
|
||||
.fetch(&mut *conn);
|
||||
|
|
@ -124,12 +124,12 @@ pub async fn get_graph_commits(
|
|||
|
||||
// Fetch parent info
|
||||
let mut rows = sqlx::query!(
|
||||
"\
|
||||
SELECT child, parent \
|
||||
FROM commit_edges \
|
||||
JOIN commits ON hash = child \
|
||||
WHERE reachable = ? \
|
||||
ORDER BY hash ASC \
|
||||
"
|
||||
SELECT child, parent
|
||||
FROM commit_edges
|
||||
JOIN commits ON hash = child
|
||||
WHERE reachable = ?
|
||||
ORDER BY hash ASC
|
||||
",
|
||||
Reachable::FromTrackedRef,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -27,17 +27,17 @@ pub async fn get_index(
|
|||
State(db): State<SqlitePool>,
|
||||
) -> somehow::Result<impl IntoResponse> {
|
||||
let refs = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
name, \
|
||||
hash, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\", \
|
||||
tracked \
|
||||
FROM refs \
|
||||
JOIN commits USING (hash) \
|
||||
ORDER BY name ASC \
|
||||
"
|
||||
r#"
|
||||
SELECT
|
||||
name,
|
||||
hash,
|
||||
message,
|
||||
reachable AS "reachable: Reachable",
|
||||
tracked
|
||||
FROM refs
|
||||
JOIN commits USING (hash)
|
||||
ORDER BY name ASC
|
||||
"#
|
||||
)
|
||||
.fetch(&db)
|
||||
.map_ok(|r| Ref {
|
||||
|
|
|
|||
|
|
@ -117,17 +117,17 @@ async fn get_queue_data(
|
|||
}
|
||||
|
||||
let mut tasks = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\", \
|
||||
date AS \"date: time::OffsetDateTime\", \
|
||||
priority \
|
||||
FROM queue \
|
||||
JOIN commits USING (hash) \
|
||||
ORDER BY priority DESC, unixepoch(date) DESC, hash ASC \
|
||||
"
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
message,
|
||||
reachable AS "reachable: Reachable",
|
||||
date AS "date: time::OffsetDateTime",
|
||||
priority
|
||||
FROM queue
|
||||
JOIN commits USING (hash)
|
||||
ORDER BY priority DESC, unixepoch(date) DESC, hash ASC
|
||||
"#
|
||||
)
|
||||
.fetch(db)
|
||||
.map_ok(|r| Task {
|
||||
|
|
@ -276,15 +276,15 @@ pub async fn get_queue_delete(
|
|||
State(db): State<SqlitePool>,
|
||||
) -> somehow::Result<Response> {
|
||||
let Some(r) = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
hash, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\" \
|
||||
FROM commits \
|
||||
JOIN queue USING (hash) \
|
||||
WHERE hash = ? \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
hash,
|
||||
message,
|
||||
reachable AS "reachable: Reachable"
|
||||
FROM commits
|
||||
JOIN queue USING (hash)
|
||||
WHERE hash = ?
|
||||
"#,
|
||||
path.hash,
|
||||
)
|
||||
.fetch_optional(&db)
|
||||
|
|
|
|||
|
|
@ -34,20 +34,20 @@ async fn from_finished_run(
|
|||
db: &SqlitePool,
|
||||
) -> somehow::Result<Option<Markup>> {
|
||||
let Some(run) = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
id, \
|
||||
hash, \
|
||||
bench_method, \
|
||||
start AS \"start: time::OffsetDateTime\", \
|
||||
end AS \"end: time::OffsetDateTime\", \
|
||||
exit_code, \
|
||||
message, \
|
||||
reachable AS \"reachable: Reachable\" \
|
||||
FROM runs \
|
||||
JOIN commits USING (hash) \
|
||||
WHERE id = ? \
|
||||
",
|
||||
r#"
|
||||
SELECT
|
||||
id,
|
||||
hash,
|
||||
bench_method,
|
||||
start AS "start: time::OffsetDateTime",
|
||||
end AS "end: time::OffsetDateTime",
|
||||
exit_code,
|
||||
message,
|
||||
reachable AS "reachable: Reachable"
|
||||
FROM runs
|
||||
JOIN commits USING (hash)
|
||||
WHERE id = ?
|
||||
"#,
|
||||
id,
|
||||
)
|
||||
.fetch_optional(db)
|
||||
|
|
@ -57,14 +57,14 @@ async fn from_finished_run(
|
|||
};
|
||||
|
||||
let measurements = sqlx::query!(
|
||||
"\
|
||||
SELECT \
|
||||
metric, \
|
||||
value, \
|
||||
unit \
|
||||
FROM run_measurements \
|
||||
WHERE id = ? \
|
||||
ORDER BY metric ASC \
|
||||
"
|
||||
SELECT
|
||||
metric,
|
||||
value,
|
||||
unit
|
||||
FROM run_measurements
|
||||
WHERE id = ?
|
||||
ORDER BY metric ASC
|
||||
",
|
||||
id,
|
||||
)
|
||||
|
|
@ -78,10 +78,10 @@ async fn from_finished_run(
|
|||
.await?;
|
||||
|
||||
let output = sqlx::query!(
|
||||
"\
|
||||
SELECT source, text FROM run_output \
|
||||
WHERE id = ? \
|
||||
ORDER BY line ASC \
|
||||
"
|
||||
SELECT source, text FROM run_output
|
||||
WHERE id = ?
|
||||
ORDER BY line ASC
|
||||
",
|
||||
id,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue