diff --git a/Cargo.lock b/Cargo.lock index 1074799c..c914cf2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -330,7 +330,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.5.0", + "indexmap 2.6.0", "lexical-core", "num", "serde", @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" dependencies = [ "brotli", "flate2", @@ -674,9 +674,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -685,9 +685,9 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", @@ -770,9 +770,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "av1-grain" @@ -790,9 +790,9 @@ dependencies = [ [[package]] name = "avif-serialize" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" +checksum = "e335041290c43101ca215eed6f43ec437eb5a42125573f600fc3fa42b9bddd62" dependencies = [ "arrayvec", ] @@ -889,9 +889,9 @@ dependencies = [ [[package]] name = "aws-sdk-dynamodb" -version = "1.47.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8abc61e7374a01ecebcc3fd465655a2e1b83455f15b26716bfac05c35d25fa1b" +checksum = "f38c3122dd27386bf38745f67c9f2c2c47479157bc8a697a3fd97ff45e78dd34" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1079,7 +1079,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -1157,9 +1157,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", "axum-core", @@ -1184,9 +1184,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -1259,6 +1259,12 @@ dependencies = [ "vsimd", ] +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "benchmarks" version = "0.13.3" @@ -1292,6 +1298,9 @@ name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] [[package]] name = "bitpacking" @@ -1357,16 +1366,16 @@ dependencies = [ "home", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-named-pipe", "hyper-rustls 0.27.3", "hyper-util", "hyperlocal", "log", "pin-project-lite", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_derive", @@ -1394,9 +1403,9 @@ dependencies = [ [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1545,9 +1554,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -1659,18 +1668,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstyle", "clap_lex", @@ -1756,6 +1765,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const-random" version = "0.1.18" @@ -1838,6 +1853,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32c" version = "0.6.8" @@ -2096,7 +2126,7 @@ dependencies = [ "glob", "half", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "num_cpus", @@ -2272,7 +2302,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "paste", @@ -2301,7 +2331,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "hex", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "paste", @@ -2359,7 +2389,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "once_cell", @@ -2438,6 +2468,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -2508,6 +2549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -2559,6 +2601,12 @@ dependencies = [ "litrs", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "downcast" version = "0.11.0" @@ -2615,6 +2663,9 @@ name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +dependencies = [ + "serde", +] [[package]] name = "encode_unicode" @@ -2783,9 +2834,11 @@ dependencies = [ "qdrant-client", "serde_json", "spider", + "sqlx", "swiftide", "temp-dir", "tokio", + "tracing", "tracing-subscriber", ] @@ -2882,9 +2935,9 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] @@ -2919,9 +2972,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -2933,6 +2986,8 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ + "futures-core", + "futures-sink", "spin", ] @@ -2974,11 +3029,12 @@ dependencies = [ [[package]] name = "fluvio-compression" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94399c0eb4224a511515fdf134f5ccd05b3c7ea1de566b9ab3cac63e6a4bc8f2" +checksum = "928267ce67c1f2136c01193d90de8d9fd02e5749a4de5317ef86b290c92fb5e3" dependencies = [ "bytes", + "fluvio-types", "serde", "thiserror", ] @@ -3109,9 +3165,9 @@ dependencies = [ [[package]] name = "fluvio-socket" -version = "0.14.10" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c945f5ade92202b9588a2114a45323048e7c49c5c434b69086a9d7b2297ad4c1" +checksum = "be2eb33c1d1431ce997ab1ac742ab58a7fc835685a81ffa06f42ca6fd3b980fa" dependencies = [ "async-channel 1.9.0", "async-lock 3.4.0", @@ -3192,9 +3248,9 @@ dependencies = [ [[package]] name = "fluvio-types" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f04460aa87f1cfeb5f6099977b9f9d145ce302cd9de85c5c13a9877568dc39" +checksum = "c62ec635ba322027b0557f1deaa1e636f38dd9ee15a0d8cddbd58f830ba6f5e4" dependencies = [ "event-listener 5.3.1", "serde", @@ -3234,6 +3290,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -3301,9 +3363,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -3332,15 +3394,26 @@ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", "futures-util", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.12.3", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -3466,9 +3539,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -3524,7 +3597,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -3543,7 +3616,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -3577,6 +3650,26 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "heck" version = "0.4.1" @@ -3669,6 +3762,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -3786,9 +3888,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -3814,9 +3916,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -3838,9 +3940,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -3864,7 +3966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -3880,7 +3982,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -3896,9 +3998,9 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -3913,7 +4015,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -3928,7 +4030,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -3938,20 +4040,19 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2 0.5.7", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] @@ -3964,7 +4065,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -4090,9 +4191,9 @@ dependencies = [ [[package]] name = "imgref" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] name = "indenter" @@ -4113,12 +4214,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -4208,9 +4309,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -4288,9 +4389,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -4750,6 +4851,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] [[package]] name = "lebe" @@ -4858,9 +4962,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libfuzzer-sys" @@ -4887,7 +4991,18 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", ] [[package]] @@ -4944,11 +5059,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -5130,7 +5245,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", - "simd-adler32", ] [[package]] @@ -5140,6 +5254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -5347,6 +5462,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.6" @@ -5432,9 +5564,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -5451,7 +5583,7 @@ dependencies = [ "chrono", "futures", "humantime", - "hyper 1.4.1", + "hyper 1.5.0", "itertools 0.13.0", "md-5", "parking_lot 0.12.3", @@ -5460,7 +5592,7 @@ dependencies = [ "rand", "reqwest", "ring", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "snafu", @@ -5527,9 +5659,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "7b8cefcf97f41316955f9294cd61f639bdcfa9f2f230faac6cb896aa8ab64704" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -5559,9 +5691,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -5679,7 +5811,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -5766,6 +5898,15 @@ dependencies = [ "stfu8", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -5774,9 +5915,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -5785,9 +5926,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -5795,9 +5936,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", @@ -5808,9 +5949,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -5824,7 +5965,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.5.0", + "indexmap 2.6.0", +] + +[[package]] +name = "pgvector" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0e8871b6d7ca78348c6cd29b911b94851f3429f0cd403130ca17f26c1fb91a6" +dependencies = [ + "sqlx", ] [[package]] @@ -5929,18 +6079,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -5970,23 +6120,44 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.7.4", + "miniz_oxide 0.8.0", ] [[package]] @@ -6022,9 +6193,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "portable-atomic-util" @@ -6103,18 +6274,18 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", "syn 2.0.79", @@ -6245,9 +6416,9 @@ dependencies = [ [[package]] name = "qdrant-client" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb280f1fcb49931fce7252b81c759a9ca1ccb31151f34d13f1a6f19ea7e93be2" +checksum = "bbff72d38eac3860f5888f02d4688690de6cdc77c901112d3b0788694afc1d37" dependencies = [ "anyhow", "derive_builder", @@ -6318,7 +6489,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.15", "socket2 0.5.7", "thiserror", "tokio", @@ -6335,7 +6506,7 @@ dependencies = [ "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.13", + "rustls 0.23.15", "slab", "thiserror", "tinyvec", @@ -6536,9 +6707,9 @@ dependencies = [ "num-bigint", "percent-encoding", "pin-project-lite", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "ryu", "sha1_smol", @@ -6570,9 +6741,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -6657,7 +6828,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-tls", "hyper-util", @@ -6671,9 +6842,9 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-native-certs 0.8.0", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", @@ -6754,6 +6925,26 @@ dependencies = [ "byteorder", ] +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rust-stemmers" version = "1.2.0" @@ -6832,9 +7023,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -6864,7 +7055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -6877,7 +7068,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -6894,19 +7085,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -6931,9 +7121,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -6952,9 +7142,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -7102,9 +7292,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -7123,15 +7313,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -7141,9 +7331,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", @@ -7157,7 +7347,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -7173,6 +7363,17 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha1_smol" version = "1.0.1" @@ -7223,6 +7424,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -7294,6 +7505,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "snafu" @@ -7398,6 +7612,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "spm_precompiled" version = "0.1.4" @@ -7410,6 +7634,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "sqlformat" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" +dependencies = [ + "nom", + "unicode_categories", +] + [[package]] name = "sqlparser" version = "0.49.0" @@ -7431,6 +7665,208 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "sqlx" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" +dependencies = [ + "atoi", + "byteorder", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "either", + "event-listener 5.3.1", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.14.5", + "hashlink", + "hex", + "indexmap 2.6.0", + "log", + "memchr", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.79", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" +dependencies = [ + "dotenvy", + "either", + "heck 0.5.0", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.79", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "bytes", + "chrono", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", + "uuid", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -7498,6 +7934,17 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c3ee6129eec20fed59acf2e9cfb3ffd20d0bbe39fe334c22af0edc56dfe752" +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + [[package]] name = "strsim" version = "0.11.1" @@ -7663,6 +8110,7 @@ dependencies = [ "mockall", "ollama-rs", "parquet", + "pgvector", "qdrant-client", "redb", "redis", @@ -7672,6 +8120,7 @@ dependencies = [ "serde", "serde_json", "spider", + "sqlx", "strum", "strum_macros", "swiftide-core", @@ -7975,9 +8424,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -7998,9 +8447,9 @@ checksum = "bc1ee6eef34f12f765cb94725905c6312b6610ab2b0940889cfe58dae7bc3c72" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand 2.1.1", @@ -8359,7 +8808,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -8410,7 +8859,7 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -8428,11 +8877,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -8455,14 +8904,14 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-timeout", "hyper-util", "percent-encoding", "pin-project", "prost 0.13.3", "rustls-native-certs 0.8.0", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "socket2 0.5.7", "tokio", "tokio-rustls 0.26.0", @@ -8615,9 +9064,9 @@ dependencies = [ [[package]] name = "tree-sitter-language" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ca9cabf8f61ee3e83c0f532c45e9e082627f77a8bb9553684df584edcf82654" +checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" [[package]] name = "tree-sitter-python" @@ -8661,9 +9110,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" [[package]] name = "try-lock" @@ -8689,9 +9138,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ua_generator" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20093f826c4866dc7d4808ecd9ed351e3021b94194f25f490f0ea9ea030e1f87" +checksum = "b0d4f7fcefca2ec9c0b34043d4cd8c233fb975607a6c51143e765d9f22c652d8" dependencies = [ "fastrand 2.1.1", "serde", @@ -8701,9 +9150,9 @@ dependencies = [ [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unic-char-property" @@ -8766,9 +9215,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -8794,6 +9243,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -8837,7 +9292,7 @@ dependencies = [ "log", "native-tls", "once_cell", - "rustls 0.23.13", + "rustls 0.23.15", "rustls-pki-types", "serde", "serde_json", @@ -8884,9 +9339,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "md-5", @@ -8971,11 +9426,17 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -8984,9 +9445,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -8999,9 +9460,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -9011,9 +9472,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9021,9 +9482,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -9034,15 +9495,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", @@ -9053,9 +9514,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -9076,6 +9537,16 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +[[package]] +name = "whoami" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall 0.5.7", + "wasite", +] + [[package]] name = "widestring" version = "1.1.0" @@ -9302,9 +9773,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -9332,7 +9803,7 @@ dependencies = [ "futures", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index f6001ca8..5de58fab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,8 @@ arrow-array = { version = "52.0", default-features = false } arrow = { version = "52.2" } parquet = { version = "52.2", default-features = false, features = ["async"] } redb = { version = "2.1" } +sqlx = { version = "0.8.2", features = ["postgres", "uuid"] } +pgvector = { version = "0.4.0", features = ["sqlx"] } # Testing test-log = "0.2.16" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index c0addb06..fe454a30 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -21,13 +21,16 @@ swiftide = { path = "../swiftide/", features = [ "ollama", "fluvio", "lancedb", + "pgvector", ] } tracing-subscriber = "0.3" +tracing = { workspace = true } serde_json = { workspace = true } spider = { workspace = true } qdrant-client = { workspace = true } fluvio = { workspace = true } temp-dir = { workspace = true } +sqlx = { workspace = true } [[example]] doc-scrape-examples = true @@ -91,3 +94,7 @@ path = "fluvio.rs" [[example]] name = "lancedb" path = "lancedb.rs" + +[[example]] +name = "index-md-pgvector" +path = "index_md_into_pgvector.rs" diff --git a/examples/index_md_into_pgvector.rs b/examples/index_md_into_pgvector.rs new file mode 100644 index 00000000..8cd0f03e --- /dev/null +++ b/examples/index_md_into_pgvector.rs @@ -0,0 +1,75 @@ +/** +* This example demonstrates how to use the Pgvector integration with Swiftide +*/ +use std::path::PathBuf; +use swiftide::{ + indexing::{ + self, + loaders::FileLoader, + transformers::{ + metadata_qa_text::NAME as METADATA_QA_TEXT_NAME, ChunkMarkdown, Embed, MetadataQAText, + }, + EmbeddedField, + }, + integrations::{self, pgvector::PgVector}, +}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + tracing::info!("Starting PgVector indexing test"); + + // Get the manifest directory path + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"); + + // Create a PathBuf to test dataset from the manifest directory + let test_dataset_path = PathBuf::from(manifest_dir).join("test_dataset"); + tracing::info!("Test Dataset path: {:?}", test_dataset_path); + + let pgv_db_url = std::env::var("DATABASE_URL") + .as_deref() + .unwrap_or("postgresql://myuser:mypassword@localhost:5432/mydatabase") + .to_owned(); + + let ollama_client = integrations::ollama::Ollama::default() + .with_default_prompt_model("llama3.2:latest") + .to_owned(); + + let fastembed = + integrations::fastembed::FastEmbed::try_default().expect("Could not create FastEmbed"); + + // Configure Pgvector with a default vector size, a single embedding + // and in addition to embedding the text metadata, also store it in a field + let pgv_storage = PgVector::builder() + .try_from_url(pgv_db_url, Some(10)) + .await + .expect("Failed to connect to postgres server") + .vector_size(384) + .with_vector(EmbeddedField::Combined) + .with_metadata(METADATA_QA_TEXT_NAME) + .table_name("swiftide_pgvector_test".to_string()) + .build() + .unwrap(); + + // Drop the existing test table before running the test + tracing::info!("Dropping existing test table if it exists"); + let drop_table_sql = "DROP TABLE IF EXISTS swiftide_pgvector_test"; + + if let Some(pool) = pgv_storage.get_pool() { + sqlx::query(drop_table_sql).execute(pool).await?; + } else { + return Err("Failed to get database connection pool".into()); + } + + tracing::info!("Starting indexing pipeline"); + indexing::Pipeline::from_loader(FileLoader::new(test_dataset_path).with_extensions(&["md"])) + .then_chunk(ChunkMarkdown::from_chunk_range(10..2048)) + .then(MetadataQAText::new(ollama_client.clone())) + .then_in_batch(Embed::new(fastembed).with_batch_size(100)) + .then_store_with(pgv_storage.clone()) + .run() + .await?; + + tracing::info!("Indexing test completed successfully"); + Ok(()) +} diff --git a/examples/test_dataset/README.md b/examples/test_dataset/README.md new file mode 100644 index 00000000..38e67a72 --- /dev/null +++ b/examples/test_dataset/README.md @@ -0,0 +1,41 @@ +# **Swiftide: A Fast, Streaming Indexing and Query Library for AI Applications** + +Swiftide is a Rust-native library designed to simplify the development of Large Language Model (LLM) applications. It addresses the challenge of providing context to LLMs for solving real-world problems by enabling efficient ingestion, transformation, indexing, and querying of extensive data. This process, known as Retrieval Augmented Generation (RAG), enhances the capabilities of LLMs. + +## **Key Features:** + +* **Fast and Modular Indexing:** Swiftide offers a high-performance, streaming indexing pipeline with asynchronous, parallel processing capabilities. +* **Query Pipeline:** An experimental query pipeline facilitates efficient retrieval and processing of information. +* **Versatility:** The library includes various loaders, transformers, semantic chunkers, embedders, and other components, providing flexibility for different use cases. +* **Extensibility:** Developers can bring their own transformers by extending straightforward traits or using closures. +* **Pipeline Management:** Swiftide supports splitting and merging pipelines for complex workflows. +* **Prompt Templating:** Jinja-like templating simplifies the creation of prompts. +* **Storage Options:** Integration with multiple storage backends, including Qdrant, Redis, and LanceDB. +* **Integrations:** Seamless integration with popular tools and platforms like OpenAI, Groq, Redis, Qdrant, Ollama, FastEmbed-rs, Fluvio, LanceDB, and Treesitter. +* **Evaluation:** Pipeline evaluation using RAGAS for performance assessment. +* **Sparse Vector Support:** Enables hybrid search with sparse vector support. +* **Tracing:** Built-in tracing support for logging and debugging. + +## **Technical Insights:** + +* **Rust-Native:** Developed in Rust for performance, safety, and concurrency. +* **Streaming Architecture:** Employs a streaming architecture for efficient processing of large datasets. +* **Modularity:** Highly modular design allows for customization and extensibility. +* **Asynchronous and Parallel Processing:** Leverages asynchronous and parallel processing for optimal performance. +* **Strong Typing:** The query pipeline is fully and strongly typed, ensuring type safety and developer productivity. +* **OpenAI Integration:** Provides seamless integration with OpenAI for powerful LLM capabilities. + +## **Getting Started:** + +To get started with Swiftide, developers need to set up a Rust project, add the Swiftide library as a dependency, enable the required integration features, and write a pipeline. Comprehensive examples and documentation are available to guide developers through the process. + +## **Current Status and Future Roadmap:** + +Swiftide is under active development and may introduce breaking changes as it progresses towards version 1.0. The documentation may not cover all features and could be slightly outdated. Despite these considerations, Swiftide offers a promising solution for building efficient and scalable LLM applications. The project's roadmap includes addressing open issues and incorporating proposed features to enhance its functionality and usability. + +## **Community and Contributions:** + +The Swiftide community welcomes feedback, questions, and contributions. Developers can connect with the community on Discord and contribute to the project by forking the repository, creating pull requests, or opening issues with enhancement tags. + +**Overall, Swiftide presents a powerful and flexible framework for building Retrieval Augmented Generation (RAG) pipelines in Rust. Its focus on performance, modularity, and extensibility makes it a valuable tool for developers working with LLMs and AI applications.** + diff --git a/scripts/docker/docker-compose-db-pg.yml b/scripts/docker/docker-compose-db-pg.yml new file mode 100644 index 00000000..7d15a3e2 --- /dev/null +++ b/scripts/docker/docker-compose-db-pg.yml @@ -0,0 +1,46 @@ +services: + test_env_pgvector: + image: ankane/pgvector:v0.5.1 + container_name: test_env_pgvector + environment: + POSTGRES_USER: ${POSTGRES_USER:-myuser} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mypassword} + POSTGRES_DB: ${POSTGRES_DB:-mydatabase} + ports: + - "5432:5432" + volumes: + - test_env_pgvector_data:/var/lib/postgresql/data + networks: + - pg-network + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-myuser} -d ${POSTGRES_DB:-mydatabase}"] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + + pgadmin: + image: dpage/pgadmin4 + container_name: test_env_pgadmin + environment: + PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@admin.com} + PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-root} + ports: + - "8080:80" + volumes: + - test_env_pgadmin_data:/var/lib/pgadmin + depends_on: + - test_env_pgvector + networks: + - pg-network + restart: unless-stopped + +networks: + pg-network: + name: pg-network + +volumes: + test_env_pgvector_data: + name: test_env_pgvector_data + test_env_pgadmin_data: + name: test_env_pgadmin_data diff --git a/swiftide-integrations/Cargo.toml b/swiftide-integrations/Cargo.toml index e786fffa..84541912 100644 --- a/swiftide-integrations/Cargo.toml +++ b/swiftide-integrations/Cargo.toml @@ -34,6 +34,13 @@ async-openai = { workspace = true, optional = true } qdrant-client = { workspace = true, optional = true, default-features = false, features = [ "serde", ] } +sqlx = { workspace = true, optional = true, features = [ + "postgres", + "runtime-tokio", + "chrono", + "uuid" +] } +pgvector = { workspace = true, optional = true, features = ["sqlx"] } redis = { version = "0.27", features = [ "aio", "tokio-comp", @@ -102,6 +109,8 @@ default = ["rustls"] rustls = ["reqwest/rustls-tls-native-roots"] # Qdrant for storage qdrant = ["dep:qdrant-client", "swiftide-core/qdrant"] +# PgVector for storage +pgvector = ["dep:sqlx", "dep:pgvector"] # Redis for caching and storage redis = ["dep:redis"] # Tree-sitter for code operations and chunking diff --git a/swiftide-integrations/src/lib.rs b/swiftide-integrations/src/lib.rs index d1e38a08..74f1c1d6 100644 --- a/swiftide-integrations/src/lib.rs +++ b/swiftide-integrations/src/lib.rs @@ -16,6 +16,8 @@ pub mod ollama; pub mod openai; #[cfg(feature = "parquet")] pub mod parquet; +#[cfg(feature = "pgvector")] +pub mod pgvector; #[cfg(feature = "qdrant")] pub mod qdrant; #[cfg(feature = "redb")] diff --git a/swiftide-integrations/src/pgvector/mod.rs b/swiftide-integrations/src/pgvector/mod.rs new file mode 100644 index 00000000..a53c1204 --- /dev/null +++ b/swiftide-integrations/src/pgvector/mod.rs @@ -0,0 +1,178 @@ +//! This module integrates with the pgvector database, providing functionalities to create and manage vector collections, +//! store data, and optimize indexing for efficient searches. +//! +//! pgvector is utilized in both the `indexing::Pipeline` and `query::Pipeline` modules. + +mod persist; +mod pgv_table_types; + +use anyhow::Result; +use derive_builder::Builder; +use sqlx::postgres::PgPoolOptions; +use sqlx::PgPool; +use std::fmt; + +use pgv_table_types::{FieldConfig, MetadataConfig, VectorConfig}; + +const PG_POOL_MAX_CONN: u32 = 10; +const DEFAULT_BATCH_SIZE: usize = 50; +const DEFAULT_VEC_DIM: i32 = 384; + +/// Represents a Pgvector client with configuration options. +/// +/// This struct is used to interact with the Pgvector vector database, providing methods to manage vector collections, +/// store data, and ensure efficient searches. The client can be cloned with low cost as it shares connections. +#[derive(Builder, Clone)] +#[builder(setter(into, strip_option), build_fn(error = "anyhow::Error"))] +pub struct PgVector { + /// Database connection pool. + #[builder(default)] + connection_pool: Option, + + /// Table name to store vectors in. + #[builder(default = "String::from(\"swiftide_pgv_store\")")] + table_name: String, + + /// Size of the vectors to store. + #[builder(default = "DEFAULT_VEC_DIM")] + vector_size: i32, + + /// Batch size for storing nodes. + #[builder(default = "Some(DEFAULT_BATCH_SIZE)")] + batch_size: Option, + + /// Field configuration for the Pgvector table, determining the eventual table schema. + /// + /// Supports multiple field types; see [`FieldConfig`] for details. + #[builder(default)] + fields: Vec, +} + +impl fmt::Debug for PgVector { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let connection_status = if let Some(pool) = &self.connection_pool { + if pool.is_closed() { + "Closed" + } else { + "Open" + } + } else { + "Not initialized" + }; + + f.debug_struct("PgVector") + .field("table_name", &self.table_name) + .field("vector_size", &self.vector_size) + .field("batch_size", &self.batch_size) + .field("connection_status", &connection_status) + .finish() + } +} + +impl PgVector { + /// Creates a new `PgVectorBuilder` instance using the default configuration. + /// + /// # Returns + /// + /// * `PgVectorBuilder` - A builder instance that can be used to configure + /// and construct a `PgVector` object. + /// + /// This function returns a default `PgVectorBuilder` that can be customized + /// using builder methods such as `with_vector`, `with_metadata`, and others. + pub fn builder() -> PgVectorBuilder { + PgVectorBuilder::default() + } + + /// The `get_pool` function retrieves a reference to the connection pool associated with this object. + /// + /// # Returns + /// + /// * `Option<&PgPool>` - A reference to the connection pool if it exists, otherwise `None`. + /// + /// # Arguments + /// + /// None + /// + /// # Errors + /// + /// This function does not return any errors. + /// It will always return a `Some` containing a reference to the `PgPool` if available, or `None` if no pool is set. + pub fn get_pool(&self) -> Option<&PgPool> { + self.connection_pool.as_ref() + } +} + +impl PgVectorBuilder { + /// Tries to create a `PgVectorBuilder` from a given URL. + /// + /// Returns + /// + /// # Arguments + /// + /// * `url` - A string slice that holds the URL for the Pgvector client. + /// + /// # Returns + /// + /// A `Result` containing the `PgVectorBuilder` if successful, or an error otherwise. + /// + /// # Errors + /// + /// Errors if client fails build + pub async fn try_from_url( + mut self, + url: impl AsRef, + connection_max: Option, + ) -> Result { + self.connection_pool = Some(Some( + PgPoolOptions::new() + .max_connections(connection_max.unwrap_or(PG_POOL_MAX_CONN)) + .connect(url.as_ref()) + .await?, + )); + Ok(self) + } + + /// The `with_vector` function adds a vector configuration to the object. + /// + /// # Arguments + /// + /// * `config` - A configuration that can be converted into a `VectorConfig`. + /// + /// # Returns + /// + /// * `&mut Self` - A mutable reference to the current object, allowing method chaining. + /// + /// This function will no longer panic. + pub fn with_vector(&mut self, config: impl Into) -> &mut Self { + // Use `get_or_insert_with` to initialize `fields` if it's `None` + self.fields + .get_or_insert_with(Self::default_fields) + .push(FieldConfig::Vector(config.into())); + + self + } + + /// Adds a metadata configuration to the object. + /// + /// # Arguments + /// + /// * `config` - The metadata configuration to add. + /// + /// # Returns + /// + /// * `&mut Self` - A mutable reference to the current object, allowing method chaining. + /// + /// This function will no longer panic. + pub fn with_metadata(&mut self, config: impl Into) -> &mut Self { + // Use `get_or_insert_with` to initialize `fields` if it's `None` + self.fields + .get_or_insert_with(Self::default_fields) + .push(FieldConfig::Metadata(config.into())); + + self + } + + fn default_fields() -> Vec { + vec![FieldConfig::ID, FieldConfig::Chunk] + } +} diff --git a/swiftide-integrations/src/pgvector/persist.rs b/swiftide-integrations/src/pgvector/persist.rs new file mode 100644 index 00000000..5a602753 --- /dev/null +++ b/swiftide-integrations/src/pgvector/persist.rs @@ -0,0 +1,74 @@ +//! This module implements the `Persist` trait for the `PgVector` struct. +//! It provides methods for setting up storage, saving individual nodes, and batch-storing multiple nodes. +//! This integration enables the Swiftide project to use `PgVector` as a storage backend. + +use crate::pgvector::pgv_table_types::FieldConfig; +use crate::pgvector::PgVector; +use anyhow::Result; +use async_trait::async_trait; +use swiftide_core::{ + indexing::{IndexingStream, Node}, + Persist, +}; + +#[async_trait] +impl Persist for PgVector { + #[tracing::instrument(skip_all)] + async fn setup(&self) -> Result<()> { + tracing::info!("Setting up table {} for PgVector", &self.table_name); + + let mut tx = self + .connection_pool + .as_ref() + .ok_or_else(|| anyhow::anyhow!("Database connection not established"))? + .begin() + .await?; + + // Create extension + let sql = "CREATE EXTENSION IF NOT EXISTS vector"; + sqlx::query(sql).execute(&mut *tx).await?; + + // Create table + let create_table_sql = self.generate_create_table_sql()?; + tracing::debug!("Executing CREATE TABLE SQL: {}", create_table_sql); + sqlx::query(&create_table_sql).execute(&mut *tx).await?; + + // Create HNSW index + let vector_field = self + .fields + .iter() + .find(|f| matches!(f, FieldConfig::Vector(_))) + .ok_or_else(|| anyhow::anyhow!("No vector field found in configuration"))?; + let index_sql = + format!( + "CREATE INDEX IF NOT EXISTS {}_embedding_idx ON {} USING hnsw ({} vector_cosine_ops)", + self.table_name, self.table_name, vector_field.field_name() + ); + tracing::debug!("Executing CREATE INDEX SQL: {}", index_sql); + sqlx::query(&index_sql).execute(&mut *tx).await?; + + tx.commit().await?; + + tracing::info!("Table {} setup completed", &self.table_name); + Ok(()) + } + + #[tracing::instrument(skip_all)] + async fn store(&self, node: Node) -> Result { + let mut nodes = vec![node; 1]; + self.store_nodes(&nodes).await?; + + let node = nodes.swap_remove(0); + + Ok(node) + } + + #[tracing::instrument(skip_all)] + async fn batch_store(&self, nodes: Vec) -> IndexingStream { + self.store_nodes(&nodes).await.map(|()| nodes).into() + } + + fn batch_size(&self) -> Option { + self.batch_size + } +} diff --git a/swiftide-integrations/src/pgvector/pgv_table_types.rs b/swiftide-integrations/src/pgvector/pgv_table_types.rs new file mode 100644 index 00000000..25175655 --- /dev/null +++ b/swiftide-integrations/src/pgvector/pgv_table_types.rs @@ -0,0 +1,228 @@ +//! This module provides functionality to convert a `Node` into a `PostgreSQL` table schema. +//! This conversion is crucial for storing data in `PostgreSQL`, enabling efficient vector similarity searches +//! through the `pgvector` extension. The module also handles metadata augmentation and ensures compatibility +//! with PostgreSQL's required data format. + +use crate::pgvector::PgVector; +use anyhow::{anyhow, Result}; +use pgvector as ExtPgVector; +use swiftide_core::indexing::{EmbeddedField, Node}; + +pub(crate) fn normalize_field_name(field: &str) -> String { + field + .to_lowercase() + .replace(|c: char| !c.is_alphanumeric(), "_") +} + +#[derive(Clone, Debug)] +pub struct VectorConfig { + embedded_field: EmbeddedField, +} + +impl VectorConfig { + pub fn new(embedded_field: EmbeddedField) -> Self { + Self { embedded_field } + } + + pub fn field_name(&self) -> String { + format!( + "vector_{}", + normalize_field_name(&self.embedded_field.to_string()), + ) + } +} + +impl From for VectorConfig { + fn from(val: EmbeddedField) -> Self { + Self::new(val) + } +} + +#[derive(Clone, Debug)] +pub struct MetadataConfig { + field: String, + original_field: String, +} + +impl MetadataConfig { + pub fn new>(original_field: T) -> Self { + let original = original_field.into(); + Self { + field: "qa_metadata".to_string(), + original_field: original, + } + } +} + +impl> From for MetadataConfig { + fn from(val: T) -> Self { + Self::new(val.as_ref()) + } +} + +#[derive(Clone, Debug)] +pub enum FieldConfig { + Vector(VectorConfig), + Metadata(MetadataConfig), + Chunk, + ID, +} + +impl FieldConfig { + pub fn field_name(&self) -> String { + match self { + FieldConfig::Vector(config) => config.field_name(), + FieldConfig::Metadata(config) => config.field.clone(), + FieldConfig::Chunk => "chunk".into(), + FieldConfig::ID => "id".into(), + } + } +} + +impl PgVector { + /// Creates an SQL statement to create a table with the specified fields. + /// + /// **Arguments:** + /// - `self`: A reference to the `vec` field, which contains the + /// configuration for each field in the table. + /// + /// **Returns:** + /// - `Result`: + /// - **Success:** The generated SQL statement as a string. + /// + /// # Errors + /// + /// This function will return an error if any part of SQL generation fails + /// or if the field configuration is incorrect. + pub fn generate_create_table_sql(&self) -> Result { + let columns: Vec = self + .fields + .iter() + .map(|field| match field { + FieldConfig::ID => "id UUID PRIMARY KEY".to_string(), + FieldConfig::Chunk => format!("{} TEXT NOT NULL", field.field_name()), + FieldConfig::Metadata(_) => format!("{} JSONB", field.field_name()), + FieldConfig::Vector(_) => { + format!("{} VECTOR({})", field.field_name(), self.vector_size) + } + }) + .collect(); + + let sql = format!( + "CREATE TABLE IF NOT EXISTS {} (\n {}\n)", + self.table_name, + columns.join(",\n ") + ); + + Ok(sql) + } + + /// Stores a list of nodes in the database using an upsert operation. + /// + /// # Arguments + /// + /// * `nodes` - A slice of `Node` objects to be stored. + /// + /// # Returns + /// + /// * `Result<()>` - Ok if all nodes are successfully stored, Err otherwise. + /// + /// # Errors + /// + /// This function will return an error if: + /// - The database connection pool is not established. + /// - Any of the SQL queries fail to execute. + /// - Committing the transaction fails. + pub async fn store_nodes(&self, nodes: &[Node]) -> Result<()> { + let pool = self + .connection_pool + .as_ref() + .ok_or_else(|| anyhow!("Database connection not established"))?; + + let mut tx = pool.begin().await?; + let sql = self.generate_upsert_sql(); + + for (i, node) in nodes.iter().enumerate() { + tracing::debug!("Storing node {}: {:?}", i, node.id()); + + let query = self.bind_node_to_query(&sql, node)?; + + query.execute(&mut *tx).await.map_err(|e| { + tracing::error!("Failed to store node {}: {:?}", i, e); + anyhow!("Failed to store node {}: {:?}", i, e) + })?; + + tracing::debug!("Successfully stored node {}", i); + } + + tx.commit() + .await + .map_err(|e| anyhow!("Failed to commit transaction: {:?}", e))?; + + Ok(()) + } + + /// Generates an SQL upsert statement based on the current fields and table name. + /// + /// This function constructs a SQL query that inserts new rows into a `PostgreSQL` database table + /// if they do not already exist (based on the "id" column), or updates them if they do. The generated + /// SQL is intended to be efficient and safe for concurrent use. + #[allow(clippy::redundant_closure_for_method_calls)] + fn generate_upsert_sql(&self) -> String { + let columns: Vec<_> = self.fields.iter().map(|f| f.field_name()).collect(); + let placeholders: Vec<_> = (1..=self.fields.len()).map(|i| format!("${i}")).collect(); + // Iterate over each field in the fields vector, keeping track of the index + let updates: Vec<_> = self + .fields + .iter() + .enumerate() + .filter(|(_, f)| f.field_name() != "id") + .map(|(i, f)| format!("{} = ${}", f.field_name(), i + 1)) + .collect(); + + // Construct the final SQL upsert statement using the collected columns, placeholders, and updates + let sql = format!( + "INSERT INTO {} ({}) VALUES ({}) ON CONFLICT (id) DO UPDATE SET {}", + self.table_name, + columns.join(", "), + placeholders.join(", "), + updates.join(", ") + ); + + tracing::debug!("Generated SQL: {}", sql); + sql + } + + #[allow(clippy::implicit_clone)] + fn bind_node_to_query<'a>( + &self, + sql: &'a str, + node: &'a Node, + ) -> Result> { + let mut query = sqlx::query(sql); + + for field in &self.fields { + query = match field { + FieldConfig::ID => query.bind(node.id()), + FieldConfig::Chunk => query.bind(&node.chunk), + FieldConfig::Metadata(config) => { + let value = node.metadata.get(&config.original_field).ok_or_else(|| { + anyhow!("Metadata field {} not found", config.original_field) + })?; + query.bind(serde_json::to_value(value)?) + } + FieldConfig::Vector(config) => { + let data = node + .vectors + .as_ref() + .and_then(|v| v.get(&config.embedded_field)) + .map(|v| v.to_vec()) + .unwrap_or_default(); + query.bind(ExtPgVector::Vector::from(data)) + } + }; + } + + Ok(query) + } +} diff --git a/swiftide-test-utils/Cargo.toml b/swiftide-test-utils/Cargo.toml index 5df13155..8a6f4913 100644 --- a/swiftide-test-utils/Cargo.toml +++ b/swiftide-test-utils/Cargo.toml @@ -13,7 +13,7 @@ homepage.workspace = true [dependencies] swiftide-core = { path = "../swiftide-core", features = ["test-utils"] } -swiftide-integrations = { path = "../swiftide-integrations", all-features = true } +swiftide-integrations = { path = "../swiftide-integrations", features = ["openai"] } async-openai = { workspace = true } qdrant-client = { workspace = true, default-features = false, features = [ diff --git a/swiftide/Cargo.toml b/swiftide/Cargo.toml index 6a38f209..cc736ea2 100644 --- a/swiftide/Cargo.toml +++ b/swiftide/Cargo.toml @@ -35,6 +35,7 @@ all = [ "aws-bedrock", "groq", "ollama", + "pgvector", ] #! ### Integrations @@ -42,6 +43,9 @@ all = [ ## Enables Qdrant for storage and retrieval qdrant = ["swiftide-integrations/qdrant", "swiftide-core/qdrant"] +## Enables PgVector for storage and retrieval +pgvector = ["swiftide-integrations/pgvector"] + ## Enables Redis as an indexing cache and storage redis = ["swiftide-integrations/redis"]