diff --git a/.sqlx/query-081663d386dd8dac6fbf3e47ef39fa7238f29192674ced1b3a46329db6cc3b64.json b/.sqlx/query-081663d386dd8dac6fbf3e47ef39fa7238f29192674ced1b3a46329db6cc3b64.json new file mode 100644 index 000000000..c41e1a2e1 --- /dev/null +++ b/.sqlx/query-081663d386dd8dac6fbf3e47ef39fa7238f29192674ced1b3a46329db6cc3b64.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n kw.name as \"name!\",\n kw.slug as \"slug!\"\n FROM keywords as kw\n INNER JOIN keyword_rels as kwr on kw.id = kwr.kid\n WHERE kwr.rid = $1\n ORDER BY kw.name,kw.slug", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name!", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "slug!", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + false + ] + }, + "hash": "081663d386dd8dac6fbf3e47ef39fa7238f29192674ced1b3a46329db6cc3b64" +} diff --git a/.sqlx/query-09cfb32d3ce685cbb748a703fee395f8b9da75636522a343363c6e88a6e6dfb1.json b/.sqlx/query-09cfb32d3ce685cbb748a703fee395f8b9da75636522a343363c6e88a6e6dfb1.json new file mode 100644 index 000000000..9f5c2b08d --- /dev/null +++ b/.sqlx/query-09cfb32d3ce685cbb748a703fee395f8b9da75636522a343363c6e88a6e6dfb1.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT o.login\n FROM owners o, owner_rels r\n WHERE\n o.id = r.oid AND\n r.cid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "09cfb32d3ce685cbb748a703fee395f8b9da75636522a343363c6e88a6e6dfb1" +} diff --git a/.sqlx/query-0b4084390b6c738c6f26c2dd13eff6ec8e7ea47c4d005d6cc00dbc60f69380cf.json b/.sqlx/query-0b4084390b6c738c6f26c2dd13eff6ec8e7ea47c4d005d6cc00dbc60f69380cf.json new file mode 100644 index 000000000..8a1259bdd --- /dev/null +++ b/.sqlx/query-0b4084390b6c738c6f26c2dd13eff6ec8e7ea47c4d005d6cc00dbc60f69380cf.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT build_status as \"build_status!: BuildStatus\"\n FROM crates\n INNER JOIN releases ON crates.id = releases.crate_id\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n WHERE crates.name = $1 AND releases.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "build_status!: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "0b4084390b6c738c6f26c2dd13eff6ec8e7ea47c4d005d6cc00dbc60f69380cf" +} diff --git a/.sqlx/query-0da90d737b6bf2c1c1b0ab6b14c73c8363125578b1d6e30a99e70aa6bf7842c2.json b/.sqlx/query-0da90d737b6bf2c1c1b0ab6b14c73c8363125578b1d6e30a99e70aa6bf7842c2.json new file mode 100644 index 000000000..78624ea28 --- /dev/null +++ b/.sqlx/query-0da90d737b6bf2c1c1b0ab6b14c73c8363125578b1d6e30a99e70aa6bf7842c2.json @@ -0,0 +1,57 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n rustc_version,\n docsrs_version,\n build_status as \"build_status: BuildStatus\",\n documentation_size,\n errors\n FROM builds\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "documentation_size", + "type_info": "Int8" + }, + { + "ordinal": 4, + "name": "errors", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + true, + false, + true, + true + ] + }, + "hash": "0da90d737b6bf2c1c1b0ab6b14c73c8363125578b1d6e30a99e70aa6bf7842c2" +} diff --git a/.sqlx/query-16dfb0d87266568fb8a84585614387c8bfa4790b9e8d317159b37397e42b7ceb.json b/.sqlx/query-16dfb0d87266568fb8a84585614387c8bfa4790b9e8d317159b37397e42b7ceb.json new file mode 100644 index 000000000..591b42a07 --- /dev/null +++ b/.sqlx/query-16dfb0d87266568fb8a84585614387c8bfa4790b9e8d317159b37397e42b7ceb.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT login, avatar, kind as \"kind: OwnerKind\"\n FROM owners", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "avatar", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "kind: OwnerKind", + "type_info": { + "Custom": { + "name": "owner_kind", + "kind": { + "Enum": [ + "user", + "team" + ] + } + } + } + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "16dfb0d87266568fb8a84585614387c8bfa4790b9e8d317159b37397e42b7ceb" +} diff --git a/.sqlx/query-192d91c85fff00d311fa28dd7f5781ea30207795b833c4951f3c8303c49e699e.json b/.sqlx/query-192d91c85fff00d311fa28dd7f5781ea30207795b833c4951f3c8303c49e699e.json new file mode 100644 index 000000000..1cb245393 --- /dev/null +++ b/.sqlx/query-192d91c85fff00d311fa28dd7f5781ea30207795b833c4951f3c8303c49e699e.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM builds", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "192d91c85fff00d311fa28dd7f5781ea30207795b833c4951f3c8303c49e699e" +} diff --git a/.sqlx/query-1e48486ba272a4e2ea8793114e412c14ed13f652419b1467c21e1829f31cd573.json b/.sqlx/query-1e48486ba272a4e2ea8793114e412c14ed13f652419b1467c21e1829f31cd573.json new file mode 100644 index 000000000..438d11b06 --- /dev/null +++ b/.sqlx/query-1e48486ba272a4e2ea8793114e412c14ed13f652419b1467c21e1829f31cd573.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT login, avatar, kind as \"kind: OwnerKind\" FROM owners", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "avatar", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "kind: OwnerKind", + "type_info": { + "Custom": { + "name": "owner_kind", + "kind": { + "Enum": [ + "user", + "team" + ] + } + } + } + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "1e48486ba272a4e2ea8793114e412c14ed13f652419b1467c21e1829f31cd573" +} diff --git a/.sqlx/query-1fc879cc103367a688f9f7bcc079df8f6419c177167ae0bfe8685033b6b8709e.json b/.sqlx/query-1fc879cc103367a688f9f7bcc079df8f6419c177167ae0bfe8685033b6b8709e.json new file mode 100644 index 000000000..d5ee6c7da --- /dev/null +++ b/.sqlx/query-1fc879cc103367a688f9f7bcc079df8f6419c177167ae0bfe8685033b6b8709e.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n r.doc_targets\n FROM\n crates as c\n INNER JOIN releases AS r ON c.id = r.crate_id\n WHERE\n c.name = $1 AND\n r.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "doc_targets", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "1fc879cc103367a688f9f7bcc079df8f6419c177167ae0bfe8685033b6b8709e" +} diff --git a/.sqlx/query-23c1c88674c09e208738ebdd705db4c30d6dba6e24ca6c7c7fbf06d49d40994f.json b/.sqlx/query-23c1c88674c09e208738ebdd705db4c30d6dba6e24ca6c7c7fbf06d49d40994f.json new file mode 100644 index 000000000..d520c5471 --- /dev/null +++ b/.sqlx/query-23c1c88674c09e208738ebdd705db4c30d6dba6e24ca6c7c7fbf06d49d40994f.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name FROM crates WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "23c1c88674c09e208738ebdd705db4c30d6dba6e24ca6c7c7fbf06d49d40994f" +} diff --git a/.sqlx/query-265729219105c1d8021fe898dcbead19f890f2baf677654f404f51ba48e57013.json b/.sqlx/query-265729219105c1d8021fe898dcbead19f890f2baf677654f404f51ba48e57013.json new file mode 100644 index 000000000..b31520820 --- /dev/null +++ b/.sqlx/query-265729219105c1d8021fe898dcbead19f890f2baf677654f404f51ba48e57013.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id\n FROM crates\n WHERE name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "265729219105c1d8021fe898dcbead19f890f2baf677654f404f51ba48e57013" +} diff --git a/.sqlx/query-398d7622c18e45ddc5beffdcd5ec53f9d42da5178f23f1046c4df621a7d17307.json b/.sqlx/query-398d7622c18e45ddc5beffdcd5ec53f9d42da5178f23f1046c4df621a7d17307.json new file mode 100644 index 000000000..48048871a --- /dev/null +++ b/.sqlx/query-398d7622c18e45ddc5beffdcd5ec53f9d42da5178f23f1046c4df621a7d17307.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT crate_id as \"crate_id: CrateId\" FROM releases WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "398d7622c18e45ddc5beffdcd5ec53f9d42da5178f23f1046c4df621a7d17307" +} diff --git a/.sqlx/query-3a46fdff86a84ce2140ad14a5bdc951c1d43e600ef5bc25d23c1fe42f6136869.json b/.sqlx/query-3a46fdff86a84ce2140ad14a5bdc951c1d43e600ef5bc25d23c1fe42f6136869.json new file mode 100644 index 000000000..f33c7c861 --- /dev/null +++ b/.sqlx/query-3a46fdff86a84ce2140ad14a5bdc951c1d43e600ef5bc25d23c1fe42f6136869.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "ALTER SEQUENCE crates_id_seq RESTART WITH 1", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "3a46fdff86a84ce2140ad14a5bdc951c1d43e600ef5bc25d23c1fe42f6136869" +} diff --git a/.sqlx/query-3e9eb6292735559d232316d155c7dc463098408a0ca28f2b0c13bc6f4e3c32b6.json b/.sqlx/query-3e9eb6292735559d232316d155c7dc463098408a0ca28f2b0c13bc6f4e3c32b6.json new file mode 100644 index 000000000..fb5281405 --- /dev/null +++ b/.sqlx/query-3e9eb6292735559d232316d155c7dc463098408a0ca28f2b0c13bc6f4e3c32b6.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT o.login\n FROM owners o, owner_rels r\n WHERE\n o.id = r.oid AND\n r.cid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "3e9eb6292735559d232316d155c7dc463098408a0ca28f2b0c13bc6f4e3c32b6" +} diff --git a/.sqlx/query-45dce653c51bb8a13c9b091b1aa5f997fccf6a563f654c7943b4593598acccbc.json b/.sqlx/query-45dce653c51bb8a13c9b091b1aa5f997fccf6a563f654c7943b4593598acccbc.json new file mode 100644 index 000000000..ca87c1cb2 --- /dev/null +++ b/.sqlx/query-45dce653c51bb8a13c9b091b1aa5f997fccf6a563f654c7943b4593598acccbc.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n version as \"version: Version\"\n FROM releases\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "version: Version", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "45dce653c51bb8a13c9b091b1aa5f997fccf6a563f654c7943b4593598acccbc" +} diff --git a/.sqlx/query-4ec79e1fa4249f4e1b085d1bbdffa537d1e3160d642e4a3325f4aea6c21974eb.json b/.sqlx/query-4ec79e1fa4249f4e1b085d1bbdffa537d1e3160d642e4a3325f4aea6c21974eb.json new file mode 100644 index 000000000..3f8fdef82 --- /dev/null +++ b/.sqlx/query-4ec79e1fa4249f4e1b085d1bbdffa537d1e3160d642e4a3325f4aea6c21974eb.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM config", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "4ec79e1fa4249f4e1b085d1bbdffa537d1e3160d642e4a3325f4aea6c21974eb" +} diff --git a/.sqlx/query-5a927fd22f0ad007a48820a7af73747f6a3f03e02097065cbb8958d50366a2b3.json b/.sqlx/query-5a927fd22f0ad007a48820a7af73747f6a3f03e02097065cbb8958d50366a2b3.json new file mode 100644 index 000000000..2c6ed4d89 --- /dev/null +++ b/.sqlx/query-5a927fd22f0ad007a48820a7af73747f6a3f03e02097065cbb8958d50366a2b3.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n kw.name as \"name!\",\n kw.slug as \"slug!\"\n FROM keywords as kw\n INNER JOIN keyword_rels as kwr on kw.id = kwr.kid\n WHERE kwr.rid = $1\n ORDER BY kw.name,kw.slug", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name!", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "slug!", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + false + ] + }, + "hash": "5a927fd22f0ad007a48820a7af73747f6a3f03e02097065cbb8958d50366a2b3" +} diff --git a/.sqlx/query-5f31665c91028ac845408991812b704acf7b879860b7e5c55a1df04202e0ec65.json b/.sqlx/query-5f31665c91028ac845408991812b704acf7b879860b7e5c55a1df04202e0ec65.json new file mode 100644 index 000000000..60f1c5eab --- /dev/null +++ b/.sqlx/query-5f31665c91028ac845408991812b704acf7b879860b7e5c55a1df04202e0ec65.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET yanked = true WHERE id = $1 AND version = '0.3.0'", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "5f31665c91028ac845408991812b704acf7b879860b7e5c55a1df04202e0ec65" +} diff --git a/.sqlx/query-60dccddc0096cbf97fba82a98168207c271cca9a18cebbade496d79eb1e5cae4.json b/.sqlx/query-60dccddc0096cbf97fba82a98168207c271cca9a18cebbade496d79eb1e5cae4.json new file mode 100644 index 000000000..207adf0d5 --- /dev/null +++ b/.sqlx/query-60dccddc0096cbf97fba82a98168207c271cca9a18cebbade496d79eb1e5cae4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: BuildId\" FROM builds WHERE rid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: BuildId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "60dccddc0096cbf97fba82a98168207c271cca9a18cebbade496d79eb1e5cae4" +} diff --git a/.sqlx/query-61e8789f7d2ddcfa951dc86c5f455cf4451f8f3b683c6bd1033e8ebaab97692e.json b/.sqlx/query-61e8789f7d2ddcfa951dc86c5f455cf4451f8f3b683c6bd1033e8ebaab97692e.json new file mode 100644 index 000000000..3398d4f9d --- /dev/null +++ b/.sqlx/query-61e8789f7d2ddcfa951dc86c5f455cf4451f8f3b683c6bd1033e8ebaab97692e.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM builds WHERE rid = $1 ORDER BY id ASC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "61e8789f7d2ddcfa951dc86c5f455cf4451f8f3b683c6bd1033e8ebaab97692e" +} diff --git a/.sqlx/query-64d91ec806ed67d6cffd1a797da5059cc8fb44b37f94dc77877c88d266c5ac9b.json b/.sqlx/query-64d91ec806ed67d6cffd1a797da5059cc8fb44b37f94dc77877c88d266c5ac9b.json new file mode 100644 index 000000000..4eb0f97f7 --- /dev/null +++ b/.sqlx/query-64d91ec806ed67d6cffd1a797da5059cc8fb44b37f94dc77877c88d266c5ac9b.json @@ -0,0 +1,63 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n rustc_version,\n docsrs_version,\n build_status as \"build_status: BuildStatus\",\n documentation_size,\n errors,\n rustc_nightly_date\n FROM builds\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "documentation_size", + "type_info": "Int8" + }, + { + "ordinal": 4, + "name": "errors", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "rustc_nightly_date", + "type_info": "Date" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + true, + false, + true, + true, + true + ] + }, + "hash": "64d91ec806ed67d6cffd1a797da5059cc8fb44b37f94dc77877c88d266c5ac9b" +} diff --git a/.sqlx/query-7fad5d5fdee0a32f79f34f22bee0e8cfc48521abe29f2570be40e76d9b5bab16.json b/.sqlx/query-7fad5d5fdee0a32f79f34f22bee0e8cfc48521abe29f2570be40e76d9b5bab16.json new file mode 100644 index 000000000..2855df519 --- /dev/null +++ b/.sqlx/query-7fad5d5fdee0a32f79f34f22bee0e8cfc48521abe29f2570be40e76d9b5bab16.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue SET attempt = 99", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "7fad5d5fdee0a32f79f34f22bee0e8cfc48521abe29f2570be40e76d9b5bab16" +} diff --git a/.sqlx/query-83dc17977f99a0b182f11efa80cf9b9afc273e362160421dda768d45c62f71b7.json b/.sqlx/query-83dc17977f99a0b182f11efa80cf9b9afc273e362160421dda768d45c62f71b7.json new file mode 100644 index 000000000..7ca47cfe4 --- /dev/null +++ b/.sqlx/query-83dc17977f99a0b182f11efa80cf9b9afc273e362160421dda768d45c62f71b7.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: ReleaseId\" FROM releases WHERE crate_id = $1 and version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "83dc17977f99a0b182f11efa80cf9b9afc273e362160421dda768d45c62f71b7" +} diff --git a/.sqlx/query-8552f463bfc719f100e0e678b1400ea593a24d5d0c9ef291f786a27669cd626d.json b/.sqlx/query-8552f463bfc719f100e0e678b1400ea593a24d5d0c9ef291f786a27669cd626d.json new file mode 100644 index 000000000..773538685 --- /dev/null +++ b/.sqlx/query-8552f463bfc719f100e0e678b1400ea593a24d5d0c9ef291f786a27669cd626d.json @@ -0,0 +1,57 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n rustc_version,\n docsrs_version,\n build_started,\n build_status as \"build_status: BuildStatus\",\n errors\n FROM builds\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_started", + "type_info": "Timestamptz" + }, + { + "ordinal": 3, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 4, + "name": "errors", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + true, + true, + false, + true + ] + }, + "hash": "8552f463bfc719f100e0e678b1400ea593a24d5d0c9ef291f786a27669cd626d" +} diff --git a/.sqlx/query-86cb6c0a4d2e6b18df6339f12a98692cb4abb0a4b62d611679c956be3fb9494f.json b/.sqlx/query-86cb6c0a4d2e6b18df6339f12a98692cb4abb0a4b62d611679c956be3fb9494f.json new file mode 100644 index 000000000..447afc045 --- /dev/null +++ b/.sqlx/query-86cb6c0a4d2e6b18df6339f12a98692cb4abb0a4b62d611679c956be3fb9494f.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET default_target = 'x86_64-unknown-linux-gnu' WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "86cb6c0a4d2e6b18df6339f12a98692cb4abb0a4b62d611679c956be3fb9494f" +} diff --git a/.sqlx/query-87cd28092cc0d8646d48687bedd2bbb76530bcc207d2899736b8ca6e564d2a51.json b/.sqlx/query-87cd28092cc0d8646d48687bedd2bbb76530bcc207d2899736b8ca6e564d2a51.json new file mode 100644 index 000000000..c7c7353b1 --- /dev/null +++ b/.sqlx/query-87cd28092cc0d8646d48687bedd2bbb76530bcc207d2899736b8ca6e564d2a51.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET features = NULL WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "87cd28092cc0d8646d48687bedd2bbb76530bcc207d2899736b8ca6e564d2a51" +} diff --git a/.sqlx/query-8cdeaffe16408187897e5c8f2b0d6054a31d0a2df37a8a1d7659208092929ce8.json b/.sqlx/query-8cdeaffe16408187897e5c8f2b0d6054a31d0a2df37a8a1d7659208092929ce8.json new file mode 100644 index 000000000..4f5d74702 --- /dev/null +++ b/.sqlx/query-8cdeaffe16408187897e5c8f2b0d6054a31d0a2df37a8a1d7659208092929ce8.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases\n SET files = NULL\n WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "8cdeaffe16408187897e5c8f2b0d6054a31d0a2df37a8a1d7659208092929ce8" +} diff --git a/.sqlx/query-8d1fc18ed39b0b5588dfa3958e6a9dfb847ca73426f9e5c20bf907d9236d10b9.json b/.sqlx/query-8d1fc18ed39b0b5588dfa3958e6a9dfb847ca73426f9e5c20bf907d9236d10b9.json new file mode 100644 index 000000000..fd8f3842a --- /dev/null +++ b/.sqlx/query-8d1fc18ed39b0b5588dfa3958e6a9dfb847ca73426f9e5c20bf907d9236d10b9.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT yanked\n FROM releases\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "yanked", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true + ] + }, + "hash": "8d1fc18ed39b0b5588dfa3958e6a9dfb847ca73426f9e5c20bf907d9236d10b9" +} diff --git a/.sqlx/query-a23b671c7833d7c58238dbc7e8e9f46cae9db2b0c273e3245d9458614bf1243d.json b/.sqlx/query-a23b671c7833d7c58238dbc7e8e9f46cae9db2b0c273e3245d9458614bf1243d.json new file mode 100644 index 000000000..f001ab425 --- /dev/null +++ b/.sqlx/query-a23b671c7833d7c58238dbc7e8e9f46cae9db2b0c273e3245d9458614bf1243d.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO queue (name, version, priority, attempt, last_attempt )\n VALUES ($1, $2, 0, 99, NOW())", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "a23b671c7833d7c58238dbc7e8e9f46cae9db2b0c273e3245d9458614bf1243d" +} diff --git a/.sqlx/query-a68160fad4a1adbfe54d44f5efcc53c9583651187631d656c779e6d08676e5a4.json b/.sqlx/query-a68160fad4a1adbfe54d44f5efcc53c9583651187631d656c779e6d08676e5a4.json new file mode 100644 index 000000000..21931971c --- /dev/null +++ b/.sqlx/query-a68160fad4a1adbfe54d44f5efcc53c9583651187631d656c779e6d08676e5a4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM releases WHERE id = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "a68160fad4a1adbfe54d44f5efcc53c9583651187631d656c779e6d08676e5a4" +} diff --git a/.sqlx/query-abf12aa0c7f3d2d626c212f5e3d4903b6a9745d315b2b71c298934ac42649362.json b/.sqlx/query-abf12aa0c7f3d2d626c212f5e3d4903b6a9745d315b2b71c298934ac42649362.json new file mode 100644 index 000000000..7f51ff4d8 --- /dev/null +++ b/.sqlx/query-abf12aa0c7f3d2d626c212f5e3d4903b6a9745d315b2b71c298934ac42649362.json @@ -0,0 +1,46 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n releases.features \"features?: Vec\"\n FROM releases\n INNER JOIN crates ON crates.id = releases.crate_id\n WHERE crates.name = $1 AND releases.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "features?: Vec", + "type_info": { + "Custom": { + "name": "feature[]", + "kind": { + "Array": { + "Custom": { + "name": "feature", + "kind": { + "Composite": [ + [ + "name", + "Text" + ], + [ + "subfeatures", + "TextArray" + ] + ] + } + } + } + } + } + } + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "abf12aa0c7f3d2d626c212f5e3d4903b6a9745d315b2b71c298934ac42649362" +} diff --git a/.sqlx/query-b4ebc9f3e0770457003c321070f8301fc7b92dfda3fea892f1957eda0c3ae018.json b/.sqlx/query-b4ebc9f3e0770457003c321070f8301fc7b92dfda3fea892f1957eda0c3ae018.json new file mode 100644 index 000000000..b574cffd1 --- /dev/null +++ b/.sqlx/query-b4ebc9f3e0770457003c321070f8301fc7b92dfda3fea892f1957eda0c3ae018.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n r.rustdoc_status,\n r.is_library\n FROM\n crates as c\n INNER JOIN releases AS r ON c.id = r.crate_id\n LEFT OUTER JOIN doc_coverage AS cov ON r.id = cov.release_id\n WHERE\n c.name = $1 AND\n r.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 1, + "name": "is_library", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true, + true + ] + }, + "hash": "b4ebc9f3e0770457003c321070f8301fc7b92dfda3fea892f1957eda0c3ae018" +} diff --git a/.sqlx/query-bac0eba6715837501751d9a9ff9e69da199e85e57254cbf571608b36cb865d36.json b/.sqlx/query-bac0eba6715837501751d9a9ff9e69da199e85e57254cbf571608b36cb865d36.json new file mode 100644 index 000000000..64ad6b702 --- /dev/null +++ b/.sqlx/query-bac0eba6715837501751d9a9ff9e69da199e85e57254cbf571608b36cb865d36.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n rustc_version,\n docsrs_version,\n build_status as \"build_status: BuildStatus\",\n errors\n FROM\n crates as c\n INNER JOIN releases as r on c.id = r.crate_id\n INNER JOIN builds as b on b.rid = r.id\n WHERE c.name = $1 and r.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "errors", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true, + true, + false, + true + ] + }, + "hash": "bac0eba6715837501751d9a9ff9e69da199e85e57254cbf571608b36cb865d36" +} diff --git a/.sqlx/query-bcb6953f312804ebdad0370c2eaf2c816378c236c5d2028c3882a1b12c6362a1.json b/.sqlx/query-bcb6953f312804ebdad0370c2eaf2c816378c236c5d2028c3882a1b12c6362a1.json new file mode 100644 index 000000000..4315981d1 --- /dev/null +++ b/.sqlx/query-bcb6953f312804ebdad0370c2eaf2c816378c236c5d2028c3882a1b12c6362a1.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue SET attempt = 6", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "bcb6953f312804ebdad0370c2eaf2c816378c236c5d2028c3882a1b12c6362a1" +} diff --git a/.sqlx/query-c955871bcda914feac9cfb23fe010399c0b3f75e92ac425fa4ec337e9b250c26.json b/.sqlx/query-c955871bcda914feac9cfb23fe010399c0b3f75e92ac425fa4ec337e9b250c26.json new file mode 100644 index 000000000..61ff84b5f --- /dev/null +++ b/.sqlx/query-c955871bcda914feac9cfb23fe010399c0b3f75e92ac425fa4ec337e9b250c26.json @@ -0,0 +1,57 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n rustc_version,\n docsrs_version,\n build_status as \"build_status: BuildStatus\",\n errors,\n rustc_nightly_date\n FROM builds\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "errors", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "rustc_nightly_date", + "type_info": "Date" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + true, + false, + true, + true + ] + }, + "hash": "c955871bcda914feac9cfb23fe010399c0b3f75e92ac425fa4ec337e9b250c26" +} diff --git a/.sqlx/query-db4dacb4c559c87d8d6ed3b3b3e622c402acbe2080f4d0c5079251532b7ceb87.json b/.sqlx/query-db4dacb4c559c87d8d6ed3b3b3e622c402acbe2080f4d0c5079251532b7ceb87.json new file mode 100644 index 000000000..67cdefa69 --- /dev/null +++ b/.sqlx/query-db4dacb4c559c87d8d6ed3b3b3e622c402acbe2080f4d0c5079251532b7ceb87.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: CrateId\" FROM crates WHERE name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "db4dacb4c559c87d8d6ed3b3b3e622c402acbe2080f4d0c5079251532b7ceb87" +} diff --git a/.sqlx/query-dd166cd7a74629273eee01c62640f0fbf063b196803b8c5605356d40a31fc636.json b/.sqlx/query-dd166cd7a74629273eee01c62640f0fbf063b196803b8c5605356d40a31fc636.json new file mode 100644 index 000000000..6721d72bf --- /dev/null +++ b/.sqlx/query-dd166cd7a74629273eee01c62640f0fbf063b196803b8c5605356d40a31fc636.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT login FROM owners\n INNER JOIN owner_rels ON owners.id = owner_rels.oid\n WHERE owner_rels.cid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "dd166cd7a74629273eee01c62640f0fbf063b196803b8c5605356d40a31fc636" +} diff --git a/.sqlx/query-de03b48baa8a4561687aab398857cbc597f224b532a5312983962aef8b187c2a.json b/.sqlx/query-de03b48baa8a4561687aab398857cbc597f224b532a5312983962aef8b187c2a.json new file mode 100644 index 000000000..4098d58a7 --- /dev/null +++ b/.sqlx/query-de03b48baa8a4561687aab398857cbc597f224b532a5312983962aef8b187c2a.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id\n FROM releases", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "de03b48baa8a4561687aab398857cbc597f224b532a5312983962aef8b187c2a" +} diff --git a/.sqlx/query-e00a426fa250609748b3013a2a4f80844b1091964e8bdb0f55e55209077d15b1.json b/.sqlx/query-e00a426fa250609748b3013a2a4f80844b1091964e8bdb0f55e55209077d15b1.json new file mode 100644 index 000000000..dec83179a --- /dev/null +++ b/.sqlx/query-e00a426fa250609748b3013a2a4f80844b1091964e8bdb0f55e55209077d15b1.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT rustdoc_status FROM releases WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustdoc_status", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true + ] + }, + "hash": "e00a426fa250609748b3013a2a4f80844b1091964e8bdb0f55e55209077d15b1" +} diff --git a/.sqlx/query-e323820d9273ae10886a7a5db1864e11f94477ddef83a14b16f420c2f7b02bd0.json b/.sqlx/query-e323820d9273ae10886a7a5db1864e11f94477ddef83a14b16f420c2f7b02bd0.json new file mode 100644 index 000000000..0caa0c20e --- /dev/null +++ b/.sqlx/query-e323820d9273ae10886a7a5db1864e11f94477ddef83a14b16f420c2f7b02bd0.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT priority, attempt, last_attempt\n FROM queue\n WHERE name = $1 AND version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "attempt", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "last_attempt", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + true + ] + }, + "hash": "e323820d9273ae10886a7a5db1864e11f94477ddef83a14b16f420c2f7b02bd0" +} diff --git a/.sqlx/query-ec35a33dd4ea3758a2f82ac5a441e60ca47f46dde782fce4fdcb42789cf2fd16.json b/.sqlx/query-ec35a33dd4ea3758a2f82ac5a441e60ca47f46dde782fce4fdcb42789cf2fd16.json new file mode 100644 index 000000000..ded21e53a --- /dev/null +++ b/.sqlx/query-ec35a33dd4ea3758a2f82ac5a441e60ca47f46dde782fce4fdcb42789cf2fd16.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET dependencies = dependencies::jsonb #- '{0,2}' WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "ec35a33dd4ea3758a2f82ac5a441e60ca47f46dde782fce4fdcb42789cf2fd16" +} diff --git a/.sqlx/query-f011aefb83cbd26e7e83edbb3d280c554a9e2a64f0e7953c1e52939b24ccdafa.json b/.sqlx/query-f011aefb83cbd26e7e83edbb3d280c554a9e2a64f0e7953c1e52939b24ccdafa.json new file mode 100644 index 000000000..d52fe3ac5 --- /dev/null +++ b/.sqlx/query-f011aefb83cbd26e7e83edbb3d280c554a9e2a64f0e7953c1e52939b24ccdafa.json @@ -0,0 +1,83 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n r.rustdoc_status,\n r.default_target,\n r.doc_targets,\n r.archive_storage,\n r.source_size as \"source_size!\",\n cov.total_items,\n b.id as build_id,\n b.build_status::TEXT as build_status,\n b.docsrs_version,\n b.rustc_version,\n b.documentation_size\n FROM\n crates as c\n INNER JOIN releases AS r ON c.id = r.crate_id\n INNER JOIN builds as b ON r.id = b.rid\n LEFT OUTER JOIN doc_coverage AS cov ON r.id = cov.release_id\n WHERE\n c.name = $1 AND\n r.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 1, + "name": "default_target", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "doc_targets", + "type_info": "Json" + }, + { + "ordinal": 3, + "name": "archive_storage", + "type_info": "Bool" + }, + { + "ordinal": 4, + "name": "source_size!", + "type_info": "Int8" + }, + { + "ordinal": 5, + "name": "total_items", + "type_info": "Int4" + }, + { + "ordinal": 6, + "name": "build_id", + "type_info": "Int4" + }, + { + "ordinal": 7, + "name": "build_status", + "type_info": "Text" + }, + { + "ordinal": 8, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 10, + "name": "documentation_size", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true, + true, + true, + false, + true, + true, + false, + null, + true, + true, + true + ] + }, + "hash": "f011aefb83cbd26e7e83edbb3d280c554a9e2a64f0e7953c1e52939b24ccdafa" +} diff --git a/.sqlx/query-f418e582d28081864c3c571139a441dfc4f45a3f078cea8ae229531663376e7b.json b/.sqlx/query-f418e582d28081864c3c571139a441dfc4f45a3f078cea8ae229531663376e7b.json new file mode 100644 index 000000000..2f3ac6baf --- /dev/null +++ b/.sqlx/query-f418e582d28081864c3c571139a441dfc4f45a3f078cea8ae229531663376e7b.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT login FROM owners order by login", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "f418e582d28081864c3c571139a441dfc4f45a3f078cea8ae229531663376e7b" +} diff --git a/.sqlx/query-f8cb592ce46398544f35bafe57abb0abbf27ebba1645489e9e8142a0f3c1df93.json b/.sqlx/query-f8cb592ce46398544f35bafe57abb0abbf27ebba1645489e9e8142a0f3c1df93.json new file mode 100644 index 000000000..bf63783e8 --- /dev/null +++ b/.sqlx/query-f8cb592ce46398544f35bafe57abb0abbf27ebba1645489e9e8142a0f3c1df93.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue SET last_attempt = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "f8cb592ce46398544f35bafe57abb0abbf27ebba1645489e9e8142a0f3c1df93" +} diff --git a/.sqlx/query-f9e5a70e03175f8bbf44552e4def1aae33c0f1aba515ac53d1ddaf922bb1f9d9.json b/.sqlx/query-f9e5a70e03175f8bbf44552e4def1aae33c0f1aba515ac53d1ddaf922bb1f9d9.json new file mode 100644 index 000000000..fc50ff412 --- /dev/null +++ b/.sqlx/query-f9e5a70e03175f8bbf44552e4def1aae33c0f1aba515ac53d1ddaf922bb1f9d9.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT slug FROM keywords ORDER BY slug", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "slug", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "f9e5a70e03175f8bbf44552e4def1aae33c0f1aba515ac53d1ddaf922bb1f9d9" +} diff --git a/.sqlx/query-fe722f4ac37ede24ffd1dd0cb736895567b750b025e4848c54a8cda7d872c48b.json b/.sqlx/query-fe722f4ac37ede24ffd1dd0cb736895567b750b025e4848c54a8cda7d872c48b.json new file mode 100644 index 000000000..b49b3b0a0 --- /dev/null +++ b/.sqlx/query-fe722f4ac37ede24ffd1dd0cb736895567b750b025e4848c54a8cda7d872c48b.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM crates WHERE name = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "fe722f4ac37ede24ffd1dd0cb736895567b750b025e4848c54a8cda7d872c48b" +} diff --git a/Cargo.lock b/Cargo.lock index 03dffc876..9467617e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1048,7 +1048,7 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e9d642a7e3a318e37c2c9427b5a6a48aa1ad55dcd986f3034ab2239045a645" dependencies = [ - "darling 0.21.3", + "darling", "ident_case", "prettyplease", "proc-macro2", @@ -1462,6 +1462,22 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "cratesfyi" +version = "0.6.0" +dependencies = [ + "anyhow", + "clap", + "docs_rs_builder", + "docs_rs_context", + "docs_rs_logging", + "docs_rs_utils", + "docs_rs_watcher", + "docs_rs_web", + "tokio", + "tracing", +] + [[package]] name = "crc" version = "3.4.0" @@ -1694,38 +1710,14 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - [[package]] name = "darling" version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.111", + "darling_core", + "darling_macro", ] [[package]] @@ -1742,24 +1734,13 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn 2.0.111", -] - [[package]] name = "darling_macro" version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ - "darling_core 0.21.3", + "darling_core", "quote", "syn 2.0.111", ] @@ -1830,37 +1811,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "derive_builder" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.111", -] - -[[package]] -name = "derive_builder_macro" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" -dependencies = [ - "derive_builder_core", - "syn 2.0.111", -] - [[package]] name = "derive_more" version = "0.99.20" @@ -1943,37 +1893,24 @@ dependencies = [ ] [[package]] -name = "docs-rs" +name = "docs_rs_admin" version = "0.6.0" dependencies = [ "anyhow", "chrono", "clap", - "derive_builder", "docs_rs_build_limits", "docs_rs_build_queue", "docs_rs_builder", - "docs_rs_cargo_metadata", "docs_rs_context", "docs_rs_database", - "docs_rs_fastly", - "docs_rs_headers", "docs_rs_logging", - "docs_rs_opentelemetry", - "docs_rs_registry_api", - "docs_rs_repository_stats", - "docs_rs_storage", "docs_rs_types", "docs_rs_utils", "docs_rs_watcher", - "docs_rs_web", "futures-util", - "opentelemetry_sdk", - "rand 0.9.2", "sqlx", "tokio", - "tower", - "tracing", ] [[package]] @@ -2013,7 +1950,7 @@ dependencies = [ [[package]] name = "docs_rs_builder" -version = "0.1.0" +version = "0.6.0" dependencies = [ "anyhow", "clap", @@ -2341,7 +2278,7 @@ dependencies = [ [[package]] name = "docs_rs_watcher" -version = "0.1.0" +version = "0.6.0" dependencies = [ "anyhow", "chrono", @@ -2373,7 +2310,7 @@ dependencies = [ [[package]] name = "docs_rs_web" -version = "0.1.0" +version = "0.6.0" dependencies = [ "anyhow", "askama", @@ -6803,7 +6740,7 @@ version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" dependencies = [ - "darling 0.21.3", + "darling", "proc-macro2", "quote", "syn 2.0.111", diff --git a/Cargo.toml b/Cargo.toml index 86b2a9d4c..dcc271b0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,23 +1,25 @@ -[package] -name = "docs-rs" -version = "0.6.0" -authors = ["Onur Aslan ", "The Rust Project Developers"] -readme = "README.md" -license = "MIT" -repository = "https://github.com/rust-lang/docs.rs" -edition = "2024" - [workspace] resolver = "2" + members = [ "crates/bin/*", "crates/lib/*", ] + +default-members = [ + "crates/bin/docs_rs_admin", + "crates/bin/docs_rs_builder", + "crates/bin/docs_rs_watcher", + "crates/bin/docs_rs_web", +] + exclude = [ - "ignored", - "tests", - ".workspace", ".rustwide-docker", + ".workspace", + "crates/bin/docs_rs_builder/.rustwide-docker", + "crates/bin/docs_rs_builder/.workspace", + "crates/bin/docs_rs_builder/tests/crates", + "ignored", ] [workspace.dependencies] @@ -60,49 +62,3 @@ toml = "0.9.2" tracing = "0.1.37" url = { version = "2.1.1", features = ["serde"] } walkdir = "2" - -[dependencies] -docs_rs_build_limits = { path = "crates/lib/docs_rs_build_limits" } -docs_rs_build_queue = { path = "crates/lib/docs_rs_build_queue" } -docs_rs_builder = { path = "crates/bin/docs_rs_builder" } -docs_rs_context = { path = "crates/lib/docs_rs_context" } -docs_rs_database = { path = "crates/lib/docs_rs_database" } -docs_rs_fastly = { path = "crates/lib/docs_rs_fastly" } -docs_rs_logging = { path = "crates/lib/docs_rs_logging" } -docs_rs_opentelemetry = { path = "crates/lib/docs_rs_opentelemetry" } -docs_rs_registry_api = { path = "crates/lib/docs_rs_registry_api" } -docs_rs_repository_stats = { path = "crates/lib/docs_rs_repository_stats" } -docs_rs_storage = { path = "crates/lib/docs_rs_storage" } -docs_rs_types = { path = "crates/lib/docs_rs_types" } -docs_rs_utils = { path = "crates/lib/docs_rs_utils" } -docs_rs_watcher = { path = "crates/bin/docs_rs_watcher" } -docs_rs_web = { path = "crates/bin/docs_rs_web" } - -anyhow = { workspace = true } -tracing = { workspace = true } -chrono = { workspace = true } -clap = { workspace = true } -tokio = { workspace = true } -derive_builder = "0.20.2" -futures-util = { workspace = true } -sqlx = { workspace = true } - -[dev-dependencies] -docs_rs_build_queue = { path = "crates/lib/docs_rs_build_queue", features = ["testing"] } -docs_rs_builder = { path = "crates/bin/docs_rs_builder", features = ["testing"] } -docs_rs_cargo_metadata = { path = "crates/lib/docs_rs_cargo_metadata", features = ["testing"] } -docs_rs_database = { path = "crates/lib/docs_rs_database", features = ["testing"] } -docs_rs_fastly = { path = "crates/lib/docs_rs_fastly", features = ["testing"] } -docs_rs_headers = { path = "crates/lib/docs_rs_headers", features = ["testing"] } -docs_rs_opentelemetry = { path = "crates/lib/docs_rs_opentelemetry", features = ["testing"] } -docs_rs_storage = { path = "crates/lib/docs_rs_storage", features = ["testing"] } -docs_rs_types = { path = "crates/lib/docs_rs_types", features = ["testing"] } - -rand = { workspace = true } -tower = { version = "0.5.1", features = ["util"] } -opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio", "testing"] } - -[[bin]] -name = "cratesfyi" -test = false -doc = false diff --git a/crates/bin/cratesfyi/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json b/crates/bin/cratesfyi/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json new file mode 100644 index 000000000..253c81642 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM releases WHERE crate_id = $1 AND version = $2 RETURNING is_library", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "is_library", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-05bc6ad8a62d65aeedfff6c4a10a8d09ff86b671b31668bb2571b151206ef7f5.json b/crates/bin/cratesfyi/.sqlx/query-05bc6ad8a62d65aeedfff6c4a10a8d09ff86b671b31668bb2571b151206ef7f5.json new file mode 100644 index 000000000..66bade59a --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-05bc6ad8a62d65aeedfff6c4a10a8d09ff86b671b31668bb2571b151206ef7f5.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n crates.name as \"name: KrateName\",\n releases.version,\n releases.description,\n releases.target_name,\n releases.rustdoc_status,\n releases.default_target,\n releases.doc_targets,\n releases.yanked,\n builds.rustc_version as \"rustc_version?\"\n FROM releases\n INNER JOIN crates ON crates.id = releases.crate_id\n LEFT JOIN LATERAL (\n SELECT * FROM builds\n WHERE builds.rid = releases.id\n ORDER BY builds.build_finished\n DESC LIMIT 1\n ) AS builds ON true\n WHERE crates.name = $1 AND releases.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "description", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 5, + "name": "default_target", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "doc_targets", + "type_info": "Json" + }, + { + "ordinal": 7, + "name": "yanked", + "type_info": "Bool" + }, + { + "ordinal": 8, + "name": "rustc_version?", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "05bc6ad8a62d65aeedfff6c4a10a8d09ff86b671b31668bb2571b151206ef7f5" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json b/crates/bin/cratesfyi/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json new file mode 100644 index 000000000..4c95721d1 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM owner_rels\n WHERE\n cid = $1 AND\n NOT (oid = ANY($2))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json b/crates/bin/cratesfyi/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json new file mode 100644 index 000000000..fa8db5d2f --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO compression_rels (release, algorithm)\n VALUES ($1, $2)\n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json b/crates/bin/cratesfyi/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json new file mode 100644 index 000000000..fd127620f --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO crate_priorities (pattern, priority) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json b/crates/bin/cratesfyi/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json new file mode 100644 index 000000000..14efdbfd4 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue\n SET priority = GREATEST(priority, $1)\n WHERE\n name = $2\n AND version != $3\n AND attempt < $4\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-1be3826465e3cd76738b3bfc9d46df14795d1f18830783080bf3a58b909ab16a.json b/crates/bin/cratesfyi/.sqlx/query-1be3826465e3cd76738b3bfc9d46df14795d1f18830783080bf3a58b909ab16a.json new file mode 100644 index 000000000..1cac273c1 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-1be3826465e3cd76738b3bfc9d46df14795d1f18830783080bf3a58b909ab16a.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH params AS (\n -- get maximum possible id-value in crates-table\n SELECT last_value AS max_id FROM crates_id_seq\n )\n SELECT\n crates.name as \"name: KrateName\",\n releases.version as \"version: Version\",\n releases.target_name\n FROM (\n -- generate random numbers in the ID-range.\n SELECT DISTINCT 1 + trunc(random() * params.max_id)::INTEGER AS id\n FROM params, generate_series(1, $1)\n ) AS r\n INNER JOIN crates ON r.id = crates.id\n INNER JOIN releases ON crates.latest_version_id = releases.id\n INNER JOIN repositories ON releases.repository_id = repositories.id\n WHERE\n releases.rustdoc_status = TRUE AND\n repositories.stars >= 100\n LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "target_name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + true + ] + }, + "hash": "1be3826465e3cd76738b3bfc9d46df14795d1f18830783080bf3a58b909ab16a" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json b/crates/bin/cratesfyi/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json new file mode 100644 index 000000000..e1bcf20ab --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE crates\n SET latest_version_id = $2\n WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json b/crates/bin/cratesfyi/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json new file mode 100644 index 000000000..6d4f685e9 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE builds\n SET\n rustc_version = $1,\n docsrs_version = $2,\n build_status = $3,\n build_server = $4,\n errors = $5,\n documentation_size = $6,\n rustc_nightly_date = $7,\n build_finished = NOW()\n WHERE\n id = $8\n RETURNING rid as \"rid: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rid: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text", + "Text", + "Int8", + "Date", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json b/crates/bin/cratesfyi/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json new file mode 100644 index 000000000..a7edcc96f --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n BOOL_OR(releases.is_library) AS has_library\n FROM releases\n WHERE releases.crate_id = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "has_library", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null + ] + }, + "hash": "25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-2b8b1aae3740a05cb7179be9c7d5af30e8362c3cba0b07bc18fa32ff1a2232cc.json b/crates/bin/cratesfyi/.sqlx/query-2b8b1aae3740a05cb7179be9c7d5af30e8362c3cba0b07bc18fa32ff1a2232cc.json new file mode 100644 index 000000000..d4b4d31a5 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-2b8b1aae3740a05cb7179be9c7d5af30e8362c3cba0b07bc18fa32ff1a2232cc.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT releases.files\n FROM releases\n INNER JOIN crates ON crates.id = releases.crate_id\n WHERE crates.name = $1 AND releases.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "files", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "2b8b1aae3740a05cb7179be9c7d5af30e8362c3cba0b07bc18fa32ff1a2232cc" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json b/crates/bin/cratesfyi/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json new file mode 100644 index 000000000..f091d6c52 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.* FROM (\n SELECT\n c.name as \"name: KrateName\",\n r.version as \"version: Version\",\n (\n SELECT MAX(COALESCE(b.build_finished, b.build_started))\n FROM builds AS b\n WHERE b.rid = r.id\n ) AS last_build_attempt\n FROM crates AS c\n INNER JOIN releases AS r ON c.latest_version_id = r.id\n\n WHERE\n r.rustdoc_status = TRUE\n ) as i\n ORDER BY i.last_build_attempt ASC\n LIMIT $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "last_build_attempt", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + false, + null + ] + }, + "hash": "2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json b/crates/bin/cratesfyi/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json new file mode 100644 index 000000000..b76453c01 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO crates (name)\n VALUES ($1)\n ON CONFLICT (name) DO UPDATE\n SET -- this `SET` is needed so the id is always returned.\n name = EXCLUDED.name\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json b/crates/bin/cratesfyi/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json new file mode 100644 index 000000000..c7752a36e --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT slug FROM keywords WHERE slug = ANY($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "slug", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "TextArray" + ] + }, + "nullable": [ + false + ] + }, + "hash": "38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json b/crates/bin/cratesfyi/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json new file mode 100644 index 000000000..ab68991d0 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO keyword_rels (rid, kid)\n SELECT $1 as rid, id as kid\n FROM keywords\n WHERE slug = ANY($2)\n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "TextArray" + ] + }, + "nullable": [] + }, + "hash": "3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json b/crates/bin/cratesfyi/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json new file mode 100644 index 000000000..aed78ccde --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: CrateId\" FROM crates WHERE crates.name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json b/crates/bin/cratesfyi/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json new file mode 100644 index 000000000..a88c69335 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT host_id\n FROM repositories\n WHERE host = $1 AND updated_at < NOW() - INTERVAL '1 day';", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "host_id", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json b/crates/bin/cratesfyi/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json new file mode 100644 index 000000000..ca0a44f4b --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json @@ -0,0 +1,87 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n releases.id as \"id: ReleaseId\",\n releases.version as \"version: Version\",\n release_build_status.build_status as \"build_status!: BuildStatus\",\n releases.yanked,\n releases.is_library,\n releases.rustdoc_status,\n releases.release_time,\n releases.target_name,\n releases.default_target,\n releases.doc_targets\n FROM releases\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n WHERE\n releases.crate_id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ReleaseId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "build_status!: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "yanked", + "type_info": "Bool" + }, + { + "ordinal": 4, + "name": "is_library", + "type_info": "Bool" + }, + { + "ordinal": 5, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 6, + "name": "release_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 8, + "name": "default_target", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "doc_targets", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json b/crates/bin/cratesfyi/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json new file mode 100644 index 000000000..ae5a0b475 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n id,\n name as \"name: KrateName\",\n version as \"version: Version\",\n priority,\n registry,\n attempt\n FROM queue\n WHERE\n attempt < $1 AND\n (last_attempt IS NULL OR last_attempt < NOW() - make_interval(secs => $2))\n ORDER BY priority ASC, attempt ASC, id ASC\n LIMIT 1\n FOR UPDATE SKIP LOCKED", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 4, + "name": "registry", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + false + ] + }, + "hash": "48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json b/crates/bin/cratesfyi/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json new file mode 100644 index 000000000..cf141db65 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO doc_coverage (\n release_id, total_items, documented_items,\n total_items_needing_examples, items_with_examples\n )\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (release_id) DO UPDATE\n SET\n total_items = $2,\n documented_items = $3,\n total_items_needing_examples = $4,\n items_with_examples = $5\n RETURNING release_id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "release_id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json b/crates/bin/cratesfyi/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json new file mode 100644 index 000000000..530c4d879 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO config (name, value)\n VALUES ($1, $2)\n ON CONFLICT (name) DO UPDATE SET value = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Json" + ] + }, + "nullable": [] + }, + "hash": "4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json b/crates/bin/cratesfyi/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json new file mode 100644 index 000000000..6d306761e --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE\n FROM queue\n WHERE\n name = $1 AND\n version = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json b/crates/bin/cratesfyi/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json new file mode 100644 index 000000000..dd15d3dde --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO releases (crate_id, version, archive_storage)\n VALUES ($1, $2, TRUE)\n ON CONFLICT (crate_id, version) DO UPDATE\n SET -- this `SET` is needed so the id is always returned.\n version = EXCLUDED.version\n RETURNING id as \"id: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json b/crates/bin/cratesfyi/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json new file mode 100644 index 000000000..a95b272dd --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM crates WHERE crates.name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-543694448dbb43af41dc18c29017c5b211f45f7722811fdcabea26f796d4514b.json b/crates/bin/cratesfyi/.sqlx/query-543694448dbb43af41dc18c29017c5b211f45f7722811fdcabea26f796d4514b.json new file mode 100644 index 000000000..d3de58075 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-543694448dbb43af41dc18c29017c5b211f45f7722811fdcabea26f796d4514b.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n crates.name as \"name: KrateName\",\n releases.version as \"version: Version\",\n releases.description,\n release_build_status.last_build_time,\n releases.target_name,\n releases.rustdoc_status,\n repositories.stars as \"stars?\",\n EXISTS (\n SELECT 1\n FROM releases AS all_releases\n WHERE\n all_releases.crate_id = crates.id AND\n all_releases.yanked = false\n ) AS has_unyanked_releases\n\n FROM crates\n INNER JOIN releases ON crates.latest_version_id = releases.id\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n LEFT JOIN repositories ON releases.repository_id = repositories.id\n\n WHERE\n crates.name = ANY($1) AND\n release_build_status.build_status <> 'in_progress'", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "description", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "last_build_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 6, + "name": "stars?", + "type_info": "Int4" + }, + { + "ordinal": 7, + "name": "has_unyanked_releases", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "TextArray" + ] + }, + "nullable": [ + false, + false, + true, + true, + true, + true, + false, + null + ] + }, + "hash": "543694448dbb43af41dc18c29017c5b211f45f7722811fdcabea26f796d4514b" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json b/crates/bin/cratesfyi/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json new file mode 100644 index 000000000..cd88562f2 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO keywords (name, slug) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json b/crates/bin/cratesfyi/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json new file mode 100644 index 000000000..264e19fd2 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT value FROM config WHERE name = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "value", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json b/crates/bin/cratesfyi/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json new file mode 100644 index 000000000..cc79bd27a --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET repository_id = $1 WHERE id = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json b/crates/bin/cratesfyi/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json new file mode 100644 index 000000000..92b428002 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json @@ -0,0 +1,61 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases\n SET release_time = $2,\n dependencies = $3,\n target_name = $4,\n yanked = $5,\n rustdoc_status = $6,\n test_status = $7,\n license = $8,\n repository_url = $9,\n homepage_url = $10,\n description = $11,\n description_long = $12,\n readme = $13,\n keywords = $14,\n have_examples = $15,\n downloads = $16,\n files = $17,\n doc_targets = $18,\n is_library = $19,\n documentation_url = $20,\n default_target = $21,\n features = $22,\n repository_id = $23,\n archive_storage = $24,\n source_size = $25\n WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Timestamptz", + "Json", + "Varchar", + "Bool", + "Bool", + "Bool", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Json", + "Bool", + "Int4", + "Json", + "Json", + "Bool", + "Varchar", + "Varchar", + { + "Custom": { + "name": "feature[]", + "kind": { + "Array": { + "Custom": { + "name": "feature", + "kind": { + "Composite": [ + [ + "name", + "Text" + ], + [ + "subfeatures", + "TextArray" + ] + ] + } + } + } + } + } + }, + "Int4", + "Bool", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json b/crates/bin/cratesfyi/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json new file mode 100644 index 000000000..dcc82bf13 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO blacklisted_crates (crate_name) VALUES ($1);", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json b/crates/bin/cratesfyi/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json new file mode 100644 index 000000000..032419e27 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO repositories (\n host, host_id, name, description, last_commit, stars, forks, issues, updated_at\n ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, NOW())\n ON CONFLICT (host, host_id) DO\n UPDATE SET\n name = $3,\n description = $4,\n last_commit = $5,\n stars = $6,\n forks = $7,\n issues = $8,\n updated_at = NOW()\n RETURNING id;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Timestamptz", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json b/crates/bin/cratesfyi/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json new file mode 100644 index 000000000..6f21daee0 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO sandbox_overrides (\n crate_name, max_memory_bytes, max_targets, timeout_seconds\n )\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (crate_name) DO UPDATE\n SET\n max_memory_bytes = $2,\n max_targets = $3,\n timeout_seconds = $4\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int8", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json b/crates/bin/cratesfyi/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json new file mode 100644 index 000000000..55b209a3f --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO queue (name, version, priority, registry)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (name, version) DO UPDATE\n SET priority = EXCLUDED.priority,\n registry = EXCLUDED.registry,\n attempt = 0,\n last_attempt = NULL\n ;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json b/crates/bin/cratesfyi/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json new file mode 100644 index 000000000..1928a3804 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO release_build_status(rid, last_build_time, build_status)\n SELECT\n summary.id,\n summary.last_build_time,\n CASE\n WHEN summary.success_count > 0 THEN 'success'::build_status\n WHEN summary.failure_count > 0 THEN 'failure'::build_status\n ELSE 'in_progress'::build_status\n END as build_status\n\n FROM (\n SELECT\n r.id,\n MAX(b.build_finished) as last_build_time,\n SUM(CASE WHEN b.build_status = 'success' THEN 1 ELSE 0 END) as success_count,\n SUM(CASE WHEN b.build_status = 'failure' THEN 1 ELSE 0 END) as failure_count\n FROM\n releases as r\n LEFT OUTER JOIN builds AS b on b.rid = r.id\n WHERE\n r.id = $1\n GROUP BY r.id\n ) as summary\n\n ON CONFLICT (rid) DO UPDATE\n SET\n last_build_time = EXCLUDED.last_build_time,\n build_status=EXCLUDED.build_status", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json b/crates/bin/cratesfyi/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json new file mode 100644 index 000000000..59d4a4eaf --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n id,\n name as \"name: KrateName\",\n version as \"version: Version\",\n priority,\n registry,\n attempt\n FROM queue\n WHERE attempt < $1\n ORDER BY priority ASC, attempt ASC, id ASC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 4, + "name": "registry", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + false + ] + }, + "hash": "7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json b/crates/bin/cratesfyi/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json new file mode 100644 index 000000000..60bddfbca --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT crate_id as \"crate_id: CrateId\"\n FROM releases\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json b/crates/bin/cratesfyi/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json new file mode 100644 index 000000000..e178e2e36 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM crates WHERE id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json b/crates/bin/cratesfyi/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json new file mode 100644 index 000000000..cc5d0f370 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM blacklisted_crates WHERE crate_name = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json b/crates/bin/cratesfyi/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json new file mode 100644 index 000000000..8aedc7865 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO owners (login, avatar, kind)\n VALUES ($1, $2, $3)\n ON CONFLICT (login) DO UPDATE\n SET\n avatar = EXCLUDED.avatar,\n kind = EXCLUDED.kind\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Text", + { + "Custom": { + "name": "owner_kind", + "kind": { + "Enum": [ + "user", + "team" + ] + } + } + } + ] + }, + "nullable": [ + false + ] + }, + "hash": "87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json b/crates/bin/cratesfyi/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json new file mode 100644 index 000000000..79feba8ee --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n name as \"name!: KrateName\",\n version as \"version!: Version\",\n yanked\n FROM (\n SELECT\n crates.name,\n releases.version,\n releases.yanked\n FROM crates\n INNER JOIN releases ON releases.crate_id = crates.id\n UNION ALL\n -- crates & releases that are already queued\n -- don't have to be requeued.\n SELECT\n queue.name,\n queue.version,\n NULL as yanked\n FROM queue\n LEFT OUTER JOIN crates ON crates.name = queue.name\n LEFT OUTER JOIN releases ON (\n releases.crate_id = crates.id AND\n releases.version = queue.version\n )\n WHERE queue.attempt < $1 AND (\n crates.id IS NULL OR\n releases.id IS NULL\n )\n ) AS inp\n ORDER BY name", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name!: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version!: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "yanked", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null, + null, + null + ] + }, + "hash": "89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json b/crates/bin/cratesfyi/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json new file mode 100644 index 000000000..9af771395 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT pattern, priority FROM crate_priorities", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "pattern", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json b/crates/bin/cratesfyi/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json new file mode 100644 index 000000000..76a6e7969 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases\n SET yanked = $3\n FROM crates\n WHERE crates.id = releases.crate_id\n AND name = $1\n AND version = $2\n RETURNING crates.id as \"id: CrateId\"\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Bool" + ] + }, + "nullable": [ + false + ] + }, + "hash": "8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json b/crates/bin/cratesfyi/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json new file mode 100644 index 000000000..7e7ce93f0 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT pattern, priority FROM crate_priorities WHERE $1 LIKE pattern LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "pattern", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json b/crates/bin/cratesfyi/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json new file mode 100644 index 000000000..5745997b7 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT id as \"id: CrateId\"\n FROM crates\n WHERE normalize_crate_name(name) = normalize_crate_name($1)\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar" + ] + }, + "nullable": [ + false + ] + }, + "hash": "92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json b/crates/bin/cratesfyi/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json new file mode 100644 index 000000000..80e74ab5f --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM owner_rels WHERE cid = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json b/crates/bin/cratesfyi/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json new file mode 100644 index 000000000..312fd50c3 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO owner_rels (cid, oid)\n SELECT $1,oid\n FROM UNNEST($2::int[]) as oid\n ON CONFLICT (cid,oid)\n DO NOTHING", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json b/crates/bin/cratesfyi/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json new file mode 100644 index 000000000..33a64a917 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT releases.id, crates.name, releases.version, releases.repository_url\n FROM releases\n INNER JOIN crates ON (crates.id = releases.crate_id)\n WHERE repository_id IS NULL AND repository_url LIKE $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "repository_url", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true + ] + }, + "hash": "97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json b/crates/bin/cratesfyi/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json new file mode 100644 index 000000000..fff5127ec --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue\n SET\n attempt = attempt + 1,\n last_attempt = NOW()\n WHERE id = $1\n RETURNING attempt;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-a0253cf77dc601990a9b972f4efebae94787e8cf83c956638ee7d3ce7f137299.json b/crates/bin/cratesfyi/.sqlx/query-a0253cf77dc601990a9b972f4efebae94787e8cf83c956638ee7d3ce7f137299.json new file mode 100644 index 000000000..220a71c4e --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-a0253cf77dc601990a9b972f4efebae94787e8cf83c956638ee7d3ce7f137299.json @@ -0,0 +1,32 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH dates AS (\n -- we need this series so that days in the statistic that don't have any releases are included\n SELECT generate_series(\n CURRENT_DATE - INTERVAL '30 days',\n CURRENT_DATE - INTERVAL '1 day',\n '1 day'::interval\n )::date AS date_\n ),\n release_stats AS (\n SELECT\n release_time::date AS date_,\n SUM(CAST(\n release_build_status.build_status != 'in_progress' AS INT\n )) AS counts,\n SUM(CAST((\n is_library = TRUE AND\n release_build_status.build_status = 'failure'\n ) AS INT)) AS failures\n FROM releases\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n\n WHERE\n release_time >= CURRENT_DATE - INTERVAL '30 days' AND\n release_time < CURRENT_DATE\n GROUP BY\n release_time::date\n )\n SELECT\n dates.date_ AS \"date!\",\n COALESCE(rs.counts, 0) AS \"counts!\",\n COALESCE(rs.failures, 0) AS \"failures!\"\n FROM\n dates\n LEFT OUTER JOIN Release_stats AS rs ON dates.date_ = rs.date_\n\n ORDER BY\n dates.date_\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "date!", + "type_info": "Date" + }, + { + "ordinal": 1, + "name": "counts!", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "failures!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null, + null, + null + ] + }, + "hash": "a0253cf77dc601990a9b972f4efebae94787e8cf83c956638ee7d3ce7f137299" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-a2c5c46a3e0058c3bd23d62f1844e3ca5d6b118da33795449e9386525eea912f.json b/crates/bin/cratesfyi/.sqlx/query-a2c5c46a3e0058c3bd23d62f1844e3ca5d6b118da33795449e9386525eea912f.json new file mode 100644 index 000000000..b54abcdb0 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-a2c5c46a3e0058c3bd23d62f1844e3ca5d6b118da33795449e9386525eea912f.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n builds.rustc_version,\n builds.docsrs_version,\n builds.build_status as \"build_status: BuildStatus\",\n COALESCE(builds.build_finished, builds.build_started) as build_time,\n builds.output,\n builds.errors,\n releases.default_target\n FROM builds\n INNER JOIN releases ON releases.id = builds.rid\n INNER JOIN crates ON releases.crate_id = crates.id\n WHERE builds.id = $1 AND crates.name = $2 AND releases.version = $3", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "build_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "output", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "errors", + "type_info": "Text" + }, + { + "ordinal": 6, + "name": "default_target", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text" + ] + }, + "nullable": [ + true, + true, + false, + null, + true, + true, + true + ] + }, + "hash": "a2c5c46a3e0058c3bd23d62f1844e3ca5d6b118da33795449e9386525eea912f" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json b/crates/bin/cratesfyi/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json new file mode 100644 index 000000000..87fe73890 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM sandbox_overrides WHERE crate_name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "max_memory_bytes", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "timeout_seconds", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "max_targets", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + true, + true, + true + ] + }, + "hash": "a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json b/crates/bin/cratesfyi/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json new file mode 100644 index 000000000..9439ea53a --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO builds(rid, build_status, build_server, build_started)\n VALUES ($1, $2, $3, NOW())\n RETURNING id as \"id: BuildId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: BuildId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json b/crates/bin/cratesfyi/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json new file mode 100644 index 000000000..4f561d6a6 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n priority,\n COUNT(*) as \"count!\"\n FROM queue\n WHERE attempt < $1\n GROUP BY priority", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "count!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + null + ] + }, + "hash": "a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json b/crates/bin/cratesfyi/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json new file mode 100644 index 000000000..d800017a7 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM releases WHERE crate_id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-b7d805d65e97349dde8ac57e176bc92ae7ef49af5b09b0fc532f763947bd1aee.json b/crates/bin/cratesfyi/.sqlx/query-b7d805d65e97349dde8ac57e176bc92ae7ef49af5b09b0fc532f763947bd1aee.json new file mode 100644 index 000000000..26969a794 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-b7d805d65e97349dde8ac57e176bc92ae7ef49af5b09b0fc532f763947bd1aee.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n builds.id as \"id: BuildId\",\n builds.rustc_version,\n builds.docsrs_version,\n builds.build_status as \"build_status: BuildStatus\",\n COALESCE(builds.build_finished, builds.build_started) as build_time,\n builds.errors\n FROM builds\n INNER JOIN releases ON releases.id = builds.rid\n INNER JOIN crates ON releases.crate_id = crates.id\n WHERE\n crates.name = $1 AND\n releases.version = $2\n ORDER BY builds.id DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: BuildId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "rustc_version", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "docsrs_version", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 4, + "name": "build_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 5, + "name": "errors", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + true, + true, + false, + null, + true + ] + }, + "hash": "b7d805d65e97349dde8ac57e176bc92ae7ef49af5b09b0fc532f763947bd1aee" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json b/crates/bin/cratesfyi/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json new file mode 100644 index 000000000..b76920724 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM queue WHERE id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json b/crates/bin/cratesfyi/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json new file mode 100644 index 000000000..5dc057abf --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM crate_priorities WHERE pattern = $1 RETURNING priority", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json b/crates/bin/cratesfyi/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json new file mode 100644 index 000000000..4200b5330 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM repositories WHERE name = $1 AND host = $2 LIMIT 1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-cf5426dc0b94b07b8aea1fde144bbbb3caa1e6ebfb5d9348f5d27a134b82a55c.json b/crates/bin/cratesfyi/.sqlx/query-cf5426dc0b94b07b8aea1fde144bbbb3caa1e6ebfb5d9348f5d27a134b82a55c.json new file mode 100644 index 000000000..0cfc44e90 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-cf5426dc0b94b07b8aea1fde144bbbb3caa1e6ebfb5d9348f5d27a134b82a55c.json @@ -0,0 +1,244 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n crates.id AS \"crate_id: CrateId\",\n releases.id AS \"release_id: ReleaseId\",\n crates.name as \"name: KrateName\",\n releases.version,\n releases.description,\n releases.dependencies,\n releases.readme,\n releases.description_long,\n releases.release_time,\n release_build_status.build_status as \"build_status!: BuildStatus\",\n -- this is the latest build ID that generated content\n -- it's used to invalidate some blob storage related caches.\n builds.id as \"latest_build_id?: BuildId\",\n releases.rustdoc_status,\n releases.archive_storage,\n releases.repository_url,\n releases.homepage_url,\n releases.keywords,\n releases.have_examples,\n releases.target_name,\n repositories.host as \"repo_host?\",\n repositories.stars as \"repo_stars?\",\n repositories.forks as \"repo_forks?\",\n repositories.issues as \"repo_issues?\",\n repositories.name as \"repo_name?\",\n releases.is_library,\n releases.yanked,\n releases.doc_targets,\n releases.license,\n releases.documentation_url,\n releases.default_target,\n releases.source_size as \"source_size?\",\n builds.documentation_size as \"documentation_size?\",\n -- we're using the rustc version here to set the correct CSS file\n -- in the metadata.\n -- So we're only interested in successful builds here.\n builds.rustc_version as \"rustc_version?\",\n doc_coverage.total_items,\n doc_coverage.documented_items,\n doc_coverage.total_items_needing_examples,\n doc_coverage.items_with_examples\n FROM releases\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n INNER JOIN crates ON releases.crate_id = crates.id\n LEFT JOIN doc_coverage ON doc_coverage.release_id = releases.id\n LEFT JOIN repositories ON releases.repository_id = repositories.id\n LEFT JOIN LATERAL (\n SELECT rustc_version, documentation_size, id\n FROM builds\n WHERE\n builds.rid = releases.id AND\n builds.build_status = 'success'\n ORDER BY builds.build_finished\n DESC LIMIT 1\n ) AS builds ON true\n WHERE crates.name = $1 AND releases.version = $2;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_id: CrateId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "release_id: ReleaseId", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "version", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "description", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "dependencies", + "type_info": "Json" + }, + { + "ordinal": 6, + "name": "readme", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "description_long", + "type_info": "Varchar" + }, + { + "ordinal": 8, + "name": "release_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 9, + "name": "build_status!: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 10, + "name": "latest_build_id?: BuildId", + "type_info": "Int4" + }, + { + "ordinal": 11, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 12, + "name": "archive_storage", + "type_info": "Bool" + }, + { + "ordinal": 13, + "name": "repository_url", + "type_info": "Varchar" + }, + { + "ordinal": 14, + "name": "homepage_url", + "type_info": "Varchar" + }, + { + "ordinal": 15, + "name": "keywords", + "type_info": "Json" + }, + { + "ordinal": 16, + "name": "have_examples", + "type_info": "Bool" + }, + { + "ordinal": 17, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 18, + "name": "repo_host?", + "type_info": "Varchar" + }, + { + "ordinal": 19, + "name": "repo_stars?", + "type_info": "Int4" + }, + { + "ordinal": 20, + "name": "repo_forks?", + "type_info": "Int4" + }, + { + "ordinal": 21, + "name": "repo_issues?", + "type_info": "Int4" + }, + { + "ordinal": 22, + "name": "repo_name?", + "type_info": "Varchar" + }, + { + "ordinal": 23, + "name": "is_library", + "type_info": "Bool" + }, + { + "ordinal": 24, + "name": "yanked", + "type_info": "Bool" + }, + { + "ordinal": 25, + "name": "doc_targets", + "type_info": "Json" + }, + { + "ordinal": 26, + "name": "license", + "type_info": "Varchar" + }, + { + "ordinal": 27, + "name": "documentation_url", + "type_info": "Varchar" + }, + { + "ordinal": 28, + "name": "default_target", + "type_info": "Varchar" + }, + { + "ordinal": 29, + "name": "source_size?", + "type_info": "Int8" + }, + { + "ordinal": 30, + "name": "documentation_size?", + "type_info": "Int8" + }, + { + "ordinal": 31, + "name": "rustc_version?", + "type_info": "Varchar" + }, + { + "ordinal": 32, + "name": "total_items", + "type_info": "Int4" + }, + { + "ordinal": 33, + "name": "documented_items", + "type_info": "Int4" + }, + { + "ordinal": 34, + "name": "total_items_needing_examples", + "type_info": "Int4" + }, + { + "ordinal": 35, + "name": "items_with_examples", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + true, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "cf5426dc0b94b07b8aea1fde144bbbb3caa1e6ebfb5d9348f5d27a134b82a55c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json b/crates/bin/cratesfyi/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json new file mode 100644 index 000000000..6bfe26455 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM repositories WHERE host_id = $1 AND host = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json b/crates/bin/cratesfyi/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json new file mode 100644 index 000000000..ba6be127c --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT COUNT(*) as \"count!\" FROM queue WHERE attempt >= $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "count!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null + ] + }, + "hash": "d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d2c3a85119eea791d48d035c4593b0fd730a139cb52ae92ac16cd662286dbe20.json b/crates/bin/cratesfyi/.sqlx/query-d2c3a85119eea791d48d035c4593b0fd730a139cb52ae92ac16cd662286dbe20.json new file mode 100644 index 000000000..9df1cfcd5 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d2c3a85119eea791d48d035c4593b0fd730a139cb52ae92ac16cd662286dbe20.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n releases.archive_storage,\n (\n SELECT id\n FROM builds\n WHERE\n builds.rid = releases.id AND\n builds.build_status = 'success'\n ORDER BY build_finished DESC\n LIMIT 1\n ) AS \"latest_build_id?: BuildId\"\n FROM releases\n INNER JOIN crates ON releases.crate_id = crates.id\n WHERE\n name = $1 AND\n version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "archive_storage", + "type_info": "Bool" + }, + { + "ordinal": 1, + "name": "latest_build_id?: BuildId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + null + ] + }, + "hash": "d2c3a85119eea791d48d035c4593b0fd730a139cb52ae92ac16cd662286dbe20" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json b/crates/bin/cratesfyi/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json new file mode 100644 index 000000000..a5bdecf4a --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n crate_name as \"crate_name: KrateName\"\n FROM blacklisted_crates\n ORDER BY crate_name asc;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name: KrateName", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d5353f99e2f09d4264d925f26b70198ec623b7fc7a9f386dd108f2d0fcdab50c.json b/crates/bin/cratesfyi/.sqlx/query-d5353f99e2f09d4264d925f26b70198ec623b7fc7a9f386dd108f2d0fcdab50c.json new file mode 100644 index 000000000..f6a32d74b --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d5353f99e2f09d4264d925f26b70198ec623b7fc7a9f386dd108f2d0fcdab50c.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT 1 as \"dummy\"\n FROM releases\n INNER JOIN crates ON crates.id = releases.crate_id\n WHERE crates.name = $1 AND releases.version = $2\n LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "dummy", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "d5353f99e2f09d4264d925f26b70198ec623b7fc7a9f386dd108f2d0fcdab50c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json b/crates/bin/cratesfyi/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json new file mode 100644 index 000000000..154247910 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE builds\n SET\n build_status = $1,\n errors = $2\n WHERE id = $3\n RETURNING rid as \"rid: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rid: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d68c28ed8e41b9e3812d15e8447ad2ea418ce40868afa2fc51da3c77a3ca8d9c.json b/crates/bin/cratesfyi/.sqlx/query-d68c28ed8e41b9e3812d15e8447ad2ea418ce40868afa2fc51da3c77a3ca8d9c.json new file mode 100644 index 000000000..b5f790a93 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d68c28ed8e41b9e3812d15e8447ad2ea418ce40868afa2fc51da3c77a3ca8d9c.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n id as \"id: CrateId\",\n name as \"name: KrateName\"\n FROM crates\n WHERE normalize_crate_name(name) = normalize_crate_name($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name: KrateName", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Varchar" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "d68c28ed8e41b9e3812d15e8447ad2ea418ce40868afa2fc51da3c77a3ca8d9c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-d87220d3f4503e99fa17815db0058ab7883bf28f216d5b5fd720c56fd8889eed.json b/crates/bin/cratesfyi/.sqlx/query-d87220d3f4503e99fa17815db0058ab7883bf28f216d5b5fd720c56fd8889eed.json new file mode 100644 index 000000000..8c839d110 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-d87220d3f4503e99fa17815db0058ab7883bf28f216d5b5fd720c56fd8889eed.json @@ -0,0 +1,44 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT login, avatar, kind as \"kind: OwnerKind\"\n FROM owners\n INNER JOIN owner_rels ON owner_rels.oid = owners.id\n WHERE cid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "login", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "avatar", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "kind: OwnerKind", + "type_info": { + "Custom": { + "name": "owner_kind", + "kind": { + "Enum": [ + "user", + "team" + ] + } + } + } + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "d87220d3f4503e99fa17815db0058ab7883bf28f216d5b5fd720c56fd8889eed" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json b/crates/bin/cratesfyi/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json new file mode 100644 index 000000000..8019026f4 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n c.name AS \"name: KrateName\",\n r.version AS \"version: Version\"\n FROM crates AS c\n JOIN releases AS r\n ON c.id = r.crate_id\n JOIN release_build_status AS rbs\n ON rbs.rid = r.id\n JOIN builds AS b\n ON b.rid = r.id\n AND b.build_finished = rbs.last_build_time\n AND b.rustc_nightly_date >= $1\n AND b.rustc_nightly_date < $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Date", + "Date" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json b/crates/bin/cratesfyi/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json new file mode 100644 index 000000000..945d619af --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM sandbox_overrides WHERE crate_name = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-df1c002b7c4f5e2567eeefff56ee51003d90122f83429313966add5b224f5f6c.json b/crates/bin/cratesfyi/.sqlx/query-df1c002b7c4f5e2567eeefff56ee51003d90122f83429313966add5b224f5f6c.json new file mode 100644 index 000000000..ce7e21cd4 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-df1c002b7c4f5e2567eeefff56ee51003d90122f83429313966add5b224f5f6c.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT crates.name,\n releases.target_name,\n MAX(releases.release_time) as \"release_time!\"\n FROM crates\n INNER JOIN releases ON releases.crate_id = crates.id\n WHERE\n rustdoc_status = true AND\n crates.name ILIKE $1\n GROUP BY crates.name, releases.target_name\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "release_time!", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + true, + null + ] + }, + "hash": "df1c002b7c4f5e2567eeefff56ee51003d90122f83429313966add5b224f5f6c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-e0a18d6ec1e1a0d4e14a1f2e4e4e9e8985fe619d5a502d8428af509ba1b9d9b0.json b/crates/bin/cratesfyi/.sqlx/query-e0a18d6ec1e1a0d4e14a1f2e4e4e9e8985fe619d5a502d8428af509ba1b9d9b0.json new file mode 100644 index 000000000..7727acc22 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-e0a18d6ec1e1a0d4e14a1f2e4e4e9e8985fe619d5a502d8428af509ba1b9d9b0.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n releases.features as \"features?: Vec\",\n releases.dependencies\n FROM releases\n INNER JOIN crates ON crates.id = releases.crate_id\n WHERE crates.name = $1 AND releases.version = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "features?: Vec", + "type_info": { + "Custom": { + "name": "feature[]", + "kind": { + "Array": { + "Custom": { + "name": "feature", + "kind": { + "Composite": [ + [ + "name", + "Text" + ], + [ + "subfeatures", + "TextArray" + ] + ] + } + } + } + } + } + } + }, + { + "ordinal": 1, + "name": "dependencies", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + true, + true + ] + }, + "hash": "e0a18d6ec1e1a0d4e14a1f2e4e4e9e8985fe619d5a502d8428af509ba1b9d9b0" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-e1a95bfd43982d86a56cf542fde99a6e5a42e56aedf068a3acf39f923eb32ade.json b/crates/bin/cratesfyi/.sqlx/query-e1a95bfd43982d86a56cf542fde99a6e5a42e56aedf068a3acf39f923eb32ade.json new file mode 100644 index 000000000..c9bf149a6 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-e1a95bfd43982d86a56cf542fde99a6e5a42e56aedf068a3acf39f923eb32ade.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n crates.name as \"name: KrateName\",\n releases.version as \"version: Version\"\n FROM builds\n INNER JOIN releases ON releases.id = builds.rid\n INNER JOIN crates ON releases.crate_id = crates.id\n WHERE\n builds.build_status = 'in_progress'\n ORDER BY builds.id ASC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "e1a95bfd43982d86a56cf542fde99a6e5a42e56aedf068a3acf39f923eb32ade" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json b/crates/bin/cratesfyi/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json new file mode 100644 index 000000000..8699a9ded --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json @@ -0,0 +1,33 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT build_status AS \"build_status: BuildStatus\"\n FROM release_build_status\n WHERE rid = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json b/crates/bin/cratesfyi/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json new file mode 100644 index 000000000..150257361 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT 1 FROM blacklisted_crates WHERE crate_name = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "?column?", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json b/crates/bin/cratesfyi/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json new file mode 100644 index 000000000..403de85f9 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id\n FROM queue\n WHERE\n attempt < $1 AND\n name = $2 AND\n version = $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json b/crates/bin/cratesfyi/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json new file mode 100644 index 000000000..937d9c012 --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE\n FROM queue\n WHERE name = $1\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00" +} diff --git a/crates/bin/cratesfyi/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json b/crates/bin/cratesfyi/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json new file mode 100644 index 000000000..4223b877d --- /dev/null +++ b/crates/bin/cratesfyi/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json @@ -0,0 +1,38 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n crate_name as \"crate_name: KrateName\",\n max_memory_bytes,\n timeout_seconds,\n max_targets\n FROM sandbox_overrides\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name: KrateName", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "max_memory_bytes", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "timeout_seconds", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "max_targets", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + true, + true, + true + ] + }, + "hash": "fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8" +} diff --git a/crates/bin/cratesfyi/Cargo.toml b/crates/bin/cratesfyi/Cargo.toml new file mode 100644 index 000000000..65effa3cc --- /dev/null +++ b/crates/bin/cratesfyi/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "cratesfyi" +version = "0.6.0" +authors = ["Onur Aslan ", "The Rust Project Developers"] +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" +edition = "2024" + +[dependencies] +anyhow = { workspace = true } +clap = { workspace = true } +docs_rs_builder = { path = "../docs_rs_builder" } +docs_rs_context = { path = "../../lib/docs_rs_context" } +docs_rs_logging = { path = "../../lib/docs_rs_logging" } +docs_rs_utils = { path = "../../lib/docs_rs_utils" } +docs_rs_watcher = { path = "../docs_rs_watcher" } +docs_rs_web = { path = "../docs_rs_web" } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/src/utils/daemon.rs b/crates/bin/cratesfyi/src/daemon.rs similarity index 51% rename from src/utils/daemon.rs rename to crates/bin/cratesfyi/src/daemon.rs index d06abbed6..4621c030c 100644 --- a/src/utils/daemon.rs +++ b/crates/bin/cratesfyi/src/daemon.rs @@ -1,11 +1,6 @@ -//! Simple daemon -//! -//! This daemon will start web server, track new packages and build them - -use crate::Context; use anyhow::{Error, anyhow}; use docs_rs_builder::{RustwideBuilder, queue_builder}; -use docs_rs_context::Context as NewContext; +use docs_rs_context::Context; use docs_rs_watcher::{ start_background_queue_rebuild, start_background_repository_stats_updater, start_background_service_metric_collector, watch_registry, @@ -18,7 +13,7 @@ use tracing::info; fn start_registry_watcher( config: Arc, - context: Arc, + context: Arc, ) -> Result<(), Error> { let runtime = context.runtime.clone(); runtime.spawn(async move { @@ -31,54 +26,47 @@ fn start_registry_watcher( Ok(()) } -pub fn start_daemon(context: Context, enable_registry_watcher: bool) -> Result<(), Error> { +pub fn start_daemon(context: Context) -> Result<(), Error> { let context = Arc::new(context); let runtime = context.runtime.clone(); - let new_context: Arc = Arc::new((&*context).into()); + + let web_config = Arc::new(docs_rs_web::Config::from_environment()?); + let watcher_config = Arc::new(docs_rs_watcher::Config::from_environment()?); + let builder_config = Arc::new(docs_rs_builder::Config::from_environment()?); // Start the web server before doing anything more expensive // Please check with an administrator before changing this (see #1172 for context). info!("Starting web server"); let webserver_thread = thread::spawn({ - let new_context = new_context.clone(); let context = context.clone(); - move || { - context.runtime.block_on(run_web_server( - None, - context.config.web.clone(), - new_context, - )) - } + let runtime = runtime.clone(); + move || runtime.block_on(run_web_server(None, web_config, context)) }); - if enable_registry_watcher { - // check new crates every minute - start_registry_watcher(context.config.watcher.clone(), new_context.clone())?; - } + // check new crates every minute + start_registry_watcher(watcher_config.clone(), context.clone())?; // build new crates every minute - let builder_config = context.config.builder.clone(); - let new_context: docs_rs_context::Context = (&*context).into(); - let new_context = Arc::new(new_context); - let rustwide_builder = RustwideBuilder::init(builder_config.clone(), &new_context)?; + let rustwide_builder = RustwideBuilder::init(builder_config.clone(), &context)?; thread::Builder::new() .name("build queue reader".to_string()) .spawn({ - let new_context = new_context.clone(); - move || queue_builder(&new_context, &builder_config, rustwide_builder).unwrap() + let context = context.clone(); + move || queue_builder(&context, &builder_config, rustwide_builder).unwrap() }) .unwrap(); - runtime.block_on(start_background_repository_stats_updater(&new_context))?; - runtime.block_on(start_background_queue_rebuild( - context.config.watcher.clone(), - &new_context.clone(), - ))?; + runtime.block_on(async { + start_background_repository_stats_updater(&context).await?; + start_background_queue_rebuild(watcher_config, &context.clone()).await?; + + // when people run the daemon, we assume the daemon is the one single process where + // we can collect the service metrics. + start_background_service_metric_collector(&context).await?; - // when people run the daemon, we assume the daemon is the one single process where - // we can collect the service metrics. - runtime.block_on(start_background_service_metric_collector(&new_context))?; + Ok::<(), Error>(()) + })?; // NOTE: if a error occurred earlier in `start_daemon`, the server will _not_ be joined - // instead it will get killed when the process exits. diff --git a/crates/bin/cratesfyi/src/lib.rs b/crates/bin/cratesfyi/src/lib.rs new file mode 100644 index 000000000..d6bbb0195 --- /dev/null +++ b/crates/bin/cratesfyi/src/lib.rs @@ -0,0 +1 @@ +pub mod daemon; diff --git a/crates/bin/cratesfyi/src/main.rs b/crates/bin/cratesfyi/src/main.rs new file mode 100644 index 000000000..891051302 --- /dev/null +++ b/crates/bin/cratesfyi/src/main.rs @@ -0,0 +1,58 @@ +use anyhow::Result; +use clap::Parser; +use cratesfyi::daemon::start_daemon; +use docs_rs_context::Context; +use std::env; +use tokio::runtime; + +fn main() { + // set the global log::logger for backwards compatibility + // through rustwide. + docs_rs_builder::logging::init(); + let guard = docs_rs_logging::init().expect("error initializing logging"); + + if let Err(err) = CommandLine::parse().handle_args() { + eprintln!("error running watcher: {:?}", err); + drop(guard); + std::process::exit(1); + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Parser)] +#[command( + about = env!("CARGO_PKG_DESCRIPTION"), + version = docs_rs_utils::BUILD_VERSION, + rename_all = "kebab-case", +)] +enum CommandLine { + /// Starts the daemon + Daemon, +} + +impl CommandLine { + fn handle_args(self) -> Result<()> { + let runtime = runtime::Builder::new_multi_thread().enable_all().build()?; + let ctx = runtime.block_on(async { + Context::builder() + .with_runtime() + .await? + .with_meter_provider()? + .with_pool() + .await? + .with_storage() + .await? + .with_maybe_cdn()? + .with_build_queue()? + .with_registry_api()? + .with_repository_stats()? + .with_build_limits()? + .build() + })?; + + match self { + Self::Daemon => start_daemon(ctx)?, + } + + Ok(()) + } +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json b/crates/bin/docs_rs_admin/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json new file mode 100644 index 000000000..253c81642 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM releases WHERE crate_id = $1 AND version = $2 RETURNING is_library", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "is_library", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "014a054d852f0937191e1a54f742d4b4c454361689fb3841cc12fd7dd1094948" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json b/crates/bin/docs_rs_admin/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json new file mode 100644 index 000000000..4c95721d1 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM owner_rels\n WHERE\n cid = $1 AND\n NOT (oid = ANY($2))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "0a932ffd17414950513a2c8aca2ccd5e29780e00b105fbf79d2de83a11d33ddd" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json b/crates/bin/docs_rs_admin/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json new file mode 100644 index 000000000..fa8db5d2f --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO compression_rels (release, algorithm)\n VALUES ($1, $2)\n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "120c268463e7890553e639ac37e667f3fcdc3f5ceaab3c229b71dbb799c0cddc" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json b/crates/bin/docs_rs_admin/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json new file mode 100644 index 000000000..fd127620f --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO crate_priorities (pattern, priority) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "12c203c76454f3b597186769c28550affce7342fc6a79de7c3b3da048232e3ec" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json b/crates/bin/docs_rs_admin/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json new file mode 100644 index 000000000..14efdbfd4 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue\n SET priority = GREATEST(priority, $1)\n WHERE\n name = $2\n AND version != $3\n AND attempt < $4\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "130cd68b74145ec609a4903c644ce6bc8c9a6d1c3af4953e81a1dfc248a05a3c" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json b/crates/bin/docs_rs_admin/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json new file mode 100644 index 000000000..e1bcf20ab --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE crates\n SET latest_version_id = $2\n WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "1e660947261dfa1a5d1745d1732df59e0cf67ef1906da818086d063e6a0e21c6" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json b/crates/bin/docs_rs_admin/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json new file mode 100644 index 000000000..6d4f685e9 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE builds\n SET\n rustc_version = $1,\n docsrs_version = $2,\n build_status = $3,\n build_server = $4,\n errors = $5,\n documentation_size = $6,\n rustc_nightly_date = $7,\n build_finished = NOW()\n WHERE\n id = $8\n RETURNING rid as \"rid: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rid: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text", + "Text", + "Int8", + "Date", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "2056327f710b8e427e21bf427a24edaffcf58f68237f572e1c14801dc41fba3a" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json b/crates/bin/docs_rs_admin/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json new file mode 100644 index 000000000..a7edcc96f --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n BOOL_OR(releases.is_library) AS has_library\n FROM releases\n WHERE releases.crate_id = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "has_library", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null + ] + }, + "hash": "25d29a471a449e741843246190149a6028edf072940cd5a1a2a6cc4d2978aeb5" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json b/crates/bin/docs_rs_admin/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json new file mode 100644 index 000000000..f091d6c52 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.* FROM (\n SELECT\n c.name as \"name: KrateName\",\n r.version as \"version: Version\",\n (\n SELECT MAX(COALESCE(b.build_finished, b.build_started))\n FROM builds AS b\n WHERE b.rid = r.id\n ) AS last_build_attempt\n FROM crates AS c\n INNER JOIN releases AS r ON c.latest_version_id = r.id\n\n WHERE\n r.rustdoc_status = TRUE\n ) as i\n ORDER BY i.last_build_attempt ASC\n LIMIT $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "last_build_attempt", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + false, + null + ] + }, + "hash": "2bdcde85b92839f75ee67864fca58c2a4e9c177ee442eb4828e3f3f14f7c8853" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json b/crates/bin/docs_rs_admin/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json new file mode 100644 index 000000000..b76453c01 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO crates (name)\n VALUES ($1)\n ON CONFLICT (name) DO UPDATE\n SET -- this `SET` is needed so the id is always returned.\n name = EXCLUDED.name\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "2c1f393f0c38c013c99629b5f0d3611c5153730091dd5488e2ef21b495942b93" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json b/crates/bin/docs_rs_admin/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json new file mode 100644 index 000000000..c7752a36e --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT slug FROM keywords WHERE slug = ANY($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "slug", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "TextArray" + ] + }, + "nullable": [ + false + ] + }, + "hash": "38ca6c4bca81a0762e6e2db08a05ef0ba191d37199165d2745c64a4036e20790" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json b/crates/bin/docs_rs_admin/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json new file mode 100644 index 000000000..ab68991d0 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO keyword_rels (rid, kid)\n SELECT $1 as rid, id as kid\n FROM keywords\n WHERE slug = ANY($2)\n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "TextArray" + ] + }, + "nullable": [] + }, + "hash": "3aac87e4968ad4d83991de6b4ec164c44f00495b3a9a2e9b5ae460697a19278f" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json b/crates/bin/docs_rs_admin/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json new file mode 100644 index 000000000..aed78ccde --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: CrateId\" FROM crates WHERE crates.name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4115addabb6f03cd0de31ac2ddeafd6797b25b99a7112cb68a93a4fac5b07a23" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json b/crates/bin/docs_rs_admin/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json new file mode 100644 index 000000000..a88c69335 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT host_id\n FROM repositories\n WHERE host = $1 AND updated_at < NOW() - INTERVAL '1 day';", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "host_id", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "440b3d15186a21435c470279a5c482315132d6baff4c517df246bc39638f5527" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json b/crates/bin/docs_rs_admin/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json new file mode 100644 index 000000000..ca0a44f4b --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84.json @@ -0,0 +1,87 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n releases.id as \"id: ReleaseId\",\n releases.version as \"version: Version\",\n release_build_status.build_status as \"build_status!: BuildStatus\",\n releases.yanked,\n releases.is_library,\n releases.rustdoc_status,\n releases.release_time,\n releases.target_name,\n releases.default_target,\n releases.doc_targets\n FROM releases\n INNER JOIN release_build_status ON releases.id = release_build_status.rid\n WHERE\n releases.crate_id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ReleaseId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "build_status!: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "yanked", + "type_info": "Bool" + }, + { + "ordinal": 4, + "name": "is_library", + "type_info": "Bool" + }, + { + "ordinal": 5, + "name": "rustdoc_status", + "type_info": "Bool" + }, + { + "ordinal": 6, + "name": "release_time", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "target_name", + "type_info": "Varchar" + }, + { + "ordinal": 8, + "name": "default_target", + "type_info": "Varchar" + }, + { + "ordinal": 9, + "name": "doc_targets", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + true, + true, + true, + true, + true + ] + }, + "hash": "4894c7d8c4e354dca1d952362b2e0cb25441e8e65b273e01ed86d2d3ecebfe84" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json b/crates/bin/docs_rs_admin/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json new file mode 100644 index 000000000..ae5a0b475 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n id,\n name as \"name: KrateName\",\n version as \"version: Version\",\n priority,\n registry,\n attempt\n FROM queue\n WHERE\n attempt < $1 AND\n (last_attempt IS NULL OR last_attempt < NOW() - make_interval(secs => $2))\n ORDER BY priority ASC, attempt ASC, id ASC\n LIMIT 1\n FOR UPDATE SKIP LOCKED", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 4, + "name": "registry", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Float8" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + false + ] + }, + "hash": "48eac6628305a8235aa12b45e1299615bfce99d0e693739d5d497f37600a6349" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json b/crates/bin/docs_rs_admin/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json new file mode 100644 index 000000000..cf141db65 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO doc_coverage (\n release_id, total_items, documented_items,\n total_items_needing_examples, items_with_examples\n )\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (release_id) DO UPDATE\n SET\n total_items = $2,\n documented_items = $3,\n total_items_needing_examples = $4,\n items_with_examples = $5\n RETURNING release_id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "release_id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "494e6b594aba915ba2582eca4797b13012576b2800c257ae3b0d3b7706c69a2c" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json b/crates/bin/docs_rs_admin/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json new file mode 100644 index 000000000..530c4d879 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO config (name, value)\n VALUES ($1, $2)\n ON CONFLICT (name) DO UPDATE SET value = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Json" + ] + }, + "nullable": [] + }, + "hash": "4a6887c2d436121cb2ba6a9c5069455b8f222d929672dc1ff810fa49c2940e2c" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json b/crates/bin/docs_rs_admin/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json new file mode 100644 index 000000000..6d306761e --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE\n FROM queue\n WHERE\n name = $1 AND\n version = $2\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "4b13fe2c8df2b8b8bf019344313b2bc6442482a604cf90fb6106154f8e69a1c2" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json b/crates/bin/docs_rs_admin/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json new file mode 100644 index 000000000..dd15d3dde --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO releases (crate_id, version, archive_storage)\n VALUES ($1, $2, TRUE)\n ON CONFLICT (crate_id, version) DO UPDATE\n SET -- this `SET` is needed so the id is always returned.\n version = EXCLUDED.version\n RETURNING id as \"id: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4b4bfd97b03f632357a68c84f281c286fa0ec399ed98db0dda1ee81e6a6e7f3a" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json b/crates/bin/docs_rs_admin/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json new file mode 100644 index 000000000..a95b272dd --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM crates WHERE crates.name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4f81678f0d680c4be7215ef0667729e8518063e0ee4ecad5aa7e559e88b8e1cb" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json b/crates/bin/docs_rs_admin/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json new file mode 100644 index 000000000..cd88562f2 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO keywords (name, slug) VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "58c1056e05fa7efdd691ad1c568bc00ec0f7c56584bdbe9d88963cc2f7ed7133" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json b/crates/bin/docs_rs_admin/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json new file mode 100644 index 000000000..264e19fd2 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT value FROM config WHERE name = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "value", + "type_info": "Json" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "5ad9cd6cd9d444d258f7486fda178d4dd071cf43cb0ea950574af8e2f37b4a21" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json b/crates/bin/docs_rs_admin/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json new file mode 100644 index 000000000..cc79bd27a --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases SET repository_id = $1 WHERE id = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "5b401b6a191f7364be11110c23228933120dc7c39d0ef436ececc8bee9695c05" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json b/crates/bin/docs_rs_admin/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json new file mode 100644 index 000000000..92b428002 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3.json @@ -0,0 +1,61 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases\n SET release_time = $2,\n dependencies = $3,\n target_name = $4,\n yanked = $5,\n rustdoc_status = $6,\n test_status = $7,\n license = $8,\n repository_url = $9,\n homepage_url = $10,\n description = $11,\n description_long = $12,\n readme = $13,\n keywords = $14,\n have_examples = $15,\n downloads = $16,\n files = $17,\n doc_targets = $18,\n is_library = $19,\n documentation_url = $20,\n default_target = $21,\n features = $22,\n repository_id = $23,\n archive_storage = $24,\n source_size = $25\n WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Timestamptz", + "Json", + "Varchar", + "Bool", + "Bool", + "Bool", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Json", + "Bool", + "Int4", + "Json", + "Json", + "Bool", + "Varchar", + "Varchar", + { + "Custom": { + "name": "feature[]", + "kind": { + "Array": { + "Custom": { + "name": "feature", + "kind": { + "Composite": [ + [ + "name", + "Text" + ], + [ + "subfeatures", + "TextArray" + ] + ] + } + } + } + } + } + }, + "Int4", + "Bool", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "5cf9b185b54dde447b6ba1458178c4fad4c75e72c6a7b7735d17835b9b746ac3" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json b/crates/bin/docs_rs_admin/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json new file mode 100644 index 000000000..dcc82bf13 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO blacklisted_crates (crate_name) VALUES ($1);", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "688c28ae99e5511238a6cbe1c53e3abc3924b4ecffc216e1556a53dda936ceae" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json b/crates/bin/docs_rs_admin/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json new file mode 100644 index 000000000..032419e27 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO repositories (\n host, host_id, name, description, last_commit, stars, forks, issues, updated_at\n ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, NOW())\n ON CONFLICT (host, host_id) DO\n UPDATE SET\n name = $3,\n description = $4,\n last_commit = $5,\n stars = $6,\n forks = $7,\n issues = $8,\n updated_at = NOW()\n RETURNING id;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Timestamptz", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "718576e299a41495b28c843737921e3493a61c0629a9d9a5d04066d443663965" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json b/crates/bin/docs_rs_admin/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json new file mode 100644 index 000000000..6f21daee0 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO sandbox_overrides (\n crate_name, max_memory_bytes, max_targets, timeout_seconds\n )\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (crate_name) DO UPDATE\n SET\n max_memory_bytes = $2,\n max_targets = $3,\n timeout_seconds = $4\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int8", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "73ff86cdb5b9d0ab312493690d4108803ce04531d497d6dd8d67ad05a844eab3" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json b/crates/bin/docs_rs_admin/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json new file mode 100644 index 000000000..55b209a3f --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO queue (name, version, priority, registry)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (name, version) DO UPDATE\n SET priority = EXCLUDED.priority,\n registry = EXCLUDED.registry,\n attempt = 0,\n last_attempt = NULL\n ;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "743604e86c489f7f330adf83d66c810678cd8bbee215532ce26f2c4e76e54a67" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json b/crates/bin/docs_rs_admin/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json new file mode 100644 index 000000000..1928a3804 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO release_build_status(rid, last_build_time, build_status)\n SELECT\n summary.id,\n summary.last_build_time,\n CASE\n WHEN summary.success_count > 0 THEN 'success'::build_status\n WHEN summary.failure_count > 0 THEN 'failure'::build_status\n ELSE 'in_progress'::build_status\n END as build_status\n\n FROM (\n SELECT\n r.id,\n MAX(b.build_finished) as last_build_time,\n SUM(CASE WHEN b.build_status = 'success' THEN 1 ELSE 0 END) as success_count,\n SUM(CASE WHEN b.build_status = 'failure' THEN 1 ELSE 0 END) as failure_count\n FROM\n releases as r\n LEFT OUTER JOIN builds AS b on b.rid = r.id\n WHERE\n r.id = $1\n GROUP BY r.id\n ) as summary\n\n ON CONFLICT (rid) DO UPDATE\n SET\n last_build_time = EXCLUDED.last_build_time,\n build_status=EXCLUDED.build_status", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "7544bfef94310c33c8d34c30bc24e91b4aa2f198c1efd0f9ef562c0b85f4dddb" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json b/crates/bin/docs_rs_admin/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json new file mode 100644 index 000000000..59d4a4eaf --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n id,\n name as \"name: KrateName\",\n version as \"version: Version\",\n priority,\n registry,\n attempt\n FROM queue\n WHERE attempt < $1\n ORDER BY priority ASC, attempt ASC, id ASC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version: Version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 4, + "name": "registry", + "type_info": "Text" + }, + { + "ordinal": 5, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false, + false, + false, + true, + false + ] + }, + "hash": "7c7149524e09ebc1578b1806643b3c5be340e9f9a60e994e6da80b2e9302a168" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json b/crates/bin/docs_rs_admin/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json new file mode 100644 index 000000000..60bddfbca --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT crate_id as \"crate_id: CrateId\"\n FROM releases\n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "7fda06d8c2a6cac88f9bf06b3480f07d801c711693e19ee40991f069b2393fec" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json b/crates/bin/docs_rs_admin/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json new file mode 100644 index 000000000..e178e2e36 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM crates WHERE id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "80df8947b7230ea7ab2bd08206c7ad00f4a16c3964bbd1e71ce646186be20c4e" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json b/crates/bin/docs_rs_admin/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json new file mode 100644 index 000000000..cc5d0f370 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM blacklisted_crates WHERE crate_name = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "864a659b317f451949bf793899a7ea5b78ebf8a962fbb12b88eb8f1d807fbab6" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json b/crates/bin/docs_rs_admin/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json new file mode 100644 index 000000000..8aedc7865 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO owners (login, avatar, kind)\n VALUES ($1, $2, $3)\n ON CONFLICT (login) DO UPDATE\n SET\n avatar = EXCLUDED.avatar,\n kind = EXCLUDED.kind\n RETURNING id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Text", + { + "Custom": { + "name": "owner_kind", + "kind": { + "Enum": [ + "user", + "team" + ] + } + } + } + ] + }, + "nullable": [ + false + ] + }, + "hash": "87952bd450ed2c13b99bd502a73a84edd7d17e6171523ebbd57f1d9dd7c9b46c" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json b/crates/bin/docs_rs_admin/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json new file mode 100644 index 000000000..79feba8ee --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n name as \"name!: KrateName\",\n version as \"version!: Version\",\n yanked\n FROM (\n SELECT\n crates.name,\n releases.version,\n releases.yanked\n FROM crates\n INNER JOIN releases ON releases.crate_id = crates.id\n UNION ALL\n -- crates & releases that are already queued\n -- don't have to be requeued.\n SELECT\n queue.name,\n queue.version,\n NULL as yanked\n FROM queue\n LEFT OUTER JOIN crates ON crates.name = queue.name\n LEFT OUTER JOIN releases ON (\n releases.crate_id = crates.id AND\n releases.version = queue.version\n )\n WHERE queue.attempt < $1 AND (\n crates.id IS NULL OR\n releases.id IS NULL\n )\n ) AS inp\n ORDER BY name", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name!: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version!: Version", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "yanked", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null, + null, + null + ] + }, + "hash": "89b622b38ef47d34450476f2e91b60b482d8351a50df34fb71cf4724ce78fe3b" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json b/crates/bin/docs_rs_admin/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json new file mode 100644 index 000000000..9af771395 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT pattern, priority FROM crate_priorities", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "pattern", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "8f1900a52809215672eb6c5ca684082c77a81874c88cab453681eaa660a13ae0" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json b/crates/bin/docs_rs_admin/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json new file mode 100644 index 000000000..76a6e7969 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE releases\n SET yanked = $3\n FROM crates\n WHERE crates.id = releases.crate_id\n AND name = $1\n AND version = $2\n RETURNING crates.id as \"id: CrateId\"\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Bool" + ] + }, + "nullable": [ + false + ] + }, + "hash": "8f9ba7439b7282048989dcf36fd6cd88e2ea238a0b8e1b42a7515f23d97eddfb" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json b/crates/bin/docs_rs_admin/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json new file mode 100644 index 000000000..7e7ce93f0 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT pattern, priority FROM crate_priorities WHERE $1 LIKE pattern LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "pattern", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "90ff19a8b5452159a09930f450d614fd5f516c362bb2c195bcbea917775b9b54" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json b/crates/bin/docs_rs_admin/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json new file mode 100644 index 000000000..5745997b7 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT id as \"id: CrateId\"\n FROM crates\n WHERE normalize_crate_name(name) = normalize_crate_name($1)\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Varchar" + ] + }, + "nullable": [ + false + ] + }, + "hash": "92415d8f64477bce37d6a1393c6906e42a9dc37176ac1d357abd9ff1cfbb9c64" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json b/crates/bin/docs_rs_admin/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json new file mode 100644 index 000000000..80e74ab5f --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM owner_rels WHERE cid = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "92ea6c595b720132a0c3da609414e499a13b3c2c74be2e530fb55bd27aa070e4" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json b/crates/bin/docs_rs_admin/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json new file mode 100644 index 000000000..312fd50c3 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO owner_rels (cid, oid)\n SELECT $1,oid\n FROM UNNEST($2::int[]) as oid\n ON CONFLICT (cid,oid)\n DO NOTHING", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4Array" + ] + }, + "nullable": [] + }, + "hash": "95bc487e596e04e5e1cfd20903d8bdb54917c2ea91a0ee9c1dad7d5290ca2e62" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json b/crates/bin/docs_rs_admin/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json new file mode 100644 index 000000000..33a64a917 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT releases.id, crates.name, releases.version, releases.repository_url\n FROM releases\n INNER JOIN crates ON (crates.id = releases.crate_id)\n WHERE repository_id IS NULL AND repository_url LIKE $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "version", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "repository_url", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true + ] + }, + "hash": "97a9b51028cbf8e585e120382efdff87417d99c179c695ded1bdb6cd584a7323" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json b/crates/bin/docs_rs_admin/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json new file mode 100644 index 000000000..fff5127ec --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE queue\n SET\n attempt = attempt + 1,\n last_attempt = NOW()\n WHERE id = $1\n RETURNING attempt;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "attempt", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "9e7595c7b9b336b24241c133870b99e1ee70e750849956d268ef1cb6df4f53d4" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json b/crates/bin/docs_rs_admin/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json new file mode 100644 index 000000000..87fe73890 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM sandbox_overrides WHERE crate_name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "max_memory_bytes", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "timeout_seconds", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "max_targets", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + true, + true, + true + ] + }, + "hash": "a3920d6701d1a80f23562ee83682d82ff35a52eeaa93ed45a97adc5e559d3538" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json b/crates/bin/docs_rs_admin/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json new file mode 100644 index 000000000..9439ea53a --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO builds(rid, build_status, build_server, build_started)\n VALUES ($1, $2, $3, NOW())\n RETURNING id as \"id: BuildId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: BuildId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "a708e47c863614354e9a756da43b47d6071608366fd01f0d67db0991eb588b68" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json b/crates/bin/docs_rs_admin/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json new file mode 100644 index 000000000..4f561d6a6 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n priority,\n COUNT(*) as \"count!\"\n FROM queue\n WHERE attempt < $1\n GROUP BY priority", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "priority", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "count!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + null + ] + }, + "hash": "a76e4776415625ee9d323db74a68a8670070276be0cea27a46a73f487430c5a3" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json b/crates/bin/docs_rs_admin/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json new file mode 100644 index 000000000..d800017a7 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM releases WHERE crate_id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "aaa2cc1b0b88255cb0be16259e6b53571ead374e51fc62b9a646a77fc84b4d6d" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-c465bfd0ac82fe1e9ea7126e185d09a1d493d797ee8c4c7d29457a81f86412c1.json b/crates/bin/docs_rs_admin/.sqlx/query-c465bfd0ac82fe1e9ea7126e185d09a1d493d797ee8c4c7d29457a81f86412c1.json new file mode 100644 index 000000000..b12ec5797 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-c465bfd0ac82fe1e9ea7126e185d09a1d493d797ee8c4c7d29457a81f86412c1.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id as \"id: CrateId\", name FROM crates ORDER BY name", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CrateId", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Text" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false + ] + }, + "hash": "c465bfd0ac82fe1e9ea7126e185d09a1d493d797ee8c4c7d29457a81f86412c1" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json b/crates/bin/docs_rs_admin/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json new file mode 100644 index 000000000..b76920724 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM queue WHERE id = $1;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [] + }, + "hash": "c8328ef704887faa486f9caebba0ba39a115b8e278ac4c6bb6b67f2dafefcfbb" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json b/crates/bin/docs_rs_admin/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json new file mode 100644 index 000000000..5dc057abf --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM crate_priorities WHERE pattern = $1 RETURNING priority", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "priority", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "cd568b56b5d3e43427218845ee19c4e9d598f61cf18eab47b36205b1aa1be301" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json b/crates/bin/docs_rs_admin/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json new file mode 100644 index 000000000..4200b5330 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM repositories WHERE name = $1 AND host = $2 LIMIT 1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "ce3c4ceec1fee051b9c9716d7e3dc94b213dc5449083dc109c1d935164e647e2" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json b/crates/bin/docs_rs_admin/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json new file mode 100644 index 000000000..6bfe26455 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM repositories WHERE host_id = $1 AND host = $2;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "cf83cc24df4c285fe67808f1e1a2b56f850014b975a7506597a4ae3c5c6851aa" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json b/crates/bin/docs_rs_admin/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json new file mode 100644 index 000000000..ba6be127c --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT COUNT(*) as \"count!\" FROM queue WHERE attempt >= $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "count!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + null + ] + }, + "hash": "d16fc68c2607f6a1c94e92ca7cf95d26725b4fa8cc664a0c1474eceb67c31570" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json b/crates/bin/docs_rs_admin/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json new file mode 100644 index 000000000..a5bdecf4a --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n crate_name as \"crate_name: KrateName\"\n FROM blacklisted_crates\n ORDER BY crate_name asc;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name: KrateName", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "d484acb977a659075364b39e6f021e18cb969b2d735c5e7bb08e8eb4e34f8418" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json b/crates/bin/docs_rs_admin/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json new file mode 100644 index 000000000..154247910 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE builds\n SET\n build_status = $1,\n errors = $2\n WHERE id = $3\n RETURNING rid as \"rid: ReleaseId\" ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "rid: ReleaseId", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + }, + "Text", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "d675aff9079a87e41891c589eaffa2497eba27fcee660f3d92241eaeda02ac0f" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json b/crates/bin/docs_rs_admin/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json new file mode 100644 index 000000000..8019026f4 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n c.name AS \"name: KrateName\",\n r.version AS \"version: Version\"\n FROM crates AS c\n JOIN releases AS r\n ON c.id = r.crate_id\n JOIN release_build_status AS rbs\n ON rbs.rid = r.id\n JOIN builds AS b\n ON b.rid = r.id\n AND b.build_finished = rbs.last_build_time\n AND b.rustc_nightly_date >= $1\n AND b.rustc_nightly_date < $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name: KrateName", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "version: Version", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Date", + "Date" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "dc6fda3230424886a21b26c0adf41e814712a9d3e6c771468109858c7f8ad295" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json b/crates/bin/docs_rs_admin/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json new file mode 100644 index 000000000..945d619af --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM sandbox_overrides WHERE crate_name = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "de4ba149a561c4bb467bcea081bdedff233398cddf4996734a64536b6a8c6579" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json b/crates/bin/docs_rs_admin/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json new file mode 100644 index 000000000..8699a9ded --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374.json @@ -0,0 +1,33 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT build_status AS \"build_status: BuildStatus\"\n FROM release_build_status\n WHERE rid = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "build_status: BuildStatus", + "type_info": { + "Custom": { + "name": "build_status", + "kind": { + "Enum": [ + "in_progress", + "success", + "failure" + ] + } + } + } + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "e3216009b040994f88958082b518e2bbdb89147a2ef8b29e85bb9695c4bc8374" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json b/crates/bin/docs_rs_admin/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json new file mode 100644 index 000000000..150257361 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT 1 FROM blacklisted_crates WHERE crate_name = $1;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "?column?", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "e4c989a6678cff1c7187dd737f97d0548e814d98b6e161de1c39457d25c10e3b" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json b/crates/bin/docs_rs_admin/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json new file mode 100644 index 000000000..403de85f9 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id\n FROM queue\n WHERE\n attempt < $1 AND\n name = $2 AND\n version = $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Int4", + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "f4765711eacc30103180cabe501b9c37ae3bbe46dceaa7e9332e8c898aed659c" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json b/crates/bin/docs_rs_admin/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json new file mode 100644 index 000000000..937d9c012 --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE\n FROM queue\n WHERE name = $1\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "f8b389df3451e4b5e6539e9260ba6340edf69c7dba22e667aedd510e868b0f00" +} diff --git a/crates/bin/docs_rs_admin/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json b/crates/bin/docs_rs_admin/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json new file mode 100644 index 000000000..4223b877d --- /dev/null +++ b/crates/bin/docs_rs_admin/.sqlx/query-fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8.json @@ -0,0 +1,38 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n crate_name as \"crate_name: KrateName\",\n max_memory_bytes,\n timeout_seconds,\n max_targets\n FROM sandbox_overrides\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "crate_name: KrateName", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "max_memory_bytes", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "timeout_seconds", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "max_targets", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + true, + true, + true + ] + }, + "hash": "fe36361977b1d8857f1bbd4d1c30ef29516987d053d35a9afc0a09fee31cd1c8" +} diff --git a/crates/bin/docs_rs_admin/Cargo.toml b/crates/bin/docs_rs_admin/Cargo.toml new file mode 100644 index 000000000..7ccb3fe7a --- /dev/null +++ b/crates/bin/docs_rs_admin/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "docs_rs_admin" +version = "0.6.0" +authors = ["Onur Aslan ", "The Rust Project Developers"] +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" +edition = "2024" + +[dependencies] +anyhow = { workspace = true } +chrono = { workspace = true } +clap = { workspace = true } +docs_rs_build_limits = { path = "../../lib/docs_rs_build_limits" } +docs_rs_build_queue = { path = "../../lib/docs_rs_build_queue" } +docs_rs_builder = { path = "../docs_rs_builder" } +docs_rs_watcher = { path = "../docs_rs_watcher" } +docs_rs_context = { path = "../../lib/docs_rs_context" } +docs_rs_database = { path = "../../lib/docs_rs_database" } +docs_rs_logging = { path = "../../lib/docs_rs_logging" } +docs_rs_types = { path = "../../lib/docs_rs_types" } +docs_rs_utils = { path = "../../lib/docs_rs_utils" } +futures-util = { workspace = true } +sqlx = { workspace = true } +tokio = { workspace = true } diff --git a/crates/bin/docs_rs_admin/src/main.rs b/crates/bin/docs_rs_admin/src/main.rs new file mode 100644 index 000000000..1b2180bb8 --- /dev/null +++ b/crates/bin/docs_rs_admin/src/main.rs @@ -0,0 +1,470 @@ +use anyhow::{Context as _, Result}; +use chrono::NaiveDate; +use clap::{Parser, Subcommand}; +use docs_rs_build_limits::Overrides; +use docs_rs_build_queue::priority::{ + get_crate_pattern_and_priority, list_crate_priorities, remove_crate_priority, + set_crate_priority, +}; +use docs_rs_builder::blacklist; +use docs_rs_context::Context; +use docs_rs_database::{ + crate_details, + service_config::{ConfigName, set_config}, +}; +use docs_rs_types::{CrateId, KrateName, Version}; +use docs_rs_watcher::queue_rebuilds_faulty_rustdoc; +use futures_util::StreamExt; + +#[tokio::main] +async fn main() -> Result<()> { + let _guard = docs_rs_logging::init().context("error initializing logging")?; + + if let Err(err) = CommandLine::parse().handle_args().await { + eprintln!("error running admin CLI: {:?}", err); + drop(_guard); + std::process::exit(1); + } + + Ok(()) +} + +#[derive(Debug, Clone, PartialEq, Eq, Parser)] +#[command( + about = env!("CARGO_PKG_DESCRIPTION"), + version = docs_rs_utils::BUILD_VERSION, + rename_all = "kebab-case", +)] +enum CommandLine { + Build { + #[command(subcommand)] + subcommand: BuildSubcommand, + }, + + /// Database operations + Database { + #[command(subcommand)] + subcommand: DatabaseSubcommand, + }, + + /// Interactions with the build queue + Queue { + #[command(subcommand)] + subcommand: QueueSubcommand, + }, +} + +impl CommandLine { + async fn handle_args(self) -> Result<()> { + let ctx = Context::builder() + .with_runtime() + .await? + .with_meter_provider()? + .with_pool() + .await? + .with_build_queue()? + .with_repository_stats()? + .with_registry_api()? + .build()?; + + match self { + Self::Build { subcommand } => subcommand.handle_args(ctx).await?, + Self::Database { subcommand } => subcommand.handle_args(ctx).await?, + Self::Queue { subcommand } => subcommand.handle_args(ctx).await?, + } + + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum QueueSubcommand { + /// Add a crate to the build queue + Add { + /// Name of crate to build + #[arg(name = "CRATE_NAME")] + crate_name: KrateName, + /// Version of crate to build + #[arg(name = "CRATE_VERSION")] + crate_version: Version, + /// Priority of build (new crate builds get priority 0) + #[arg( + name = "BUILD_PRIORITY", + short = 'p', + long = "priority", + default_value = "5", + allow_negative_numbers = true + )] + build_priority: i32, + }, + + /// Interactions with build queue priorities + DefaultPriority { + #[command(subcommand)] + subcommand: PrioritySubcommand, + }, + + /// Queue rebuilds for broken nightly versions of rustdoc, either for a single date (start) or a range (start inclusive, end exclusive) + RebuildBrokenNightly { + /// Start date of nightly builds to rebuild (inclusive) + #[arg(name = "START", short = 's', long = "start")] + start_nightly_date: NaiveDate, + + /// End date of nightly builds to rebuild (exclusive, optional) + #[arg(name = "END", short = 'e', long = "end")] + end_nightly_date: Option, + }, +} + +impl QueueSubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + match self { + Self::Add { + crate_name, + crate_version, + build_priority, + } => { + ctx.build_queue()? + .add_crate(&crate_name, &crate_version, build_priority, None) + .await? + } + + Self::DefaultPriority { subcommand } => subcommand.handle_args(ctx).await?, + + Self::RebuildBrokenNightly { + start_nightly_date, + end_nightly_date, + } => { + let mut conn = ctx.pool()?.get_async().await?; + let queued_rebuilds_amount = queue_rebuilds_faulty_rustdoc( + &mut conn, + ctx.build_queue()?, + &start_nightly_date, + &end_nightly_date, + ) + .await?; + println!( + "Queued {queued_rebuilds_amount} rebuilds for broken nightly versions of rustdoc" + ); + } + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum PrioritySubcommand { + /// Get priority for a crate + /// + /// (returns only the first matching pattern, there may be other matching patterns) + Get { crate_name: KrateName }, + + /// List priorities for all patterns + List, + + /// Set all crates matching a pattern to a priority level + Set { + /// See https://www.postgresql.org/docs/current/functions-matching.html for pattern syntax + #[arg(name = "PATTERN")] + pattern: String, + /// The priority to give crates matching the given `PATTERN` + #[arg(allow_negative_numbers = true)] + priority: i32, + }, + + /// Remove the prioritization of crates for a pattern + Remove { + /// See https://www.postgresql.org/docs/current/functions-matching.html for pattern syntax + #[arg(name = "PATTERN")] + pattern: String, + }, +} + +impl PrioritySubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + let mut conn = ctx.pool()?.get_async().await?; + match self { + Self::List => { + for (pattern, priority) in list_crate_priorities(&mut conn).await? { + println!("{pattern:>20} : {priority:>3}"); + } + } + + Self::Get { crate_name } => { + if let Some((pattern, priority)) = + get_crate_pattern_and_priority(&mut conn, &crate_name).await? + { + println!("{pattern} : {priority}"); + } else { + println!("No priority found for {crate_name}"); + } + } + + Self::Set { pattern, priority } => { + set_crate_priority(&mut conn, &pattern, priority) + .await + .context("Could not set pattern's priority")?; + println!("Set pattern '{pattern}' to priority {priority}"); + } + + Self::Remove { pattern } => { + if let Some(priority) = remove_crate_priority(&mut conn, &pattern) + .await + .context("Could not remove pattern's priority")? + { + println!("Removed pattern '{pattern}' with priority {priority}"); + } else { + println!("Pattern '{pattern}' did not exist and so was not removed"); + } + } + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum BuildSubcommand { + SetToolchain { + toolchain_name: String, + }, + + /// Locks the daemon, preventing it from building new crates + Lock, + + /// Unlocks the daemon to continue building new crates + Unlock, +} + +impl BuildSubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + match self { + Self::SetToolchain { toolchain_name } => { + let mut conn = ctx + .pool()? + .get_async() + .await + .context("failed to get a database connection")?; + set_config(&mut conn, ConfigName::Toolchain, toolchain_name) + .await + .context("failed to set toolchain in database")?; + } + + Self::Lock => ctx.build_queue()?.lock().await.context("Failed to lock")?, + Self::Unlock => ctx + .build_queue()? + .unlock() + .await + .context("Failed to unlock")?, + } + + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum DatabaseSubcommand { + /// Run database migration + Migrate { + /// The database version to migrate to + #[arg(name = "VERSION")] + version: Option, + }, + + /// temporary command to update the `crates.latest_version_id` field + UpdateLatestVersionId, + + /// Updates GitHub/GitLab stats for crates. + UpdateRepositoryFields, + + /// Backfill GitHub/GitLab stats for crates. + BackfillRepositoryStats, + + /// Updates info for a crate from the registry's API + UpdateCrateRegistryFields { + #[arg(name = "CRATE")] + name: String, + }, + + /// Blacklist operations + Blacklist { + #[command(subcommand)] + command: BlacklistSubcommand, + }, + + /// Limit overrides operations + Limits { + #[command(subcommand)] + command: LimitsSubcommand, + }, +} + +impl DatabaseSubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + match self { + Self::Migrate { version } => { + let mut conn = ctx.pool()?.get_async().await?; + docs_rs_database::migrate(&mut conn, version).await + } + .context("Failed to run database migrations")?, + + Self::UpdateLatestVersionId => { + let pool = ctx.pool()?; + let mut list_conn = pool.get_async().await?; + let mut update_conn = pool.get_async().await?; + + let mut result_stream = + sqlx::query!(r#"SELECT id as "id: CrateId", name FROM crates ORDER BY name"#) + .fetch(&mut *list_conn); + + while let Some(row) = result_stream.next().await { + let row = row?; + + println!("handling crate {}", row.name); + + crate_details::update_latest_version_id(&mut update_conn, row.id).await?; + } + + Ok::<(), anyhow::Error>(()) + } + .context("Failed to update latest version id")?, + + Self::UpdateRepositoryFields => { + ctx.repository_stats()?.update_all_crates().await?; + } + + Self::BackfillRepositoryStats => { + ctx.repository_stats()?.backfill_repositories().await?; + } + + Self::UpdateCrateRegistryFields { name } => { + let mut conn = ctx.pool()?.get_async().await?; + let registry_data = ctx.registry_api()?.get_crate_data(&name).await?; + docs_rs_database::releases::update_crate_data_in_database( + &mut conn, + &name, + ®istry_data, + ) + .await?; + } + + Self::Blacklist { command } => command.handle_args(ctx).await?, + + Self::Limits { command } => command.handle_args(ctx).await?, + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum LimitsSubcommand { + /// Get sandbox limit overrides for a crate + Get { crate_name: KrateName }, + + /// List sandbox limit overrides for all crates + List, + + /// Set sandbox limits overrides for a crate + Set { + crate_name: KrateName, + #[arg(long)] + memory: Option, + #[arg(long)] + targets: Option, + #[arg(long)] + timeout: Option, + }, + + /// Remove sandbox limits overrides for a crate + Remove { crate_name: KrateName }, +} + +impl LimitsSubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + let mut conn = ctx.pool()?.get_async().await?; + + match self { + Self::Get { crate_name } => { + let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; + println!("sandbox limit overrides for {crate_name} = {overrides:?}"); + } + + Self::List => { + for (crate_name, overrides) in Overrides::all(&mut conn).await? { + println!("sandbox limit overrides for {crate_name} = {overrides:?}"); + } + } + + Self::Set { + crate_name, + memory, + targets, + timeout, + } => { + let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; + println!("previous sandbox limit overrides for {crate_name} = {overrides:?}"); + let overrides = Overrides { + memory, + targets, + timeout: timeout.map(|timeout| std::time::Duration::from_secs(timeout as _)), + }; + Overrides::save(&mut conn, &crate_name, overrides).await?; + let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; + println!("new sandbox limit overrides for {crate_name} = {overrides:?}"); + } + + Self::Remove { crate_name } => { + let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; + println!("previous overrides for {crate_name} = {overrides:?}"); + Overrides::remove(&mut conn, &crate_name).await?; + } + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] +enum BlacklistSubcommand { + /// List all crates on the blacklist + List, + + /// Add a crate to the blacklist + Add { + /// Crate name + #[arg(name = "CRATE_NAME")] + crate_name: KrateName, + }, + + /// Remove a crate from the blacklist + Remove { + /// Crate name + #[arg(name = "CRATE_NAME")] + crate_name: KrateName, + }, +} + +impl BlacklistSubcommand { + async fn handle_args(self, ctx: Context) -> Result<()> { + let mut conn = ctx.pool()?.get_async().await?; + match self { + Self::List => { + let crates: Vec<_> = blacklist::list_crates(&mut conn) + .await + .context("failed to list crates on blacklist")? + .into_iter() + .map(|k| k.to_string()) + .collect(); + + println!("{}", crates.join("\n")); + } + + Self::Add { crate_name } => blacklist::add_crate(&mut conn, &crate_name) + .await + .context("failed to add crate to blacklist")?, + + Self::Remove { crate_name } => blacklist::remove_crate(&mut conn, &crate_name) + .await + .context("failed to remove crate from blacklist")?, + } + Ok(()) + } +} diff --git a/crates/bin/docs_rs_builder/Cargo.toml b/crates/bin/docs_rs_builder/Cargo.toml index e66f2872e..19f60742d 100644 --- a/crates/bin/docs_rs_builder/Cargo.toml +++ b/crates/bin/docs_rs_builder/Cargo.toml @@ -1,6 +1,9 @@ [package] name = "docs_rs_builder" -version = "0.1.0" +version = "0.6.0" +authors = ["Onur Aslan ", "The Rust Project Developers"] +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/bin/docs_rs_builder/src/build_queue.rs b/crates/bin/docs_rs_builder/src/build_queue.rs index 1935cdb75..2a8e23cbe 100644 --- a/crates/bin/docs_rs_builder/src/build_queue.rs +++ b/crates/bin/docs_rs_builder/src/build_queue.rs @@ -15,7 +15,7 @@ fn process_next_crate( f: impl FnOnce(&QueuedCrate) -> Result, ) -> Result<()> { let queue = context.blocking_build_queue()?.clone(); - let cdn = context.cdn()?; + let cdn = context.cdn(); let runtime = context.runtime().clone(); let queue_config = context.config().build_queue()?; @@ -30,7 +30,9 @@ fn process_next_crate( builder_metrics.total_builds.add(1, &[]); - runtime.block_on(cdn.queue_crate_invalidation(&to_process.name))?; + if let Some(cdn) = cdn { + runtime.block_on(cdn.queue_crate_invalidation(&to_process.name))?; + } res })?; @@ -104,9 +106,7 @@ mod tests { })?; assert_eq!( - env.runtime() - .block_on(env.cdn().unwrap().purged_keys()) - .unwrap(), + env.runtime().block_on(env.cdn().purged_keys()).unwrap(), SurrogateKey::from(WILL_FAIL).into() ); @@ -128,9 +128,7 @@ mod tests { })?; assert_eq!( - env.runtime() - .block_on(env.cdn().unwrap().purged_keys()) - .unwrap(), + env.runtime().block_on(env.cdn().purged_keys()).unwrap(), SurrogateKey::from(WILL_SUCCEED).into() ); diff --git a/crates/bin/docs_rs_builder/src/main.rs b/crates/bin/docs_rs_builder/src/main.rs index 3024286a5..b28b38372 100644 --- a/crates/bin/docs_rs_builder/src/main.rs +++ b/crates/bin/docs_rs_builder/src/main.rs @@ -49,10 +49,11 @@ impl CommandLine { .await? .with_storage() .await? - .with_cdn()? + .with_maybe_cdn()? .with_build_queue()? .with_registry_api()? .with_repository_stats()? + .with_build_limits()? .build() })?; diff --git a/crates/bin/docs_rs_builder/src/testing/test_env.rs b/crates/bin/docs_rs_builder/src/testing/test_env.rs index b86451743..8b74e20e1 100644 --- a/crates/bin/docs_rs_builder/src/testing/test_env.rs +++ b/crates/bin/docs_rs_builder/src/testing/test_env.rs @@ -55,8 +55,10 @@ impl TestEnvironment { .pool(db_config.into(), db.pool().clone()) .storage(storage_config.clone(), test_storage.storage()) .with_build_queue()? + .with_registry_api()? + .with_repository_stats()? .maybe_cdn( - docs_rs_fastly::Config::from_environment()?.into(), + Arc::new(docs_rs_fastly::Config::test_config()), Some(Cdn::mock().into()), ) .build() @@ -76,8 +78,8 @@ impl TestEnvironment { self.context.blocking_storage() } - pub(crate) fn cdn(&self) -> Result<&Arc> { - self.context.cdn() + pub(crate) fn cdn(&self) -> &Arc { + self.context.cdn().expect("we always have a CDN in tests") } pub(crate) fn blocking_build_queue(&self) -> Result<&Arc> { diff --git a/crates/bin/docs_rs_watcher/Cargo.toml b/crates/bin/docs_rs_watcher/Cargo.toml index d173aeb0a..f1c450df1 100644 --- a/crates/bin/docs_rs_watcher/Cargo.toml +++ b/crates/bin/docs_rs_watcher/Cargo.toml @@ -1,6 +1,9 @@ [package] name = "docs_rs_watcher" -version = "0.1.0" +version = "0.6.0" +authors = ["Onur Aslan ", "The Rust Project Developers"] +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/bin/docs_rs_watcher/src/main.rs b/crates/bin/docs_rs_watcher/src/main.rs index 942b62964..d4659781d 100644 --- a/crates/bin/docs_rs_watcher/src/main.rs +++ b/crates/bin/docs_rs_watcher/src/main.rs @@ -59,7 +59,7 @@ impl CommandLine { .await? .with_storage() .await? - .with_cdn()? + .with_maybe_cdn()? .with_build_queue()? .with_repository_stats()? .build()?; diff --git a/crates/bin/docs_rs_web/Cargo.toml b/crates/bin/docs_rs_web/Cargo.toml index 0e1e9ea14..a90244778 100644 --- a/crates/bin/docs_rs_web/Cargo.toml +++ b/crates/bin/docs_rs_web/Cargo.toml @@ -1,6 +1,9 @@ [package] name = "docs_rs_web" -version = "0.1.0" +version = "0.6.0" +authors = ["Onur Aslan ", "The Rust Project Developers"] +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" build = "build.rs" diff --git a/crates/lib/docs_rs_build_limits/Cargo.toml b/crates/lib/docs_rs_build_limits/Cargo.toml index 324a36800..d7cc8ed24 100644 --- a/crates/lib/docs_rs_build_limits/Cargo.toml +++ b/crates/lib/docs_rs_build_limits/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_build_limits" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_build_queue/Cargo.toml b/crates/lib/docs_rs_build_queue/Cargo.toml index ec5fd2228..bceb7e1d7 100644 --- a/crates/lib/docs_rs_build_queue/Cargo.toml +++ b/crates/lib/docs_rs_build_queue/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_build_queue" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_cargo_metadata/Cargo.toml b/crates/lib/docs_rs_cargo_metadata/Cargo.toml index d326461f9..657b487ef 100644 --- a/crates/lib/docs_rs_cargo_metadata/Cargo.toml +++ b/crates/lib/docs_rs_cargo_metadata/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_cargo_metadata" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_context/Cargo.toml b/crates/lib/docs_rs_context/Cargo.toml index 4460fca93..7c5c1f759 100644 --- a/crates/lib/docs_rs_context/Cargo.toml +++ b/crates/lib/docs_rs_context/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_context" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_context/src/context.rs b/crates/lib/docs_rs_context/src/context.rs index b02e93396..ee7e4036f 100644 --- a/crates/lib/docs_rs_context/src/context.rs +++ b/crates/lib/docs_rs_context/src/context.rs @@ -172,7 +172,7 @@ impl ContextBuilder { self.maybe_cdn_internal(cdn) } - pub fn with_cdn(self) -> Result>> + pub fn with_maybe_cdn(self) -> Result>> where S::MeterProvider: IsSet, S::Cdn: IsUnset, @@ -347,12 +347,12 @@ impl Context { } } - pub fn cdn(&self) -> Result<&Arc> { - if let Some(ref cdn) = self.cdn { - Ok(cdn) - } else { - Err(anyhow!("CDN is not initialized")) - } + /// return configured CDN or None. + /// + /// Compared to other parts of the context, the CDN is truly optional + /// and all code using it must handle the None case. + pub fn cdn(&self) -> Option<&Arc> { + self.cdn.as_ref() } pub fn repository_stats(&self) -> Result<&Arc> { diff --git a/crates/lib/docs_rs_database/Cargo.toml b/crates/lib/docs_rs_database/Cargo.toml index 8155f398e..f898d2d67 100644 --- a/crates/lib/docs_rs_database/Cargo.toml +++ b/crates/lib/docs_rs_database/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_database" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" build = "build.rs" diff --git a/crates/lib/docs_rs_env_vars/Cargo.toml b/crates/lib/docs_rs_env_vars/Cargo.toml index 768bfb99d..f9ba1a4aa 100644 --- a/crates/lib/docs_rs_env_vars/Cargo.toml +++ b/crates/lib/docs_rs_env_vars/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_env_vars" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_fastly/Cargo.toml b/crates/lib/docs_rs_fastly/Cargo.toml index 3f707d412..0289ea15a 100644 --- a/crates/lib/docs_rs_fastly/Cargo.toml +++ b/crates/lib/docs_rs_fastly/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_fastly" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_fastly/src/config.rs b/crates/lib/docs_rs_fastly/src/config.rs index 2f387e85f..c5756ccca 100644 --- a/crates/lib/docs_rs_fastly/src/config.rs +++ b/crates/lib/docs_rs_fastly/src/config.rs @@ -1,6 +1,8 @@ use docs_rs_env_vars::{env, maybe_env}; use url::Url; +const FASTLY_API_HOST: &str = "https://api.fastly.com"; + #[derive(Debug)] pub struct Config { /// Fastly API host, typically only overwritten for testing @@ -16,15 +18,28 @@ pub struct Config { impl Config { pub fn from_environment() -> anyhow::Result { Ok(Self { - api_host: env( - "DOCSRS_FASTLY_API_HOST", - "https://api.fastly.com".parse().unwrap(), - )?, + api_host: env("DOCSRS_FASTLY_API_HOST", FASTLY_API_HOST.parse().unwrap())?, api_token: maybe_env("DOCSRS_FASTLY_API_TOKEN")?, service_sid: maybe_env("DOCSRS_FASTLY_SERVICE_SID_WEB")?, }) } + /// test config + /// assumes we're using the mock CDN, but generates a config where + /// `is_valid` is true.` + #[cfg(any(test, feature = "testing"))] + pub fn test_config() -> Self { + let cfg = Self { + api_host: FASTLY_API_HOST.parse().unwrap(), + api_token: Some("some_token".into()), + service_sid: Some("some_sid".into()), + }; + + debug_assert!(cfg.is_valid()); + + cfg + } + pub fn is_valid(&self) -> bool { self.api_token.is_some() && self.service_sid.is_some() } diff --git a/crates/lib/docs_rs_headers/Cargo.toml b/crates/lib/docs_rs_headers/Cargo.toml index a5cafbe38..7f004c263 100644 --- a/crates/lib/docs_rs_headers/Cargo.toml +++ b/crates/lib/docs_rs_headers/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_headers" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_logging/Cargo.toml b/crates/lib/docs_rs_logging/Cargo.toml index 6dbb38ac0..e7015227b 100644 --- a/crates/lib/docs_rs_logging/Cargo.toml +++ b/crates/lib/docs_rs_logging/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_logging" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_mimes/Cargo.toml b/crates/lib/docs_rs_mimes/Cargo.toml index 8b972638c..3f66bc023 100644 --- a/crates/lib/docs_rs_mimes/Cargo.toml +++ b/crates/lib/docs_rs_mimes/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_mimes" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_opentelemetry/Cargo.toml b/crates/lib/docs_rs_opentelemetry/Cargo.toml index 02f1b6da1..2bbd55a07 100644 --- a/crates/lib/docs_rs_opentelemetry/Cargo.toml +++ b/crates/lib/docs_rs_opentelemetry/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_opentelemetry" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_registry_api/Cargo.toml b/crates/lib/docs_rs_registry_api/Cargo.toml index eb137fa54..f28d6ce78 100644 --- a/crates/lib/docs_rs_registry_api/Cargo.toml +++ b/crates/lib/docs_rs_registry_api/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_registry_api" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_repository_stats/Cargo.toml b/crates/lib/docs_rs_repository_stats/Cargo.toml index e32c30e60..4275ea135 100644 --- a/crates/lib/docs_rs_repository_stats/Cargo.toml +++ b/crates/lib/docs_rs_repository_stats/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_repository_stats" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_storage/Cargo.toml b/crates/lib/docs_rs_storage/Cargo.toml index 83918ecee..b046df3ac 100644 --- a/crates/lib/docs_rs_storage/Cargo.toml +++ b/crates/lib/docs_rs_storage/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_storage" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_test_fakes/Cargo.toml b/crates/lib/docs_rs_test_fakes/Cargo.toml index 636fef8d1..70eba0438 100644 --- a/crates/lib/docs_rs_test_fakes/Cargo.toml +++ b/crates/lib/docs_rs_test_fakes/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_test_fakes" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_types/Cargo.toml b/crates/lib/docs_rs_types/Cargo.toml index 1f456b809..a5e4f4b25 100644 --- a/crates/lib/docs_rs_types/Cargo.toml +++ b/crates/lib/docs_rs_types/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_types" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_uri/Cargo.toml b/crates/lib/docs_rs_uri/Cargo.toml index 25ce8b622..30e21a1d4 100644 --- a/crates/lib/docs_rs_uri/Cargo.toml +++ b/crates/lib/docs_rs_uri/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_uri" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" [dependencies] diff --git a/crates/lib/docs_rs_utils/Cargo.toml b/crates/lib/docs_rs_utils/Cargo.toml index da1e029df..220795ba1 100644 --- a/crates/lib/docs_rs_utils/Cargo.toml +++ b/crates/lib/docs_rs_utils/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "docs_rs_utils" version = "0.1.0" +license = "MIT" +repository = "https://github.com/rust-lang/docs.rs" edition = "2024" build = "build.rs" diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index de68beadb..29273465a 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -204,6 +204,8 @@ RUN apt-get update \ WORKDIR /srv/docsrs -ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"] - +COPY --from=build /artifacts/docs_rs_admin /usr/local/bin/ COPY --from=build /artifacts/cratesfyi /usr/local/bin + +ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/docs_rs_admin", "--"] + diff --git a/src/bin/cratesfyi.rs b/src/bin/cratesfyi.rs deleted file mode 100644 index 73a4bf489..000000000 --- a/src/bin/cratesfyi.rs +++ /dev/null @@ -1,603 +0,0 @@ -use anyhow::{Context as _, Result}; -use chrono::NaiveDate; -use clap::{Parser, Subcommand, ValueEnum}; -use docs_rs::{Config, Context}; -use docs_rs_build_limits::Overrides; -use docs_rs_build_queue::priority::{ - get_crate_pattern_and_priority, list_crate_priorities, remove_crate_priority, - set_crate_priority, -}; -use docs_rs_builder::{RustwideBuilder, blacklist, queue_builder}; -use docs_rs_context::Context as NewContext; -use docs_rs_database::{ - crate_details, - service_config::{ConfigName, set_config}, -}; -use docs_rs_storage::add_path_into_database; -use docs_rs_types::{CrateId, KrateName, Version}; -use docs_rs_watcher::{queue_rebuilds_faulty_rustdoc, start_background_service_metric_collector}; -use docs_rs_web::run_web_server; -use futures_util::StreamExt; -use std::{env, fmt::Write, net::SocketAddr, path::PathBuf, sync::Arc}; -use tokio::runtime; - -fn main() { - // set the global log::logger for backwards compatibility - // through rustwide. - docs_rs_builder::logging::init(); - let guard = docs_rs_logging::init().expect("error initializing logging"); - - if let Err(err) = CommandLine::parse().handle_args() { - let mut msg = format!("Error: {err}"); - for cause in err.chain() { - write!(msg, "\n\nCaused by:\n {cause}").unwrap(); - } - eprintln!("{msg}"); - - let backtrace = err.backtrace().to_string(); - if !backtrace.is_empty() { - eprintln!("\nStack backtrace:\n{backtrace}"); - } - - // we need to drop the sentry guard here so all unsent - // errors are sent to sentry before - // process::exit kills everything. - drop(guard); - std::process::exit(1); - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] -#[value(rename_all = "snake_case")] -enum Toggle { - Enabled, - Disabled, -} - -#[derive(Debug, Clone, PartialEq, Eq, Parser)] -#[command( - about = env!("CARGO_PKG_DESCRIPTION"), - version = docs_rs::BUILD_VERSION, - rename_all = "kebab-case", -)] -enum CommandLine { - Build { - #[command(subcommand)] - subcommand: BuildSubcommand, - }, - - /// Starts web server - StartWebServer { - #[arg(name = "SOCKET_ADDR", default_value = "0.0.0.0:3000")] - socket_addr: SocketAddr, - }, - - StartRegistryWatcher { - /// Enable or disable the repository stats updater - #[arg( - long = "repository-stats-updater", - default_value = "disabled", - value_enum - )] - repository_stats_updater: Toggle, - #[arg(long = "queue-rebuilds", default_value = "enabled", value_enum)] - queue_rebuilds: Toggle, - }, - - StartBuildServer, - - /// Starts the daemon - Daemon { - /// Enable or disable the registry watcher to automatically enqueue newly published crates - #[arg(long = "registry-watcher", default_value = "enabled", value_enum)] - registry_watcher: Toggle, - }, - - /// Database operations - Database { - #[command(subcommand)] - subcommand: DatabaseSubcommand, - }, - - /// Interactions with the build queue - Queue { - #[command(subcommand)] - subcommand: QueueSubcommand, - }, -} - -impl CommandLine { - fn handle_args(self) -> Result<()> { - let config = Config::from_env()?.build()?; - let runtime = Arc::new(runtime::Builder::new_multi_thread().enable_all().build()?); - let ctx = runtime.block_on(Context::from_config(config))?; - let new_context = Arc::new(NewContext::from(&ctx)); - - match self { - Self::Build { subcommand } => subcommand.handle_args(ctx)?, - Self::StartRegistryWatcher { - repository_stats_updater, - queue_rebuilds, - } => ctx.runtime.block_on(async move { - if repository_stats_updater == Toggle::Enabled { - docs_rs_watcher::start_background_repository_stats_updater(&new_context) - .await?; - } - if queue_rebuilds == Toggle::Enabled { - docs_rs_watcher::start_background_queue_rebuild( - ctx.config.watcher.clone(), - &new_context, - ) - .await?; - } - - // When people run the services separately, we assume that we can collect service - // metrics from the registry watcher, which should only run once, and all the time. - start_background_service_metric_collector(&new_context).await?; - - docs_rs_watcher::watch_registry(&ctx.config.watcher.clone(), &new_context).await - })?, - Self::StartBuildServer => { - let builder_config = ctx.config.builder.clone(); - queue_builder( - &new_context, - &builder_config, - RustwideBuilder::init(builder_config.clone(), &new_context)?, - )?; - } - Self::StartWebServer { socket_addr } => { - // Blocks indefinitely - ctx.runtime.block_on(run_web_server( - Some(socket_addr), - ctx.config.web.clone(), - new_context, - ))?; - } - Self::Daemon { registry_watcher } => { - docs_rs::utils::start_daemon(ctx, registry_watcher == Toggle::Enabled)?; - } - Self::Database { subcommand } => subcommand.handle_args(ctx)?, - Self::Queue { subcommand } => subcommand.handle_args(ctx)?, - } - - Ok(()) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum QueueSubcommand { - /// Add a crate to the build queue - Add { - /// Name of crate to build - #[arg(name = "CRATE_NAME")] - crate_name: String, - /// Version of crate to build - #[arg(name = "CRATE_VERSION")] - crate_version: Version, - /// Priority of build (new crate builds get priority 0) - #[arg( - name = "BUILD_PRIORITY", - short = 'p', - long = "priority", - default_value = "5", - allow_negative_numbers = true - )] - build_priority: i32, - }, - - /// Interactions with build queue priorities - DefaultPriority { - #[command(subcommand)] - subcommand: PrioritySubcommand, - }, - - /// Queue rebuilds for broken nightly versions of rustdoc, either for a single date (start) or a range (start inclusive, end exclusive) - RebuildBrokenNightly { - /// Start date of nightly builds to rebuild (inclusive) - #[arg(name = "START", short = 's', long = "start")] - start_nightly_date: NaiveDate, - - /// End date of nightly builds to rebuild (exclusive, optional) - #[arg(name = "END", short = 'e', long = "end")] - end_nightly_date: Option, - }, -} - -impl QueueSubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - match self { - Self::Add { - crate_name, - crate_version, - build_priority, - } => { - let crate_name: KrateName = crate_name.parse()?; - ctx.build_queue.add_crate( - &crate_name, - &crate_version, - build_priority, - ctx.config.watcher.registry_url.as_deref(), - )?}, - - - Self::DefaultPriority { subcommand } => subcommand.handle_args(ctx)?, - - Self::RebuildBrokenNightly { start_nightly_date, end_nightly_date } => { - ctx.runtime.block_on(async move { - let mut conn = ctx.pool.get_async().await?; - let queued_rebuilds_amount = queue_rebuilds_faulty_rustdoc(&mut conn, &ctx.async_build_queue, &start_nightly_date, &end_nightly_date).await?; - println!("Queued {queued_rebuilds_amount} rebuilds for broken nightly versions of rustdoc"); - Ok::<(), anyhow::Error>(()) - })? - } - } - Ok(()) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum PrioritySubcommand { - /// Get priority for a crate - /// - /// (returns only the first matching pattern, there may be other matching patterns) - Get { crate_name: String }, - - /// List priorities for all patterns - List, - - /// Set all crates matching a pattern to a priority level - Set { - /// See https://www.postgresql.org/docs/current/functions-matching.html for pattern syntax - #[arg(name = "PATTERN")] - pattern: String, - /// The priority to give crates matching the given `PATTERN` - #[arg(allow_negative_numbers = true)] - priority: i32, - }, - - /// Remove the prioritization of crates for a pattern - Remove { - /// See https://www.postgresql.org/docs/current/functions-matching.html for pattern syntax - #[arg(name = "PATTERN")] - pattern: String, - }, -} - -impl PrioritySubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - ctx.runtime.block_on(async move { - let mut conn = ctx.pool.get_async().await?; - match self { - Self::List => { - for (pattern, priority) in list_crate_priorities(&mut conn).await? { - println!("{pattern:>20} : {priority:>3}"); - } - } - - Self::Get { crate_name } => { - if let Some((pattern, priority)) = - get_crate_pattern_and_priority(&mut conn, &crate_name).await? - { - println!("{pattern} : {priority}"); - } else { - println!("No priority found for {crate_name}"); - } - } - - Self::Set { pattern, priority } => { - set_crate_priority(&mut conn, &pattern, priority) - .await - .context("Could not set pattern's priority")?; - println!("Set pattern '{pattern}' to priority {priority}"); - } - - Self::Remove { pattern } => { - if let Some(priority) = remove_crate_priority(&mut conn, &pattern) - .await - .context("Could not remove pattern's priority")? - { - println!("Removed pattern '{pattern}' with priority {priority}"); - } else { - println!("Pattern '{pattern}' did not exist and so was not removed"); - } - } - } - Ok(()) - }) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum BuildSubcommand { - SetToolchain { - toolchain_name: String, - }, - - /// Locks the daemon, preventing it from building new crates - Lock, - - /// Unlocks the daemon to continue building new crates - Unlock, -} - -impl BuildSubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - match self { - Self::SetToolchain { toolchain_name } => { - ctx.runtime.block_on(async move { - let mut conn = ctx - .pool - .get_async() - .await - .context("failed to get a database connection")?; - set_config(&mut conn, ConfigName::Toolchain, toolchain_name) - .await - .context("failed to set toolchain in database") - })?; - } - - Self::Lock => ctx.build_queue.lock().context("Failed to lock")?, - Self::Unlock => ctx.build_queue.unlock().context("Failed to unlock")?, - } - - Ok(()) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum DatabaseSubcommand { - /// Run database migration - Migrate { - /// The database version to migrate to - #[arg(name = "VERSION")] - version: Option, - }, - - /// temporary command to update the `crates.latest_version_id` field - UpdateLatestVersionId, - - /// Updates GitHub/GitLab stats for crates. - UpdateRepositoryFields, - - /// Backfill GitHub/GitLab stats for crates. - BackfillRepositoryStats, - - /// Updates info for a crate from the registry's API - UpdateCrateRegistryFields { - #[arg(name = "CRATE")] - name: String, - }, - - AddDirectory { - /// Path of file or directory - #[arg(name = "DIRECTORY")] - directory: PathBuf, - }, - - /// Blacklist operations - Blacklist { - #[command(subcommand)] - command: BlacklistSubcommand, - }, - - /// Limit overrides operations - Limits { - #[command(subcommand)] - command: LimitsSubcommand, - }, -} - -impl DatabaseSubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - match self { - Self::Migrate { version } => ctx - .runtime - .block_on(async { - let mut conn = ctx.pool.get_async().await?; - docs_rs_database::migrate(&mut conn, version).await - }) - .context("Failed to run database migrations")?, - - Self::UpdateLatestVersionId => ctx - .runtime - .block_on(async { - let mut list_conn = ctx.pool.get_async().await?; - let mut update_conn = ctx.pool.get_async().await?; - - let mut result_stream = sqlx::query!( - r#"SELECT id as "id: CrateId", name FROM crates ORDER BY name"# - ) - .fetch(&mut *list_conn); - - while let Some(row) = result_stream.next().await { - let row = row?; - - println!("handling crate {}", row.name); - - crate_details::update_latest_version_id(&mut update_conn, row.id).await?; - } - - Ok::<(), anyhow::Error>(()) - }) - .context("Failed to update latest version id")?, - - Self::UpdateRepositoryFields => { - ctx.runtime - .block_on(ctx.repository_stats_updater.update_all_crates())?; - } - - Self::BackfillRepositoryStats => { - ctx.runtime - .block_on(ctx.repository_stats_updater.backfill_repositories())?; - } - - Self::UpdateCrateRegistryFields { name } => ctx.runtime.block_on(async move { - let mut conn = ctx.pool.get_async().await?; - let registry_data = ctx.registry_api.get_crate_data(&name).await?; - docs_rs_database::releases::update_crate_data_in_database( - &mut conn, - &name, - ®istry_data, - ) - .await - })?, - - Self::AddDirectory { directory } => { - ctx.runtime - .block_on(add_path_into_database( - &ctx.async_storage, - &ctx.config.builder.prefix, - directory, - )) - .context("Failed to add directory into database")?; - } - - Self::Blacklist { command } => command.handle_args(ctx)?, - - Self::Limits { command } => command.handle_args(ctx)?, - } - Ok(()) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum LimitsSubcommand { - /// Get sandbox limit overrides for a crate - Get { crate_name: String }, - - /// List sandbox limit overrides for all crates - List, - - /// Set sandbox limits overrides for a crate - Set { - crate_name: String, - #[arg(long)] - memory: Option, - #[arg(long)] - targets: Option, - #[arg(long)] - timeout: Option, - }, - - /// Remove sandbox limits overrides for a crate - Remove { crate_name: String }, -} - -impl LimitsSubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - ctx.runtime.block_on(async move { - let mut conn = ctx.pool.get_async().await?; - - match self { - Self::Get { crate_name } => { - let crate_name: KrateName = crate_name.parse()?; - let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; - println!("sandbox limit overrides for {crate_name} = {overrides:?}"); - } - - Self::List => { - for (crate_name, overrides) in Overrides::all(&mut conn).await? { - println!("sandbox limit overrides for {crate_name} = {overrides:?}"); - } - } - - Self::Set { - crate_name, - memory, - targets, - timeout, - } => { - let crate_name: KrateName = crate_name.parse()?; - let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; - println!("previous sandbox limit overrides for {crate_name} = {overrides:?}"); - let overrides = Overrides { - memory, - targets, - timeout: timeout - .map(|timeout| std::time::Duration::from_secs(timeout as _)), - }; - Overrides::save(&mut conn, &crate_name, overrides).await?; - let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; - println!("new sandbox limit overrides for {crate_name} = {overrides:?}"); - } - - Self::Remove { crate_name } => { - let crate_name: KrateName = crate_name.parse()?; - let overrides = Overrides::for_crate(&mut conn, &crate_name).await?; - println!("previous overrides for {crate_name} = {overrides:?}"); - Overrides::remove(&mut conn, &crate_name).await?; - } - } - Ok(()) - }) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum BlacklistSubcommand { - /// List all crates on the blacklist - List, - - /// Add a crate to the blacklist - Add { - /// Crate name - #[arg(name = "CRATE_NAME")] - crate_name: KrateName, - }, - - /// Remove a crate from the blacklist - Remove { - /// Crate name - #[arg(name = "CRATE_NAME")] - crate_name: KrateName, - }, -} - -impl BlacklistSubcommand { - fn handle_args(self, ctx: Context) -> Result<()> { - ctx.runtime.block_on(async move { - let conn = &mut ctx.pool.get_async().await?; - match self { - Self::List => { - let crates: Vec<_> = blacklist::list_crates(conn) - .await - .context("failed to list crates on blacklist")? - .into_iter() - .map(|k| k.to_string()) - .collect(); - - println!("{}", crates.join("\n")); - } - - Self::Add { crate_name } => blacklist::add_crate(conn, &crate_name) - .await - .context("failed to add crate to blacklist")?, - - Self::Remove { crate_name } => blacklist::remove_crate(conn, &crate_name) - .await - .context("failed to remove crate from blacklist")?, - } - Ok(()) - }) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Subcommand)] -enum DeleteSubcommand { - /// Delete a whole crate - Crate { - /// Name of the crate to delete - #[arg(name = "CRATE_NAME")] - name: String, - }, - /// Delete a single version of a crate (which may include multiple builds) - Version { - /// Name of the crate to delete - #[arg(name = "CRATE_NAME")] - name: String, - - /// The version of the crate to delete - #[arg(name = "VERSION")] - version: Version, - }, -} diff --git a/src/config.rs b/src/config.rs deleted file mode 100644 index b747b5396..000000000 --- a/src/config.rs +++ /dev/null @@ -1,55 +0,0 @@ -use anyhow::{Context as _, Result}; -use docs_rs_context::Config as NewConfig; -use std::sync::Arc; - -#[derive(Debug, derive_builder::Builder)] -#[builder(pattern = "owned")] -pub struct Config { - pub(crate) fastly: Arc, - pub(crate) opentelemetry: Arc, - pub(crate) registry_api: Arc, - pub(crate) database: Arc, - pub(crate) repository_stats: Arc, - pub(crate) storage: Arc, - pub(crate) build_queue: Arc, - pub(crate) build_limits: Arc, - pub builder: Arc, - pub watcher: Arc, - pub web: Arc, -} - -impl From<&Config> for NewConfig { - fn from(value: &Config) -> Self { - Self { - build_queue: Some(value.build_queue.clone()), - database: Some(value.database.clone()), - storage: Some(value.storage.clone()), - registry_api: Some(value.registry_api.clone()), - cdn: value.fastly.is_valid().then(|| value.fastly.clone()), - repository_stats: Some(value.repository_stats.clone()), - build_limits: Some(value.build_limits.clone()), - } - } -} - -impl Config { - pub fn from_env() -> Result { - Ok(ConfigBuilder::default() - .fastly(Arc::new( - docs_rs_fastly::Config::from_environment() - .context("error reading fastly config from environment")?, - )) - .opentelemetry(Arc::new(docs_rs_opentelemetry::Config::from_environment()?)) - .registry_api(Arc::new(docs_rs_registry_api::Config::from_environment()?)) - .database(Arc::new(docs_rs_database::Config::from_environment()?)) - .repository_stats(Arc::new( - docs_rs_repository_stats::Config::from_environment()?, - )) - .storage(Arc::new(docs_rs_storage::Config::from_environment()?)) - .build_queue(Arc::new(docs_rs_build_queue::Config::from_environment()?)) - .build_limits(Arc::new(docs_rs_build_limits::Config::from_environment()?)) - .builder(Arc::new(docs_rs_builder::Config::from_environment()?)) - .watcher(Arc::new(docs_rs_watcher::Config::from_environment()?)) - .web(Arc::new(docs_rs_web::Config::from_environment()?))) - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 99b45710c..000000000 --- a/src/context.rs +++ /dev/null @@ -1,126 +0,0 @@ -use crate::Config; -use anyhow::Result; -use docs_rs_build_queue::{AsyncBuildQueue, BuildQueue}; -use docs_rs_builder::BuilderMetrics; -use docs_rs_context::Context as NewContext; -use docs_rs_database::Pool; -use docs_rs_fastly::Cdn; -use docs_rs_opentelemetry::{AnyMeterProvider, get_meter_provider}; -use docs_rs_registry_api::RegistryApi; -use docs_rs_repository_stats::RepositoryStatsUpdater; -use docs_rs_storage::{AsyncStorage, Storage}; -use std::sync::Arc; -use tokio::runtime; - -pub struct Context { - pub config: Arc, - pub async_build_queue: Arc, - pub builder_metrics: Arc, // temporary place until the refactor is finished - pub build_queue: Arc, - pub storage: Arc, - pub async_storage: Arc, - pub cdn: Option>, - pub pool: Pool, - pub registry_api: Arc, - pub repository_stats_updater: Arc, - pub runtime: runtime::Handle, - pub meter_provider: AnyMeterProvider, -} - -impl From<&Context> for NewContext { - fn from(value: &Context) -> Self { - Self { - meter_provider: value.meter_provider.clone(), - runtime: value.runtime.clone(), - config: (&*value.config).into(), - pool: Some(value.pool.clone()), - build_queue: Some(value.async_build_queue.clone()), - blocking_build_queue: Some(value.build_queue.clone()), - storage: Some(value.async_storage.clone()), - blocking_storage: Some(value.storage.clone()), - registry_api: Some(value.registry_api.clone()), - cdn: value.cdn.clone(), - repository_stats: Some(value.repository_stats_updater.clone()), - } - } -} - -impl Context { - /// Create a new context environment from the given configuration. - pub async fn from_config(config: Config) -> Result { - let meter_provider = get_meter_provider(&config.opentelemetry)?; - let pool = Pool::new(&config.database, &meter_provider).await?; - let cdn = config - .fastly - .is_valid() - .then(|| Cdn::from_config(&config.fastly, &meter_provider)) - .transpose()?; - - let async_storage = - Arc::new(AsyncStorage::new(config.storage.clone(), &meter_provider).await?); - - Self::from_parts(config, meter_provider, pool, async_storage, cdn).await - } - - /// Create a new context environment from the given configuration, for running tests. - #[cfg(test)] - pub async fn from_test_config( - config: Config, - meter_provider: AnyMeterProvider, - pool: Pool, - async_storage: Arc, - ) -> Result { - Self::from_parts( - config, - meter_provider, - pool, - async_storage, - Some(Cdn::mock()), - ) - .await - } - - /// private function for context environment generation, allows passing in a - /// preconfigured instance metrics & pool from the database. - /// Mostly so we can support test environments with their db - async fn from_parts( - config: Config, - meter_provider: AnyMeterProvider, - pool: Pool, - async_storage: Arc, - cdn: Option, - ) -> Result { - let config = Arc::new(config); - - let cdn = cdn.map(Arc::new); - let async_build_queue = Arc::new(AsyncBuildQueue::new( - pool.clone(), - config.build_queue.clone(), - &meter_provider, - )); - - let runtime = runtime::Handle::current(); - - // sync wrappers around build-queue & storage async resources - let build_queue = Arc::new(BuildQueue::new(runtime.clone(), async_build_queue.clone())); - let storage = Arc::new(Storage::new(async_storage.clone(), runtime.clone())); - - Ok(Self { - async_build_queue, - build_queue, - builder_metrics: Arc::new(BuilderMetrics::new(&meter_provider)), - storage, - async_storage, - cdn, - pool: pool.clone(), - registry_api: Arc::new(RegistryApi::from_config(&config.registry_api)?), - repository_stats_updater: Arc::new(RepositoryStatsUpdater::new( - &config.repository_stats, - pool, - )), - runtime, - config, - meter_provider, - }) - } -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 3fe0de1df..000000000 --- a/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! [Docs.rs](https://docs.rs) (formerly cratesfyi) is an open source project to host -//! documentation of crates for the Rust Programming Language. -#![allow( - clippy::cognitive_complexity, - // TODO: `AxumNope::Redirect(EscapedURI, CachePolicy)` is too big. - clippy::result_large_err, -)] - -pub use self::config::Config; -pub use self::context::Context; - -pub use docs_rs_build_limits::DEFAULT_MAX_TARGETS; -pub use docs_rs_utils::{APP_USER_AGENT, BUILD_VERSION, RUSTDOC_STATIC_STORAGE_PREFIX}; - -mod config; -mod context; -pub mod utils; diff --git a/src/utils/mod.rs b/src/utils/mod.rs deleted file mode 100644 index cb3a194d3..000000000 --- a/src/utils/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! Various utilities for docs.rs - -pub use self::daemon::start_daemon; - -pub mod daemon;