Create and use Reachable primitive
This commit is contained in:
parent
5a4784be56
commit
7d80ba4a6b
24 changed files with 136 additions and 87 deletions
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT OR IGNORE INTO queue (hash, date, priority) SELECT hash, ?, ? FROM commits LEFT JOIN runs USING (hash) WHERE reachable = 2 AND id IS NULL ORDER BY unixepoch(committer_date) DESC LIMIT ? ",
|
||||
"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": 3
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "ee811ca799590d80f1c76a8625ab22c584e528b4dac6ee1103c071eb29282f17"
|
||||
"hash": "1b572ecd6904a13d78070bc6aeef3a4f349baa5b880aaa1d141b516a34517b4b"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT name, hash, message, reachable, tracked FROM refs JOIN commits USING (hash) ORDER BY name ASC ",
|
||||
"query": "SELECT name, hash, message, reachable AS \"reachable: Reachable\", tracked FROM refs JOIN commits USING (hash) ORDER BY name ASC ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 3,
|
||||
"type_info": "Int64"
|
||||
},
|
||||
|
|
@ -40,5 +40,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "c7a4115d81a3371d77afadfdad7dbe47c4d1d23211a35c0c68174f9ce82893c2"
|
||||
"hash": "1df8ec0b41dbafe191f6990d6be6f6f3c9d86ea9ca8112f16b5735b1193ea243"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, author, message, committer_date AS \"committer_date: OffsetDateTime\" FROM commits WHERE reachable = 2 ORDER BY hash ASC ",
|
||||
"query": "SELECT hash, author, message, committer_date AS \"committer_date: OffsetDateTime\" FROM commits WHERE reachable = ? ORDER BY hash ASC ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
|
|
@ -34,5 +34,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "6c766f5d504a19061a551b0b11b1558d08702ff3656331cb2595c9dc311cd870"
|
||||
"hash": "2d4ddb045e286955334793d7610f1f1ee1d7d825031b003db6117231a16d2f50"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE commits SET new = false WHERE reachable = 2",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "3d48dcc84c3d624f7a9f9ebd0399aa9786cb94e2ddda6016fc0e8e0fee46fc98"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable FROM commits JOIN commit_edges ON hash = parent WHERE child = ? ORDER BY reachable DESC, unixepoch(committer_date) ASC ",
|
||||
"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 ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 2,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "3514cb91d76683ccdf40ef732ae6062327d6b4aa1acd96632cb934b2d8495b9d"
|
||||
"hash": "3edd8ce2a6fbb36433684d259d073cca1df369461ae8e0c357ebaba2e08186e5"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash FROM commits WHERE new AND reachable = 2",
|
||||
"query": "SELECT hash FROM commits WHERE new AND reachable = ?",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -10,11 +10,11 @@
|
|||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "726102c4f61f95047a64cdc21834d0a5544950ecfe9b1d6716521dcf1d0b8fb2"
|
||||
"hash": "4adebcd260affd90435d3b3b3cf1bbee3bec22d5745b45184c3f555b9c5e9e31"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable FROM commits JOIN commit_edges ON hash = child WHERE parent = ? ORDER BY reachable DESC, unixepoch(committer_date) ASC ",
|
||||
"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 ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 2,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "a6d9bfe6d0cd4677074341cebe6a3cc9c1ed2273ab238bd18a435abff4564c67"
|
||||
"hash": "595f95ecdafb7c94bcf4cc81222e207079e2da3779a1ce3c8b5833e335faf130"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable, date AS \"date: time::OffsetDateTime\", priority FROM queue JOIN commits USING (hash) ORDER BY priority DESC, unixepoch(date) DESC, hash ASC ",
|
||||
"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 ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 2,
|
||||
"type_info": "Int64"
|
||||
},
|
||||
|
|
@ -40,5 +40,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "6c9e27efd2c88772bbf1f89bf53d0abb49cd82788b1e88e4e2ef153b0f35a8fb"
|
||||
"hash": "5da81c9c9875bf4fd4e894ca54be65aee3d76a26c12feb1e4f25e9f482cd153e"
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"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 2 WHEN hash IN reachable THEN 1 ELSE 0 END ",
|
||||
"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": 0
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "32f0ac59687e5455bb38060dc1d6cd181a86cd6ca7ac2f583a33212c8b7bef1a"
|
||||
"hash": "7808509e5f7d1c7e8138ff9e124ab3b1784a05ac771778ff8e503ae20d319c08"
|
||||
}
|
||||
12
.sqlx/query-b59a8a7243290e78dbfedc6b2577097bc0220317ad69eb22173ae8cf8c85a0d3.json
generated
Normal file
12
.sqlx/query-b59a8a7243290e78dbfedc6b2577097bc0220317ad69eb22173ae8cf8c85a0d3.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE commits SET new = false WHERE reachable = ?",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "b59a8a7243290e78dbfedc6b2577097bc0220317ad69eb22173ae8cf8c85a0d3"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT child, parent FROM commit_edges JOIN commits ON hash = child WHERE reachable = 2 ORDER BY hash ASC ",
|
||||
"query": "SELECT child, parent FROM commit_edges JOIN commits ON hash = child WHERE reachable = ? ORDER BY hash ASC ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -15,12 +15,12 @@
|
|||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "5092d460f9bd489e2a5905c1ae3e3d3b3c946c427e1dd7d2d723f6aab5acd636"
|
||||
"hash": "ba09c191e2a83d4398b26888f041c93095ba82693b0b9c2c2eebd65078f7d168"
|
||||
}
|
||||
|
|
@ -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 FROM commits WHERE hash = ? ",
|
||||
"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 = ? ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 6,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
|
|
@ -52,5 +52,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "a42862017ade20eb742a9761c1b581d4c902dfe12e36a504cc111a9d38407196"
|
||||
"hash": "c75001269238285e4de8d609a404b7249df61711324b3cae4c21b74b0875100d"
|
||||
}
|
||||
|
|
@ -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 FROM runs JOIN commits USING (hash) WHERE id = ? ",
|
||||
"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 = ? ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 7,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
|
|
@ -58,5 +58,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "26bf8f43e0fa607ddfabb0611ee95c8ed1fef2d1aa76749b660228cd38a84283"
|
||||
"hash": "daae5a05af0e8a511f5099820da2ccbeebb577935786fdb1a235d0315bc5a433"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT hash, message, reachable FROM commits JOIN queue USING (hash) WHERE hash = ? ",
|
||||
"query": "SELECT hash, message, reachable AS \"reachable: Reachable\" FROM commits JOIN queue USING (hash) WHERE hash = ? ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "reachable",
|
||||
"name": "reachable: Reachable",
|
||||
"ordinal": 2,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
|
|
@ -28,5 +28,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "c1e772c34a0324159ca1ee204806c3774762a3df4c6d06a4ea4df67b105bac00"
|
||||
"hash": "dcd37f22be87b31a7edaba2c4225d3ddfb9802c532102036e1d2ec3cd1adc51f"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue