diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..7771983 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,196 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "icarus" +version = "0.1.0" +dependencies = [ + "rusqlite", +] + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rusqlite" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78046161564f5e7cd9008aff3b2990b3850dc8e0349119b98e8f251e099f24d" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "vcpkg" +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 = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..9fa9f8c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "icarus" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rusqlite = { version = "0.30.0", features = ["bundled"] } +diesel = { version = "2.1.0", features = ["sqlite"] } diff --git a/diesel.toml b/diesel.toml new file mode 100644 index 0000000..8c56a8d --- /dev/null +++ b/diesel.toml @@ -0,0 +1,2 @@ +[print_schema] +filter = { only_tables = ["library", "track_locations"] } diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..f24bb96 --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,128 @@ +// @generated automatically by Diesel CLI. + +diesel::table! { + itunes_library (id) { + id -> Nullable, + artist -> Nullable, + title -> Nullable, + album -> Nullable, + year -> Nullable, + genre -> Nullable, + tracknumber -> Nullable, + location -> Nullable, + comment -> Nullable, + duration -> Nullable, + bitrate -> Nullable, + bpm -> Nullable, + rating -> Nullable, + grouping -> Nullable, + album_artist -> Nullable, + } +} + +diesel::table! { + library (id) { + id -> Nullable, + artist -> Nullable, + title -> Nullable, + album -> Nullable, + year -> Nullable, + genre -> Nullable, + tracknumber -> Nullable, + location -> Nullable, + comment -> Nullable, + url -> Nullable, + duration -> Nullable, + bitrate -> Nullable, + samplerate -> Nullable, + cuepoint -> Nullable, + bpm -> Nullable, + wavesummaryhex -> Nullable, + channels -> Nullable, + datetime_added -> Nullable, + mixxx_deleted -> Nullable, + played -> Nullable, + header_parsed -> Nullable, + filetype -> Nullable, + replaygain -> Nullable, + timesplayed -> Nullable, + rating -> Nullable, + key -> Nullable, + beats -> Nullable, + beats_version -> Nullable, + composer -> Nullable, + bpm_lock -> Nullable, + beats_sub_version -> Nullable, + keys -> Nullable, + keys_version -> Nullable, + keys_sub_version -> Nullable, + key_id -> Nullable, + grouping -> Nullable, + album_artist -> Nullable, + coverart_source -> Nullable, + coverart_type -> Nullable, + coverart_location -> Nullable, + coverart_hash -> Nullable, + replaygain_peak -> Nullable, + tracktotal -> Nullable, + color -> Nullable, + } +} + +diesel::table! { + rhythmbox_library (id) { + id -> Nullable, + artist -> Nullable, + title -> Nullable, + album -> Nullable, + year -> Nullable, + genre -> Nullable, + tracknumber -> Nullable, + location -> Nullable, + comment -> Nullable, + duration -> Nullable, + bitrate -> Nullable, + bpm -> Nullable, + key -> Nullable, + rating -> Nullable, + } +} + +diesel::table! { + track_locations (id) { + id -> Nullable, + location -> Nullable, + filename -> Nullable, + directory -> Nullable, + filesize -> Nullable, + fs_deleted -> Nullable, + needs_verification -> Nullable, + } +} + +diesel::table! { + traktor_library (id) { + id -> Nullable, + artist -> Nullable, + title -> Nullable, + album -> Nullable, + year -> Nullable, + genre -> Nullable, + tracknumber -> Nullable, + location -> Nullable, + comment -> Nullable, + duration -> Nullable, + bitrate -> Nullable, + bpm -> Nullable, + key -> Nullable, + rating -> Nullable, + } +} + +diesel::allow_tables_to_appear_in_same_query!( + itunes_library, + library, + rhythmbox_library, + track_locations, + traktor_library, +);