diff --git a/.cargo/audit.toml b/.cargo/audit.toml new file mode 100644 index 0000000..7c3ef78 --- /dev/null +++ b/.cargo/audit.toml @@ -0,0 +1,7 @@ +[advisories] +# can't be resolved +ignore = ["RUSTSEC-2023-0071"] + +[yanked] +enabled = false # Warn for yanked crates in Cargo.lock (default: true) +update_index = false # Auto-update the crates.io index (default: true) diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index ea8c4bf..fa19fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target +/.compose +/.direnv diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..6b158e5 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2895 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "anymap" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +dependencies = [ + "serde", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "color-eyre" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "comfy-table" +version = "7.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" +dependencies = [ + "unicode-segmentation", + "unicode-width 0.2.0", +] + +[[package]] +name = "comment-parser" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84fb8ef0cdffc916f84bf2707ea4336fb2f3fd5665b3c71f0a2d8f2341c7e0e0" +dependencies = [ + "detect-lang", + "line-span", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +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 = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio 0.8.11", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[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 = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + +[[package]] +name = "detect-lang" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0507346abae214ef8128c9417d9f8ae0aa6aad5bbdf56b9a25440befbbf9c0ac" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "figment" +version = "0.10.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +dependencies = [ + "atomic", + "serde", + "serde_yaml", + "uncased", + "version_check", +] + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +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", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fuzzy-matcher" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" +dependencies = [ + "thread_local", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "handlebars" +version = "6.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759e2d5aea3287cb1190c8ec394f42866cb5bf74fcbf213f354e3c856ea26098" +dependencies = [ + "derive_builder", + "log", + "num-order", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width 0.2.0", + "web-time", +] + +[[package]] +name = "inherent" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c38228f24186d9cc68c729accb4d413be9eaed6ad07ff79e0270d9e56f3de13" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "inquire" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" +dependencies = [ + "bitflags 2.9.0", + "crossterm", + "dyn-clone", + "fuzzy-matcher", + "fxhash", + "newline-converter", + "once_cell", + "unicode-segmentation", + "unicode-width 0.1.14", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[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]] +name = "line-span" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29fc123b2f6600099ca18248f69e3ee02b09c4188c0d98e9a690d90dec3e408a" + +[[package]] +name = "linux-raw-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "newline-converter" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b6b097ecb1cbfed438542d16e84fd7ad9b0c76c8a65b7f9039212a3d14dc7f" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[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-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" +dependencies = [ + "num-modular", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "path-clean" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[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.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "redox_syscall" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rsa" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sea-orm-codegen" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fc7ff538b0fef5061e52f8a67ddf41f866d12e64115df6fda753b334d6d88e" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "sea-query", + "syn", + "tracing", +] + +[[package]] +name = "sea-orm-generator" +version = "0.1.0" +dependencies = [ + "anymap", + "async-trait", + "clap", + "color-eyre", + "comfy-table", + "comment-parser", + "figment", + "handlebars", + "heck 0.5.0", + "include_dir", + "indicatif", + "inquire", + "path-clean", + "quote", + "sea-orm-codegen", + "sea-schema", + "serde", + "serde-inline-default", + "serde_json", + "serde_yaml", + "sqlx", + "syn", + "tokio", + "toml_edit", + "tracing", + "tracing-subscriber", + "url", +] + +[[package]] +name = "sea-query" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a24d8b9fcd2674a6c878a3d871f4f1380c6c43cc3718728ac96864d888458e" +dependencies = [ + "inherent", + "sea-query-derive", +] + +[[package]] +name = "sea-query-binder" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0019f47430f7995af63deda77e238c17323359af241233ec768aba1faea7608" +dependencies = [ + "sea-query", + "sqlx", +] + +[[package]] +name = "sea-query-derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae0cbad6ab996955664982739354128c58d16e126114fe88c2a493642502aab" +dependencies = [ + "darling", + "heck 0.4.1", + "proc-macro2", + "quote", + "syn", + "thiserror", +] + +[[package]] +name = "sea-schema" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef5dd7848c993f3789d09a2616484c72c9330cae2b048df59d8c9b8c0343e95" +dependencies = [ + "futures", + "sea-query", + "sea-query-binder", + "sea-schema-derive", + "sqlx", +] + +[[package]] +name = "sea-schema-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "debdc8729c37fdbf88472f97fd470393089f997a909e535ff67c544d18cfccf0" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-inline-default" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fb1bedd774187d304179493b0d3c41fbe97b04b14305363f68d2bdf5e47cb9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[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 = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.8.11", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +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 = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +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 = "sqlx" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" +dependencies = [ + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown", + "hashlink", + "indexmap", + "log", + "memchr", + "once_cell", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +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", + "tempfile", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +dependencies = [ + "atoi", + "base64", + "bitflags 2.9.0", + "byteorder", + "bytes", + "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", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" +dependencies = [ + "atoi", + "base64", + "bitflags 2.9.0", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempfile" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +dependencies = [ + "fastrand", + "getrandom 0.3.2", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio 1.0.3", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall", + "wasite", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 22832de..9d68394 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,11 @@ [package] -name = "generator" +name = "sea-orm-generator" version = "0.1.0" edition = "2021" [dependencies] +anymap = "0.12.1" +async-trait = "0.1.88" clap = { version = "4.5.32", features = ["derive", "env"] } color-eyre = "0.6.3" comfy-table = { version = "7.1.4", default-features = false } @@ -14,15 +16,18 @@ heck = "0.5.0" include_dir = "0.7.4" indicatif = "0.17.11" inquire = "0.7.5" +path-clean = "1.0.1" quote = "1.0.40" sea-orm-codegen = "1.1.8" sea-schema = { version = "0.16.1", features = ["sqlx-all"] } serde = { version = "1.0.219", features = ["derive"] } +serde-inline-default = "0.2.3" serde_json = "1.0.140" serde_yaml = "0.9.34" sqlx = { version = "0.8.3", features = ["mysql", "postgres", "sqlite"] } syn = { version = "2.0.100", features = ["extra-traits", "full"] } tokio = { version = "1.44.1", features = ["full"] } +toml_edit = { version = "0.22.24", features = ["serde"] } tracing = "0.1.41" -tracing-subscriber = "0.3.19" +tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } url = "2.5.4" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..239955a --- /dev/null +++ b/flake.lock @@ -0,0 +1,132 @@ +{ + "nodes": { + "advisory-db": { + "flake": false, + "locked": { + "lastModified": 1744011916, + "narHash": "sha256-vZIug2BsukcfdNIH8Kto6iUGJM4PgaE8sPIKZDy8MT0=", + "owner": "rustsec", + "repo": "advisory-db", + "rev": "b3d5d51745076cac459a298838d6bec9f4b052f3", + "type": "github" + }, + "original": { + "owner": "rustsec", + "repo": "advisory-db", + "type": "github" + } + }, + "crane": { + "locked": { + "lastModified": 1743908961, + "narHash": "sha256-e1idZdpnnHWuosI3KsBgAgrhMR05T2oqskXCmNzGPq0=", + "owner": "ipetkov", + "repo": "crane", + "rev": "80ceeec0dc94ef967c371dcdc56adb280328f591", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1743827369, + "narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "42a1c966be226125b48c384171c44c651c236c22", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "process-compose-wrapper": { + "locked": { + "lastModified": 1743615288, + "narHash": "sha256-X7beZH4dxMDkFqOJRB5daCkTMdgo90nZ62VwbFol55M=", + "ref": "dev", + "rev": "c0f01d143e56669d4ea174ddc882d8c6ca85f55c", + "revCount": 85, + "type": "git", + "url": "https://gitlab.scug.io/Nikkuss/process-compose-wrapper.git" + }, + "original": { + "ref": "dev", + "type": "git", + "url": "https://gitlab.scug.io/Nikkuss/process-compose-wrapper.git" + } + }, + "root": { + "inputs": { + "advisory-db": "advisory-db", + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "process-compose-wrapper": "process-compose-wrapper", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743993291, + "narHash": "sha256-u8GHvduU1gCtoFXvTS/wGjH1ouv5S/GRGq6MAT+sG/k=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "0cb3c8979c65dc6a5812dfe67499a8c7b8b4325b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0692ceb --- /dev/null +++ b/flake.nix @@ -0,0 +1,159 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + crane.url = "github:ipetkov/crane"; + + flake-utils.url = "github:numtide/flake-utils"; + + process-compose-wrapper = { + url = "git+https://gitlab.scug.io/Nikkuss/process-compose-wrapper.git?ref=dev"; + }; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + advisory-db = { + url = "github:rustsec/advisory-db"; + flake = false; + }; + }; + + outputs = + { + self, + nixpkgs, + crane, + flake-utils, + process-compose-wrapper, + rust-overlay, + advisory-db, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + process-compose = process-compose-wrapper.lib.mkLib pkgs; + + inherit (pkgs) lib; + craneLib = (crane.mkLib pkgs).overrideToolchain ( + p: + p.rust-bin.stable.latest.default.override { + extensions = [ "llvm-tools-preview" ]; + } + ); + + unfilteredRoot = ./.; # The original, unfiltered source + src = lib.fileset.toSource { + root = unfilteredRoot; + fileset = lib.fileset.unions [ + # Default files from crane (Rust and cargo files) + (craneLib.fileset.commonCargoSources unfilteredRoot) + ./.cargo/audit.toml + ./templates + ]; + }; + + commonArgs = { + inherit src; + strictDeps = true; + doCheck = false; + }; + cargoArtifacts = craneLib.buildDepsOnly commonArgs; + generator = craneLib.buildPackage ( + commonArgs + // { + inherit cargoArtifacts; + } + ); + in + rec { + checks = { + # inherit generator; + clippy = craneLib.cargoClippy ( + commonArgs + // { + inherit cargoArtifacts; + cargoClippyExtraArgs = "--all-targets -- --deny warnings"; + } + ); + fmt = craneLib.cargoFmt { + inherit src; + }; + audit = craneLib.cargoAudit { + inherit src advisory-db; + }; + nextest = craneLib.cargoNextest ( + commonArgs + // { + inherit cargoArtifacts; + partitions = 1; + partitionType = "count"; + cargoNextestPartitionsExtraArgs = "--no-tests=pass"; + } + ); + crateCoverage = craneLib.cargoTarpaulin ( + commonArgs + // { + inherit cargoArtifacts; + } + ); + }; + packages = { + process-compose = process-compose.mkWrapper { + name = "process-compose"; + config = (import ./process-compose.nix { inherit pkgs; }); + # enableTui = true; + # modules = [ + # (process-compose.mkPostgres { + # name = "postgres"; + # initialDatabases = [ + # { + # name = "db"; + # user = "root"; + # password = "root"; + # } + # ]; + # }) + # (process-compose.mkRedis { + # name = "redis"; + # }) + # ]; + }; + llvm-coverage = craneLib.cargoLlvmCov ( + commonArgs + // { + inherit cargoArtifacts; + } + ); + inherit generator; + }; + + devShells.default = craneLib.devShell { + checks = self.checks.${system}; + DATABASE_URL = "postgres://root:root@localhost/db"; + REDIS_HOST = "localhost:6379"; + MIGRATION_DIR = "crates/server/migration"; + RUSTFLAGS = "-Clinker=clang -Clink-arg=-fuse-ld=mold"; + packages = with pkgs; [ + sea-orm-cli + cargo-watch + llvmPackages.clang + llvmPackages.bintools + mold + cargo-nextest + cargo-llvm-cov + cargo-audit + cargo-tarpaulin + ]; + }; + + } + ); + +} diff --git a/generator.toml b/generator.toml new file mode 100644 index 0000000..304942a --- /dev/null +++ b/generator.toml @@ -0,0 +1,6 @@ +# This file is used to configure the SeaORM generator. +[modules.discovery] +enable = true + +[modules.sea_orm] +enable = true diff --git a/generator.yml b/generator.yml new file mode 100644 index 0000000..193bbd0 --- /dev/null +++ b/generator.yml @@ -0,0 +1,6 @@ +modules: + discovery: + enable: true + database_schema: "private" + max_connections: 10 + acquire_timeout: 5 diff --git a/process-compose.nix b/process-compose.nix new file mode 100644 index 0000000..24b9595 --- /dev/null +++ b/process-compose.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + processes = { + frontend = { + command = '' + RUST_LOG=debug ${pkgs.cargo-watch}/bin/cargo-watch -x 'run' + ''; + }; + }; +} diff --git a/src/config.rs.old b/src/config.rs.old deleted file mode 100644 index 85e0866..0000000 --- a/src/config.rs.old +++ /dev/null @@ -1,341 +0,0 @@ -use std::path::PathBuf; - -use color_eyre::Report; -use sea_orm_codegen::{ - DateTimeCrate as CodegenDateTimeCrate, EntityWriterContext, WithPrelude, WithSerde, -}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_yaml::{Mapping, Value}; -use tracing::instrument; - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "lowercase")] -pub enum EntityFormat { - Expanded, - Compact, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -#[serde(untagged)] -pub enum TableConfig { - Specific { specific: Vec }, - Exclude { exclude: Vec }, -} - -#[derive(Debug, Clone)] -pub enum SerdeEnable { - Both, - Serialize, - Deserialize, - None, -} - -#[derive(Debug, Clone)] -pub enum Prelude { - Enabled, - Disabled, - AllowUnusedImports, -} - -impl<'de> Deserialize<'de> for SerdeEnable { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let value = Value::deserialize(deserializer)?; - - match value { - Value::String(s) if s == "serialize" => Ok(SerdeEnable::Serialize), - Value::String(s) if s == "deserialize" => Ok(SerdeEnable::Deserialize), - Value::Bool(true) => Ok(SerdeEnable::Both), - Value::Bool(false) => Ok(SerdeEnable::None), - _ => Err(serde::de::Error::custom( - "expected 'serialize', 'deserialize', 'true' or 'false'", - )), - } - } -} -impl Serialize for SerdeEnable { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - match self { - SerdeEnable::Both => serializer.serialize_bool(true), - SerdeEnable::Serialize => serializer.serialize_str("serialize"), - SerdeEnable::Deserialize => serializer.serialize_str("deserialize"), - SerdeEnable::None => serializer.serialize_bool(false), - } - } -} -impl<'de> Deserialize<'de> for Prelude { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let value = Value::deserialize(deserializer)?; - - match value { - Value::Bool(true) => Ok(Prelude::Enabled), - Value::Bool(false) => Ok(Prelude::Disabled), - Value::String(s) if s == "allow_unused_imports" => Ok(Prelude::AllowUnusedImports), - _ => Err(serde::de::Error::custom( - "expected 'true', 'false', or 'allow_unused_imports'", - )), - } - } -} -impl Serialize for Prelude { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - match self { - Prelude::Enabled => serializer.serialize_bool(true), - Prelude::Disabled => serializer.serialize_bool(false), - Prelude::AllowUnusedImports => serializer.serialize_str("allow_unused_imports"), - } - } -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct Config { - pub db: DbConfig, - pub sea_orm: SeaOrmConfig, - pub output: OutputConfig, - pub templates: Option, - pub templates_dir: Option, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct OutputConfig { - pub path: PathBuf, - pub models: OutputModelConfig, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct OutputCommentConfig { - pub enable: bool, - pub max_width: Option, - pub table_name: bool, - pub column_info: bool, - pub column_name: bool, - pub column_db_type: bool, - pub column_rust_type: bool, - pub column_attributes: bool, - pub column_exclude_attributes: Vec, -} -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct OutputModelConfig { - pub prelude: bool, - pub path: PathBuf, - pub comment: OutputCommentConfig, - pub entities: String, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct DbConfig { - pub database_schema: Option, - pub max_connections: u32, - pub acquire_timeout: u64, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmConfig { - pub prelude: Prelude, - pub serde: SeaOrmSerdeConfig, - pub entity: SeaOrmEntityConfig, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmSerdeConfig { - pub enable: SerdeEnable, - pub skip_deserializing_primary_key: bool, - pub skip_hidden_column: bool, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmEntityConfig { - pub format: EntityFormat, - pub tables: SeaOrmTableConfig, - pub extra_derives: SeaOrmExtraDerivesConfig, - pub extra_attributes: SeaOrmExtraAttributesConfig, - pub date_time_crate: DateTimeCrate, - pub with_copy_enums: bool, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmTableConfig { - pub include_hidden: bool, - pub skip_seaql_migrations: bool, - #[serde(flatten)] - pub table_config: Option, -} -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmExtraDerivesConfig { - pub model: Vec, - #[serde(rename = "enum")] - pub eenum: Vec, -} -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct SeaOrmExtraAttributesConfig { - pub model: Vec, - #[serde(rename = "enum")] - pub eenum: Vec, -} -#[derive(Deserialize, Serialize, Debug, Clone)] -#[serde(rename_all = "lowercase")] -pub enum DateTimeCrate { - Time, - Chrono, -} -#[derive(Deserialize, Serialize, Debug, Clone)] -pub struct TemplateConfig { - pub model: Option, -} - -impl From for CodegenDateTimeCrate { - fn from(date_time_crate: DateTimeCrate) -> CodegenDateTimeCrate { - match date_time_crate { - DateTimeCrate::Chrono => CodegenDateTimeCrate::Chrono, - DateTimeCrate::Time => CodegenDateTimeCrate::Time, - } - } -} - -impl SeaOrmTableConfig { - pub fn get_filter(&self) -> Box bool> { - let include_hidden = self.include_hidden; - if let Some(table) = &self.table_config { - match table { - TableConfig::Specific { specific } => { - let specific = specific.clone(); - Box::new(move |table: &String| { - (include_hidden || !table.starts_with('_')) && specific.contains(table) - }) - } - TableConfig::Exclude { exclude } => { - let exclude = exclude.clone(); - Box::new(move |table: &String| { - (include_hidden || !table.starts_with('_')) && !exclude.contains(table) - }) - } - } - } else if self.skip_seaql_migrations { - Box::new(move |table: &String| { - (include_hidden || !table.starts_with('_')) - && !table.starts_with("seaql_migrations") - }) - } else { - Box::new(move |table: &String| (include_hidden || !table.starts_with('_'))) - } - } -} - -impl Default for Config { - fn default() -> Self { - Self { - db: DbConfig { - database_schema: None, - max_connections: 10, - acquire_timeout: 5, - }, - sea_orm: SeaOrmConfig { - prelude: Prelude::Enabled, - serde: SeaOrmSerdeConfig { - enable: SerdeEnable::None, - skip_deserializing_primary_key: false, - skip_hidden_column: false, - }, - entity: SeaOrmEntityConfig { - format: EntityFormat::Compact, - tables: SeaOrmTableConfig { - include_hidden: false, - skip_seaql_migrations: true, - table_config: None, - }, - extra_derives: SeaOrmExtraDerivesConfig { - model: Vec::new(), - eenum: Vec::new(), - }, - extra_attributes: SeaOrmExtraAttributesConfig { - model: Vec::new(), - eenum: Vec::new(), - }, - date_time_crate: DateTimeCrate::Chrono, - with_copy_enums: false, - }, - }, - output: OutputConfig { - path: PathBuf::from("./src/"), - models: OutputModelConfig { - comment: OutputCommentConfig { - max_width: None, - table_name: true, - column_name: true, - column_db_type: true, - column_rust_type: true, - column_attributes: true, - column_exclude_attributes: Vec::new(), - enable: true, - column_info: true, - }, - entities: String::from("_entities"), - prelude: true, - path: PathBuf::from("./models"), - }, - }, - templates: None, - templates_dir: None, - } - } -} - -impl EntityFormat { - pub fn is_expanded(&self) -> bool { - matches!(self, EntityFormat::Expanded) - } -} -impl From for WithPrelude { - fn from(val: Prelude) -> Self { - match val { - Prelude::Enabled => WithPrelude::All, - - Prelude::Disabled => WithPrelude::None, - Prelude::AllowUnusedImports => WithPrelude::AllAllowUnusedImports, - } - } -} -impl From for WithSerde { - fn from(val: SerdeEnable) -> Self { - match val { - SerdeEnable::Both => WithSerde::Both, - SerdeEnable::Serialize => WithSerde::Serialize, - SerdeEnable::Deserialize => WithSerde::Deserialize, - SerdeEnable::None => WithSerde::None, - } - } -} - -impl From for EntityWriterContext { - fn from(val: Config) -> Self { - EntityWriterContext::new( - val.sea_orm.entity.format.is_expanded(), - val.sea_orm.prelude.into(), - val.sea_orm.serde.enable.into(), - val.sea_orm.entity.with_copy_enums, - val.sea_orm.entity.date_time_crate.into(), - val.db.database_schema, - false, - val.sea_orm.serde.skip_deserializing_primary_key, - val.sea_orm.serde.skip_hidden_column, - val.sea_orm.entity.extra_derives.model, - val.sea_orm.entity.extra_attributes.model, - val.sea_orm.entity.extra_derives.eenum, - val.sea_orm.entity.extra_attributes.eenum, - false, - false, - ) - } -} diff --git a/src/generator/file.rs b/src/generator/file.rs index 9761b6d..8a9ee52 100644 --- a/src/generator/file.rs +++ b/src/generator/file.rs @@ -1,4 +1,5 @@ use color_eyre::Result; +use path_clean::PathClean; use std::{collections::HashMap, path::PathBuf}; #[derive(Debug, Clone)] @@ -37,25 +38,15 @@ pub fn combine_chunks(chunks: Vec) -> Result String { - let mut components = path.components(); +pub fn pathbuf_to_rust_path(path: PathBuf) -> String { + let clean_path = path.clean(); + let components = clean_path.components(); let mut path = String::new(); for component in components { match component { - std::path::Component::Prefix(_) => { - // Handle Windows-specific prefixes if necessary - } - std::path::Component::RootDir => { - // Ignore root directory component - } - std::path::Component::CurDir => { - // Ignore current directory component - } std::path::Component::ParentDir => { if path.is_empty() || path.ends_with("::") { path.push_str("super::"); - } else { - path.push_str("::super::"); } } std::path::Component::Normal(name) => { @@ -64,19 +55,68 @@ pub fn pathbuf_to_rust_path(path: &PathBuf) -> String { } path.push_str(name.to_str().unwrap()); } + + // ignored + _ => (), } } path } - +#[cfg(test)] mod test { - use super::*; + use crate::generator::file::combine_chunks; + use crate::generator::file::{pathbuf_to_rust_path, GeneratedFileChunk}; use std::path::PathBuf; - #[test] fn test_pathbuf_to_rust_path() { - let path = PathBuf::from("src/models/user.rs"); - let rust_path = pathbuf_to_rust_path(&path); - assert_eq!(rust_path, "src::models::user.rs"); + let path = PathBuf::from("src/models/../user.rs"); + let rust_path = pathbuf_to_rust_path(path); + assert_eq!(rust_path, "src::user.rs"); + } + + #[test] + fn test_pathbuf_to_rust_path_backwards() { + let path = PathBuf::from("../../../test"); + let rust_path = pathbuf_to_rust_path(path); + assert_eq!(rust_path, "super::super::super::test"); + } + + #[test] + fn test_pathbuf_to_rust_path_blank() { + let path = PathBuf::from("/"); + let rust_path = pathbuf_to_rust_path(path); + assert_eq!(rust_path, ""); + } + #[test] + fn test_combine_chunks() { + let chunks = vec![ + GeneratedFileChunk { + path: PathBuf::from("test.rs"), + content: "test".to_string(), + priority: 1, + }, + GeneratedFileChunk { + path: PathBuf::from("test.rs"), + content: "test".to_string(), + priority: 1, + }, + GeneratedFileChunk { + path: PathBuf::from("test.rs"), + content: "testpre".to_string(), + priority: -1, + }, + GeneratedFileChunk { + path: PathBuf::from("test2.rs"), + content: "test".to_string(), + priority: 1, + }, + ]; + let mut files = combine_chunks(chunks).unwrap(); + assert_eq!(files.len(), 2); + files.sort_by(|a, b| a.path.cmp(&b.path)); + assert_eq!(files[0].path, PathBuf::from("test.rs")); + assert_eq!(files[0].content, "testpretesttest"); + assert_eq!(files[1].path, PathBuf::from("test2.rs")); + assert_eq!(files[1].content, "test"); } } diff --git a/src/generator/mod.rs b/src/generator/mod.rs index 4597c75..e6d2c05 100644 --- a/src/generator/mod.rs +++ b/src/generator/mod.rs @@ -1,28 +1,35 @@ use file::GeneratedFileChunk; -use modules::models::table::Table; pub mod discover; pub mod file; pub mod modules; -use crate::config::Config; use color_eyre::Result; use handlebars::Handlebars; +use toml_edit::DocumentMut; +#[derive(Clone, Debug)] +pub struct DatabaseUrl(String); -pub async fn generate<'a>( +pub async fn generate( database_url: &str, - config: &Config, - handlebars: &'a Handlebars<'a>, + root_config: DocumentMut, ) -> Result> { let mut files = Vec::new(); - let db_filter = config.sea_orm.entity.tables.get_filter(); - let (table_stmts, db_type) = - discover::get_tables(database_url.to_owned(), db_filter, &config.db).await?; - let tables = table_stmts - .into_iter() - .map(Table::new) - .collect::>>()?; + let mut module_manager = modules::ModuleManager::new(root_config); + module_manager.init()?; + let ctx = module_manager.get_context_mut(); + ctx.get_anymap_mut() + .insert(DatabaseUrl(database_url.to_owned())); + module_manager.validate().await?; - let model_outputs = modules::models::generate_models(database_url, config, handlebars).await?; - files.extend(model_outputs); + // let db_filter = config.sea_orm.entity.tables.get_filter(); + // let (table_stmts, db_type) = + // discover::get_tables(database_url.to_owned(), db_filter, &config.db).await?; + // let tables = table_stmts + // .into_iter() + // .map(Table::new) + // .collect::>>()?; + // + // let model_outputs = modules::models::generate_models(database_url, config, handlebars).await?; + // files.extend(model_outputs); Ok(files) } diff --git a/src/generator/modules/discovery/mod.rs b/src/generator/modules/discovery/mod.rs new file mode 100644 index 0000000..aaf5028 --- /dev/null +++ b/src/generator/modules/discovery/mod.rs @@ -0,0 +1,39 @@ +use crate::generator::DatabaseUrl; + +use super::{Module, ModulesContext}; +use color_eyre::Result; +use serde::Deserialize; +use serde_inline_default::serde_inline_default; + +#[serde_inline_default] +#[derive(Debug, Clone, Deserialize)] +pub struct DiscoveryConfig { + #[serde_inline_default(false)] + pub enable: bool, + #[serde_inline_default(None)] + pub database_schema: Option, + #[serde_inline_default(10)] + pub max_connections: u32, + #[serde_inline_default(30)] + pub acquire_timeout: u32, +} +#[derive(Debug)] +pub struct DiscoveryModule; + +#[async_trait::async_trait] +impl Module for DiscoveryModule { + fn init(&self, ctx: &mut ModulesContext) -> Result<()> { + ctx.get_config_auto::("modules.discovery")?; + Ok(()) + } + async fn validate(&self, ctx: &mut ModulesContext) -> Result { + let map = ctx.get_anymap(); + + if let (Some(config), Some(_)) = (map.get::(), map.get::()) { + Ok(config.enable) + } else { + // One or both keys are missing + Ok(false) + } + } +} diff --git a/src/generator/modules/mod.rs b/src/generator/modules/mod.rs index b1bf1b1..7b84b6a 100644 --- a/src/generator/modules/mod.rs +++ b/src/generator/modules/mod.rs @@ -1,10 +1,137 @@ -use models::table::Table; +use std::{ + fmt::Debug, + sync::{Arc, MutexGuard}, +}; -use super::discover::DbType; +use anymap::{ + any::{Any, CloneAny}, + Map, +}; +use color_eyre::{eyre::eyre, Result}; +use discovery::DiscoveryModule; +use sea_orm::{SeaOrmConfig, SeaOrmModule}; +// use models::ModelsModule; +use serde::{de::IntoDeserializer, Deserialize}; +use std::sync::Mutex; +use templates::TemplateModule; +use toml_edit::{de::ValueDeserializer, DocumentMut, Item, Value}; +// use models::table::Table; +// +// use super::discover::DbType; +type AnyCloneMap = Map; +pub mod discovery; pub mod models; +pub mod sea_orm; +pub mod templates; pub struct ModulesContext { - pub tables: Vec, - pub db_type: DbType, + pub anymap: AnyCloneMap, + pub root_config: DocumentMut, +} +impl ModulesContext { + pub fn new(root_config: DocumentMut) -> Self { + Self { + anymap: AnyCloneMap::new(), + root_config, + } + } + pub fn get_config_raw(&self, path: &str) -> Result<&Item> { + let mut item: Option<&Item> = None; + let path = path.split('.').collect::>(); + for i in path { + if let Some(item) = &mut item { + if let Some(v) = item.get(i) { + *item = v; + } else { + return Err(eyre!("Config not found")); + } + } else if let Some(v) = self.root_config.get(i) { + item = Some(v); + } else { + return Err(eyre!("Config not found")); + } + } + if let Some(v) = item { + Ok(v) + } else { + Err(eyre!("Config not found")) + } + } + pub fn get_config<'a, V: Deserialize<'a>>(&self, path: &str) -> Result { + let item = self.get_config_raw(path)?; + let value = item + .clone() + .into_value() + .map_err(|_| eyre!("Config not found"))?; + let deserializer = value.into_deserializer(); + let config = V::deserialize(deserializer)?; + Ok(config) + } + pub fn get_config_auto<'a, V: Deserialize<'a> + Clone + Send + 'static>( + &mut self, + path: &str, + ) -> Result<()> { + let value: V = self.get_config::(path)?; + self.get_anymap_mut().insert(value); + Ok(()) + } + // pub fn get_anymap(&self) -> MutexGuard { + // let v = self.anymap.lock().unwrap(); + // v + // } + pub fn get_anymap(&self) -> &AnyCloneMap { + &self.anymap + } + pub fn get_anymap_mut(&mut self) -> &mut AnyCloneMap { + &mut self.anymap + } +} +#[async_trait::async_trait] +pub trait Module: Debug { + fn init(&self, ctx: &mut ModulesContext) -> Result<()>; + async fn validate(&self, ctx: &mut ModulesContext) -> Result; +} + +pub struct ModuleManager { + ctx: ModulesContext, + modules: Vec>, +} + +impl ModuleManager { + pub fn new(root_config: DocumentMut) -> Self { + let modules: Vec> = vec![ + Box::new(TemplateModule), + Box::new(DiscoveryModule), + Box::new(SeaOrmModule), //Box::new(ModelsModule) + ]; + Self { + modules, + ctx: ModulesContext::new(root_config), + } + } + pub fn get_context_mut(&mut self) -> &mut ModulesContext { + &mut self.ctx + } + + pub fn init(&mut self) -> Result<()> { + for module in &self.modules { + module.init(&mut self.ctx)?; + } + Ok(()) + } + pub async fn validate(&mut self) -> Result<()> { + let mut index_wr = 0usize; + for index in 0..self.modules.len() { + let module = &self.modules[index]; + let enabled = module.validate(&mut self.ctx).await?; + tracing::info!(?module, ?enabled); + if !enabled { + self.modules.swap(index_wr, index); + index_wr += 1; + } + } + self.modules.truncate(index_wr); + Ok(()) + } } diff --git a/src/generator/modules/models/column.rs b/src/generator/modules/models/column.rs index c1c5a79..257f713 100644 --- a/src/generator/modules/models/column.rs +++ b/src/generator/modules/models/column.rs @@ -3,9 +3,8 @@ use comfy_table::Cell; use heck::ToUpperCamelCase; use sea_schema::sea_query::{ColumnDef, ColumnSpec, ColumnType, IndexCreateStatement}; -use crate::config::sea_orm_config::DateTimeCrate; - use super::{discover::DbType, ModelConfig}; +use crate::config::sea_orm_config::DateTimeCrate; #[derive(Clone, Debug)] pub struct Column { pub name: String, @@ -74,6 +73,7 @@ impl Column { ColumnSpec::Generated { .. } => unimplemented!(), ColumnSpec::Extra(_) => unimplemented!(), ColumnSpec::Comment(_) => unimplemented!(), + ColumnSpec::Using(_) => unimplemented!(), } } pub fn get_db_type(&self, db_type: &DbType) -> String { diff --git a/src/generator/modules/models/mod.rs b/src/generator/modules/models/mod.rs index ee00596..06baf33 100644 --- a/src/generator/modules/models/mod.rs +++ b/src/generator/modules/models/mod.rs @@ -1,163 +1,189 @@ -use crate::{ - config::{sea_orm_config::DateTimeCrate, Config}, - generator::{ - discover::{self, DbType}, - file::GeneratedFileChunk, - }, -}; +use super::{Module, ModulesContext}; use color_eyre::Result; -use file::FileGenerator; -use handlebars::Handlebars; -use sea_orm_codegen::{EntityTransformer, EntityWriterContext, OutputFile}; -use sea_schema::sea_query::TableCreateStatement; -use serde::{Deserialize, Serialize}; -use std::path::PathBuf; -use table::Table; - -pub mod column; -pub mod comment; -pub mod file; -pub mod table; -#[derive(Debug, Clone)] -pub struct ModelConfig { - pub models_path: PathBuf, - pub prelude: bool, - pub entities_path: PathBuf, - pub relative_entities_path: String, +use serde::Deserialize; +#[derive(Debug, Clone, Deserialize)] +pub struct ModelsConfig { pub enable: bool, - pub comment: CommentConfig, - pub db_type: DbType, -} -#[derive(Debug, Clone)] -pub struct CommentConfig { - pub max_width: Option, - pub enable: bool, - pub table_name: bool, - pub column_info: bool, - pub column_name: bool, - pub column_rust_type: bool, - pub column_db_type: bool, - pub column_attributes: bool, - pub ignore_errors: bool, - pub date_time_crate: DateTimeCrate, -} -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CommentConfigSerde { - #[serde(skip_serializing_if = "Option::is_none")] - pub max_width: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub enable: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub table_name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub info: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub rust_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub db_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub attributes: Option, -} -impl CommentConfigSerde { - pub fn merge(&self, config: &CommentConfig) -> CommentConfig { - CommentConfig { - max_width: self.max_width.or(config.max_width), - table_name: self.table_name.unwrap_or(config.table_name), - column_name: self.name.unwrap_or(config.column_name), - column_info: self.info.unwrap_or(config.column_info), - column_rust_type: self.rust_type.unwrap_or(config.column_rust_type), - column_db_type: self.db_type.unwrap_or(config.column_db_type), - column_attributes: self.attributes.unwrap_or(config.column_attributes), - ignore_errors: config.ignore_errors, - enable: self.enable.unwrap_or(config.enable), - date_time_crate: config.date_time_crate.clone(), - } - } + pub database_schema: String, + pub max_connections: u32, + pub acquire_timeout: u32, } -impl ModelConfig { - pub fn new(config: Config, db_type: DbType) -> Self { - let models_path = config.output.path.join(&config.output.models.path); - let entities_path = models_path.join(&config.output.models.entities); - ModelConfig { - db_type, - prelude: config.output.models.prelude, - entities_path, - models_path, - relative_entities_path: config.output.models.entities.clone(), - enable: config.output.models.enable, - comment: CommentConfig { - max_width: config.output.models.comment.max_width, - enable: config.output.models.comment.enable, - table_name: config.output.models.comment.table_name, - column_name: config.output.models.comment.column_name, - column_info: config.output.models.comment.column_info, - column_rust_type: config.output.models.comment.column_rust_type, - column_db_type: config.output.models.comment.column_db_type, - column_attributes: config.output.models.comment.column_attributes, - ignore_errors: config.output.models.comment.ignore_errors, - date_time_crate: config.sea_orm.entity.date_time_crate, - }, - } - } -} - -pub async fn generate_models<'a>( - database_url: &str, - config: &Config, - handlebars: &'a Handlebars<'a>, -) -> Result> { - let mut files = Vec::new(); - let db_filter = config.sea_orm.entity.tables.get_filter(); - let (table_stmts, db_type) = - discover::get_tables(database_url.to_owned(), db_filter, &config.db).await?; - let model_config = ModelConfig::new(config.clone(), db_type); - - let writer_context = config.clone().into(); - files.extend( - generate_entities(table_stmts.clone(), model_config.clone(), writer_context).await?, - ); - - files.push(GeneratedFileChunk { - path: model_config.models_path.join("mod.rs"), - content: format!("pub mod {};", model_config.relative_entities_path), - priority: 0, - }); - let tables = table_stmts - .into_iter() - .map(Table::new) - .collect::>>()?; - - if model_config.enable { - for table in tables { - files.extend(FileGenerator::generate_file(table, &model_config, handlebars).await?); - } - if model_config.prelude { - files.push(GeneratedFileChunk { - path: model_config.models_path.join("mod.rs"), - content: String::from("pub mod prelude;"), - priority: 0, - }) - } - } - Ok(files) -} - -pub async fn generate_entities( - table_statements: Vec, - config: ModelConfig, - writer_context: EntityWriterContext, -) -> Result> { - let output = EntityTransformer::transform(table_statements)?.generate(&writer_context); - Ok(output - .files - .into_iter() - .map(|OutputFile { name, content }| GeneratedFileChunk { - path: config.entities_path.join(name), - content, - priority: 0, - }) - .collect::>()) -} +// #[derive(Debug)] +// pub struct ModelsModule; +// +// #[async_trait::async_trait] +// impl Module for ModelsModule { +// fn init(&self, ctx: &mut ModulesContext) -> Result<()> { +// Ok(()) +// } +// +// async fn validate(&self, ctx: &mut ModulesContext) -> Result { +// Ok(false) +// } +// } +// +// +// use crate::{ +// config::{sea_orm_config::DateTimeCrate, Config}, +// generator::{ +// discover::{self, DbType}, +// file::GeneratedFileChunk, +// }, +// }; +// use color_eyre::Result; +// use file::FileGenerator; +// use handlebars::Handlebars; +// use sea_orm_codegen::{EntityTransformer, EntityWriterContext, OutputFile}; +// use sea_schema::sea_query::TableCreateStatement; +// use serde::{Deserialize, Serialize}; +// use std::path::PathBuf; +// use table::Table; +// +// pub mod column; +// pub mod comment; +// pub mod file; +// pub mod table; +// #[derive(Debug, Clone)] +// pub struct ModelConfig { +// pub models_path: PathBuf, +// pub prelude: bool, +// pub entities_path: PathBuf, +// pub relative_entities_path: String, +// pub enable: bool, +// pub comment: CommentConfig, +// pub db_type: DbType, +// } +// #[derive(Debug, Clone)] +// pub struct CommentConfig { +// pub max_width: Option, +// pub enable: bool, +// pub table_name: bool, +// pub column_info: bool, +// pub column_name: bool, +// pub column_rust_type: bool, +// pub column_db_type: bool, +// pub column_attributes: bool, +// pub ignore_errors: bool, +// pub date_time_crate: DateTimeCrate, +// } +// #[derive(Debug, Clone, Serialize, Deserialize)] +// pub struct CommentConfigSerde { +// #[serde(skip_serializing_if = "Option::is_none")] +// pub max_width: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub enable: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub table_name: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub name: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub info: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub rust_type: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub db_type: Option, +// #[serde(skip_serializing_if = "Option::is_none")] +// pub attributes: Option, +// } +// impl CommentConfigSerde { +// pub fn merge(&self, config: &CommentConfig) -> CommentConfig { +// CommentConfig { +// max_width: self.max_width.or(config.max_width), +// table_name: self.table_name.unwrap_or(config.table_name), +// column_name: self.name.unwrap_or(config.column_name), +// column_info: self.info.unwrap_or(config.column_info), +// column_rust_type: self.rust_type.unwrap_or(config.column_rust_type), +// column_db_type: self.db_type.unwrap_or(config.column_db_type), +// column_attributes: self.attributes.unwrap_or(config.column_attributes), +// ignore_errors: config.ignore_errors, +// enable: self.enable.unwrap_or(config.enable), +// date_time_crate: config.date_time_crate.clone(), +// } +// } +// } +// +// impl ModelConfig { +// pub fn new(config: Config, db_type: DbType) -> Self { +// let models_path = config.output.path.join(&config.output.models.path); +// let entities_path = models_path.join(&config.output.models.entities); +// ModelConfig { +// db_type, +// prelude: config.output.models.prelude, +// entities_path, +// models_path, +// relative_entities_path: config.output.models.entities.clone(), +// enable: config.output.models.enable, +// comment: CommentConfig { +// max_width: config.output.models.comment.max_width, +// enable: config.output.models.comment.enable, +// table_name: config.output.models.comment.table_name, +// column_name: config.output.models.comment.column_name, +// column_info: config.output.models.comment.column_info, +// column_rust_type: config.output.models.comment.column_rust_type, +// column_db_type: config.output.models.comment.column_db_type, +// column_attributes: config.output.models.comment.column_attributes, +// ignore_errors: config.output.models.comment.ignore_errors, +// date_time_crate: config.sea_orm.entity.date_time_crate, +// }, +// } +// } +// } +// +// pub async fn generate_models<'a>( +// database_url: &str, +// config: &Config, +// handlebars: &'a Handlebars<'a>, +// ) -> Result> { +// let mut files = Vec::new(); +// let db_filter = config.sea_orm.entity.tables.get_filter(); +// let (table_stmts, db_type) = +// discover::get_tables(database_url.to_owned(), db_filter, &config.db).await?; +// let model_config = ModelConfig::new(config.clone(), db_type); +// +// let writer_context = config.clone().into(); +// files.extend( +// generate_entities(table_stmts.clone(), model_config.clone(), writer_context).await?, +// ); +// +// files.push(GeneratedFileChunk { +// path: model_config.models_path.join("mod.rs"), +// content: format!("pub mod {};", model_config.relative_entities_path), +// priority: 0, +// }); +// let tables = table_stmts +// .into_iter() +// .map(Table::new) +// .collect::>>()?; +// +// if model_config.enable { +// for table in tables { +// files.extend(FileGenerator::generate_file(table, &model_config, handlebars).await?); +// } +// if model_config.prelude { +// files.push(GeneratedFileChunk { +// path: model_config.models_path.join("mod.rs"), +// content: String::from("pub mod prelude;"), +// priority: 0, +// }) +// } +// } +// Ok(files) +// } +// +// pub async fn generate_entities( +// table_statements: Vec, +// config: ModelConfig, +// writer_context: EntityWriterContext, +// ) -> Result> { +// let output = EntityTransformer::transform(table_statements)?.generate(&writer_context); +// Ok(output +// .files +// .into_iter() +// .map(|OutputFile { name, content }| GeneratedFileChunk { +// path: config.entities_path.join(name), +// content, +// priority: 0, +// }) +// .collect::>()) +// } diff --git a/src/generator/modules/sea_orm/mod.rs b/src/generator/modules/sea_orm/mod.rs new file mode 100644 index 0000000..c2d493d --- /dev/null +++ b/src/generator/modules/sea_orm/mod.rs @@ -0,0 +1,46 @@ +use crate::generator::DatabaseUrl; + +use super::{discovery::DiscoveryConfig, Module, ModulesContext}; +use color_eyre::{eyre::eyre, Result}; +use serde::Deserialize; +use serde_inline_default::serde_inline_default; + +#[serde_inline_default] +#[derive(Debug, Clone, Deserialize)] +pub struct SeaOrmConfig { + #[serde_inline_default(false)] + pub enable: bool, + #[serde_inline_default(None)] + pub database_schema: Option, + #[serde_inline_default(10)] + pub max_connections: u32, + #[serde_inline_default(30)] + pub acquire_timeout: u32, +} +#[derive(Debug)] +pub struct SeaOrmModule; + +#[async_trait::async_trait] +impl Module for SeaOrmModule { + fn init(&self, ctx: &mut ModulesContext) -> Result<()> { + ctx.get_config_auto::("modules.sea_orm")?; + Ok(()) + } + async fn validate(&self, ctx: &mut ModulesContext) -> Result { + let map = ctx.get_anymap(); + + if let (Some(config_discovery_config), Some(_), Some(config_sea_orm)) = ( + map.get::(), + map.get::(), + map.get::(), + ) { + if config_sea_orm.enable && !config_discovery_config.enable { + return Err(eyre!("\"modules.discovery.enable\" must be enabled to use \"modules.sea_orm.enable\"")); + } + Ok(config_sea_orm.enable && config_discovery_config.enable) + } else { + // One or both keys are missing + Ok(false) + } + } +} diff --git a/src/generator/modules/templates/mod.rs b/src/generator/modules/templates/mod.rs new file mode 100644 index 0000000..c4d135c --- /dev/null +++ b/src/generator/modules/templates/mod.rs @@ -0,0 +1,37 @@ +use crate::generator::DatabaseUrl; + +use super::{Module, ModulesContext}; +use color_eyre::Result; +use handlebars::Handlebars; +use serde::Deserialize; +use serde_inline_default::serde_inline_default; + +#[serde_inline_default] +#[derive(Debug, Clone, Deserialize)] +pub struct TemplateConfig { + #[serde_inline_default(false)] + pub enable: bool, +} +#[derive(Debug)] +pub struct TemplateModule; + +#[async_trait::async_trait] +impl Module for TemplateModule { + fn init(&self, ctx: &mut ModulesContext) -> Result<()> { + let registry: Handlebars<'static> = Handlebars::new(); + ctx.get_anymap_mut().insert(registry); + // ctx.get_config_auto::("modules.discovery")?; + Ok(()) + } + async fn validate(&self, ctx: &mut ModulesContext) -> Result { + // let map = ctx.get_anymap(); + // + // if let (Some(config), Some(_)) = (map.get::(), map.get::()) { + // Ok(config.enable) + // } else { + // // One or both keys are missing + // Ok(false) + // } + Ok(false) + } +} diff --git a/src/main.rs b/src/main.rs index 700802d..ba96ad6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,12 @@ use figment::{ }; use handlebars::Handlebars; use tokio::{fs, io::AsyncWriteExt, process::Command}; +use toml_edit::DocumentMut; +use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; #[derive(Parser, Debug)] struct Args { - #[clap(short, long, default_value = "generator.yml")] + #[clap(short, long, default_value = "generator.toml")] config: String, #[clap(short, long, env = "DATABASE_URL")] database_url: String, @@ -23,44 +25,50 @@ struct Args { #[tokio::main] async fn main() -> Result<()> { color_eyre::install()?; - tracing_subscriber::fmt().init(); + + tracing_subscriber::registry() + .with(fmt::layer()) + .with(EnvFilter::from_default_env()) + .init(); let args = Args::parse(); - let config: Config = Figment::new() - .merge(Serialized::defaults(Config::default())) - .merge(Yaml::file(&args.config)) - .extract()?; - tracing::info!(?config); + // let config: Config = Figment::new() + // .merge(Serialized::defaults(Config::default())) + // .merge(Yaml::file(&args.config)) + // .extract()?; + // tracing::info!(?config); tracing::info!(?args); - let mut handlebars = Handlebars::new(); - templates::register_templates(&mut handlebars, &config).await?; + // let mut handlebars: Registry = ; + // templates::register_templates(&mut handlebars, &config).await?; + let config = fs::read_to_string(args.config).await?; + let root_config = config.parse::()?; - let outputs = generator::generate(&args.database_url, &config, &handlebars).await?; - - // tracing::info!(?outputs, "Generated files"); - for output in outputs.iter() { - tracing::info!(?output, "Generated chunk"); - // let mut file = fs::File::create(&output.path).await?; - // file.write_all(output.content.as_bytes()).await?; - } - - let merged_outputs = generator::file::combine_chunks(outputs)?; - for output in merged_outputs.iter() { - tracing::info!(?output.path, "Merged file"); - let parent = output.path.parent().unwrap(); - if !parent.exists() { - fs::create_dir_all(parent).await?; - } - let mut file = fs::File::create(&output.path).await?; - file.write_all(output.content.as_bytes()).await?; - } - for output in merged_outputs.iter() { - tracing::info!(?output.path, "Running rustfmt"); - let exit_status = Command::new("rustfmt").arg(&output.path).status().await?; - if !exit_status.success() { - return Err(eyre!("Failed to run rustfmt")); - } - } + let outputs = generator::generate(&args.database_url, root_config).await?; + // + // // tracing::info!(?outputs, "Generated files"); + // for output in outputs.iter() { + // tracing::info!(?output, "Generated chunk"); + // // let mut file = fs::File::create(&output.path).await?; + // // file.write_all(output.content.as_bytes()).await?; + // } + // + // let merged_outputs = generator::file::combine_chunks(outputs)?; + // for output in merged_outputs.iter() { + // tracing::info!(?output.path, "Merged file"); + // let parent = output.path.parent().unwrap(); + // if !parent.exists() { + // fs::create_dir_all(parent).await?; + // } + // let mut file = fs::File::create(&output.path).await?; + // file.write_all(output.content.as_bytes()).await?; + // } + // for output in merged_outputs.iter() { + // tracing::info!(?output.path, "Running rustfmt"); + // let exit_status = Command::new("rustfmt").arg(&output.path).status().await?; + // if !exit_status.success() { + // return Err(eyre!("Failed to run rustfmt")); + // } + // } Ok(()) }