Skip to content

Commit fd78d3e

Browse files
committed
Save original documentation url
Documentation URL is required for #74
1 parent 0d26e88 commit fd78d3e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/db/add_package.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ pub fn add_package_into_database(conn: &Connection,
5252
rustdoc_status, test_status, license, repository_url, \
5353
homepage_url, description, description_long, readme, \
5454
authors, keywords, have_examples, downloads, files, \
55-
doc_targets, is_library, doc_rustc_version \
55+
doc_targets, is_library, doc_rustc_version, \
56+
documentation_url \
5657
) \
5758
VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, \
5859
$11, $12, $13, $14, $15, $16, $17, $18, $19, \
59-
$20, $21, $22, $23 \
60+
$20, $21, $22, $23, $24 \
6061
) \
6162
RETURNING id",
6263
&[&crate_id,
@@ -81,7 +82,8 @@ pub fn add_package_into_database(conn: &Connection,
8182
&files,
8283
&doc_targets.to_json(),
8384
&is_library,
84-
&res.rustc_version]));
85+
&res.rustc_version,
86+
&pkg.manifest().metadata().documentation]));
8587
// return id
8688
rows.get(0).get(0)
8789

@@ -92,7 +94,7 @@ pub fn add_package_into_database(conn: &Connection,
9294
homepage_url = $12, description = $13, description_long = $14, \
9395
readme = $15, authors = $16, keywords = $17, have_examples = $18, \
9496
downloads = $19, files = $20, doc_targets = $21, is_library = $22, \
95-
doc_rustc_version = $23 \
97+
doc_rustc_version = $23, documentation_url = $24 \
9698
WHERE crate_id = $1 AND version = $2",
9799
&[&crate_id,
98100
&format!("{}", pkg.manifest().version()),
@@ -116,7 +118,8 @@ pub fn add_package_into_database(conn: &Connection,
116118
&files,
117119
&doc_targets.to_json(),
118120
&is_library,
119-
&res.rustc_version]));
121+
&res.rustc_version,
122+
&pkg.manifest().metadata().documentation]));
120123
rows.get(0).get(0)
121124
}
122125
};

src/db/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub fn create_tables(conn: &Connection) -> Result<(), Error> {
101101
license VARCHAR(100), \
102102
repository_url VARCHAR(255), \
103103
homepage_url VARCHAR(255), \
104+
documentation_url VARCHAR(255), \
104105
description VARCHAR(1024), \
105106
description_long VARCHAR(51200), \
106107
readme VARCHAR(51200), \

0 commit comments

Comments
 (0)