diff --git a/.env b/.env index 342e241..db4cadc 100644 --- a/.env +++ b/.env @@ -1,2 +1 @@ -URL=https://vk.gy/database -DATABASE_URL=sqlite://db.sqlite \ No newline at end of file +URL=https://vk.gy/database \ No newline at end of file diff --git a/.gitignore b/.gitignore index 301d28b..ea8c4bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /target -*.sqlite \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 57225cf..d999f63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,7 +103,6 @@ dependencies = [ name = "data_extractor" version = "0.1.0" dependencies = [ - "diesel", "dotenvy", "reqwest", "scraper", @@ -122,28 +121,6 @@ dependencies = [ "syn", ] -[[package]] -name = "diesel" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c186a7418a2aac330bb76cde82f16c36b03a66fb91db32d20214311f9f6545" -dependencies = [ - "diesel_derives", - "libsqlite3-sys", -] - -[[package]] -name = "diesel_derives" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b758c91dbc3fe1fdcb0dba5bd13276c6a66422f2ef5795b58488248a310aa" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "dirs" version = "4.0.0" @@ -529,16 +506,6 @@ version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" -[[package]] -name = "libsqlite3-sys" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa" -dependencies = [ - "pkg-config", - "vcpkg", -] - [[package]] name = "lock_api" version = "0.4.7" @@ -850,30 +817,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -1078,9 +1021,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scraper" -version = "0.14.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7cb4dae083699a22a65aa9d2699c27f525e35dffaec38b10801e958ed4cf27" +checksum = "5684396b456f3eb69ceeb34d1b5cb1a2f6acf7ca4452131efa3ba0ee2c2d0a70" dependencies = [ "cssparser", "ego-tree", @@ -1194,9 +1137,9 @@ checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" @@ -1441,12 +1384,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "want" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index be4e684..f27b67f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,5 @@ edition = "2021" [dependencies] reqwest = {version = "0.11", features = ["blocking"]} -scraper = "0.14.0" -dotenvy = "0.15.1" -diesel = { version = "2.0.2", features = ["sqlite"] } \ No newline at end of file +scraper = "0.13.0" +dotenvy = "0.15.1" \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index afb0c2a..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -cargo install diesel_cli --no-default-features --features sqlite - -~/.cargo/bin/diesel setup \ No newline at end of file diff --git a/diesel.toml b/diesel.toml deleted file mode 100644 index 35a12ff..0000000 --- a/diesel.toml +++ /dev/null @@ -1,8 +0,0 @@ -# For documentation on how to configure this file, -# see https://diesel.rs/guides/configuring-diesel-cli - -[print_schema] -file = "src/schema.rs" - -[migrations_directory] -dir = "migrations" diff --git a/migrations/.keep b/migrations/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/migrations/2023-01-02-184703_create_artists/down.sql b/migrations/2023-01-02-184703_create_artists/down.sql deleted file mode 100644 index fe78390..0000000 --- a/migrations/2023-01-02-184703_create_artists/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP TABLE artists \ No newline at end of file diff --git a/migrations/2023-01-02-184703_create_artists/up.sql b/migrations/2023-01-02-184703_create_artists/up.sql deleted file mode 100644 index 25a2cf9..0000000 --- a/migrations/2023-01-02-184703_create_artists/up.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Your SQL goes here -CREATE TABLE artists ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - artist_name VARCHAR NOT NULL, - artist_url VARCHAR NOT NULL, - date INT NOT NULL, - author VARCHAR NOT NULL, - author_url VARCHAR NOT NULL -) \ No newline at end of file diff --git a/migrations/2023-01-02-184719_create_labels/down.sql b/migrations/2023-01-02-184719_create_labels/down.sql deleted file mode 100644 index 225a453..0000000 --- a/migrations/2023-01-02-184719_create_labels/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP TABLE labels \ No newline at end of file diff --git a/migrations/2023-01-02-184719_create_labels/up.sql b/migrations/2023-01-02-184719_create_labels/up.sql deleted file mode 100644 index 0bf9ad8..0000000 --- a/migrations/2023-01-02-184719_create_labels/up.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Your SQL goes here -CREATE TABLE labels ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - artist_name VARCHAR NOT NULL, - artist_url VARCHAR NOT NULL, - date INT NOT NULL, - author VARCHAR NOT NULL, - author_url VARCHAR NOT NULL -) \ No newline at end of file diff --git a/migrations/2023-01-02-184728_create_musicians/down.sql b/migrations/2023-01-02-184728_create_musicians/down.sql deleted file mode 100644 index 04420bb..0000000 --- a/migrations/2023-01-02-184728_create_musicians/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP TABLE musicians \ No newline at end of file diff --git a/migrations/2023-01-02-184728_create_musicians/up.sql b/migrations/2023-01-02-184728_create_musicians/up.sql deleted file mode 100644 index cb57551..0000000 --- a/migrations/2023-01-02-184728_create_musicians/up.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Your SQL goes here -CREATE TABLE musicians ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - artist_name VARCHAR NOT NULL, - artist_url VARCHAR NOT NULL, - date INT NOT NULL, - author VARCHAR NOT NULL, - author_url VARCHAR NOT NULL -) \ No newline at end of file diff --git a/migrations/2023-01-02-184734_create_releases/down.sql b/migrations/2023-01-02-184734_create_releases/down.sql deleted file mode 100644 index 5631e11..0000000 --- a/migrations/2023-01-02-184734_create_releases/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP TABLE releases \ No newline at end of file diff --git a/migrations/2023-01-02-184734_create_releases/up.sql b/migrations/2023-01-02-184734_create_releases/up.sql deleted file mode 100644 index 99d681e..0000000 --- a/migrations/2023-01-02-184734_create_releases/up.sql +++ /dev/null @@ -1,11 +0,0 @@ --- Your SQL goes here -CREATE TABLE releases ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - artist_name VARCHAR NOT NULL, - artist_url VARCHAR NOT NULL, - album VARCHAR NOT NULL, - album_url VARCHAR NOT NULL, - date INT NOT NULL, - author VARCHAR NOT NULL, - author_url VARCHAR NOT NULL -) \ No newline at end of file diff --git a/src/schema.rs b/src/schema.rs deleted file mode 100644 index fbfc0cb..0000000 --- a/src/schema.rs +++ /dev/null @@ -1,54 +0,0 @@ -// @generated automatically by Diesel CLI. - -diesel::table! { - artists (id) { - id -> Nullable, - artist_name -> Text, - artist_url -> Text, - date -> Integer, - author -> Text, - author_url -> Text, - } -} - -diesel::table! { - labels (id) { - id -> Nullable, - artist_name -> Text, - artist_url -> Text, - date -> Integer, - author -> Text, - author_url -> Text, - } -} - -diesel::table! { - musicians (id) { - id -> Nullable, - artist_name -> Text, - artist_url -> Text, - date -> Integer, - author -> Text, - author_url -> Text, - } -} - -diesel::table! { - releases (id) { - id -> Nullable, - artist_name -> Text, - artist_url -> Text, - album -> Text, - album_url -> Text, - date -> Integer, - author -> Text, - author_url -> Text, - } -} - -diesel::allow_tables_to_appear_in_same_query!( - artists, - labels, - musicians, - releases, -);