From 5bb53571836b65b54ef2f15542c0740e65932acc Mon Sep 17 00:00:00 2001 From: Sergey Levitin Date: Sat, 24 Oct 2020 20:05:48 +0300 Subject: [PATCH] Gardening + update docs --- .gitignore | 2 +- README.md | 4 +++- examples/sqlite_remember_bot/sqlite.db | Bin 4096 -> 0 bytes examples/sqlite_remember_bot/sqlite.db-shm | Bin 32768 -> 0 bytes examples/sqlite_remember_bot/sqlite.db-wal | Bin 350232 -> 0 bytes examples/sqlite_remember_bot/src/main.rs | 2 +- 6 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 examples/sqlite_remember_bot/sqlite.db delete mode 100644 examples/sqlite_remember_bot/sqlite.db-shm delete mode 100644 examples/sqlite_remember_bot/sqlite.db-wal diff --git a/.gitignore b/.gitignore index 8b037b5b..b1c241c5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ Cargo.lock .idea/ .vscode/ examples/*/target -test_db*.sqlite +*.sqlite diff --git a/README.md b/README.md index 75f9ffcf..dca16841 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,11 @@ [functional reactive design]: https://en.wikipedia.org/wiki/Functional_reactive_programming [other adaptors]: https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html - - **Dialogues management subsystem.** We have designed our dialogues management subsystem to be easy-to-use, and, furthermore, to be agnostic of how/where dialogues are stored. For example, you can just replace a one line to achieve [persistence]. Out-of-the-box storages include [Redis]. + - **Dialogues management subsystem.** We have designed our dialogues management subsystem to be easy-to-use, and, furthermore, to be agnostic of how/where dialogues are stored. For example, you can just replace a one line to achieve [persistence]. Out-of-the-box storages include [Redis] and [Sqlite]. [persistence]: https://en.wikipedia.org/wiki/Persistence_(computer_science) [Redis]: https://redis.io/ +[Sqlite]: https://www.sqlite.org - **Strongly typed bot commands.** You can describe bot commands as enumerations, and then they'll be automatically constructed from strings — just like JSON structures in [serde-json] and command-line arguments in [structopt]. @@ -371,6 +372,7 @@ The second one produces very strange compiler messages due to the `#[tokio::main ## Cargo features - `redis-storage` -- enables the [Redis] support. + - `sqlite-storage` -- enables the [Sqlite] support. - `cbor-serializer` -- enables the [CBOR] serializer for dialogues. - `bincode-serializer` -- enables the [Bincode] serializer for dialogues. - `frunk` -- enables [`teloxide::utils::UpState`], which allows mapping from a structure of `field1, ..., fieldN` to a structure of `field1, ..., fieldN, fieldN+1`. diff --git a/examples/sqlite_remember_bot/sqlite.db b/examples/sqlite_remember_bot/sqlite.db deleted file mode 100644 index 41ade9e5d196d38ea43f480680e2ead84f89a719..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYDv}$qUjhK(-m98b?E5 nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!nC=3Ar-H8V& diff --git a/examples/sqlite_remember_bot/sqlite.db-shm b/examples/sqlite_remember_bot/sqlite.db-shm deleted file mode 100644 index 7f9864c7eac7ba4b85364c7dacd7572566b8f50a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)H%>!A6h`3#22947WWeN%F*#>2ImZIlzv{jb=380&e0hO_+k9@*s8@^hi+GuP;xJO%JJ(ldGF#Jes*}eZG6YPqZX{cs{u5 zE8)E#-;&+tFuMreCO@d~ZF_DUva~h@6i`3`1r$&~0RGWKbZPbL@}k5Q%Q_CwbYZKi6pJG(@8hI^fSm1!;CV{B-6|?&mzmLvd#uu z?6AiHN1SlR#s7r#*MCqTLLpH~D5HWZs;Qxl1{!Img*H0qqK7^PNReiQF(#N|hB+2k zVudv_Y_iQR`@syOV@^3IoN;6nP(T3%6i`3`1r$&~0Rc9FTTxA2q@=j8YU;TQN~V-e`AzJp zyu{}_4vg43?6-fLvEYI^OQVgYS1fN{Rv#_>huEj{^8@FWmd4(jAG-(RpE-Psf4<8S0t5&UAV7cs0RjXF5FpU+0#}Ff z3P+Wf=UqKJTHg?9j5bD=uU@*Sap9t+^^xU^TN+m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#=r zuw>+rQxA?i?o@pNR}cXL1PBlyK!5-N0t5&U$Z3J3eSrreyNd4p+QIhDzQEodBD1PBlyK!5-N0t5&U$W?){dBK9|p^CEh*6^(QRgKjx%NiP+!SbYG1PBlyK!5-N0t5&UAV44xNYxh@e#5Ar z=8swT>7#uC`vqJs1PBlyK!5-N0t5&UAV45X1;%%Kzrcx0<{!WB&C{;X7s%2jH*5j~ z2oNAZfB*pk1PBly&^3XieSt@&Uv=$-qG{Xp1-gdlT?7aaAV7cs0RjXF5FkJxLj}_6 z3v6$$tG)cruh!}dWaz3I76AeT2oNAZfB*pk1PBo50fAI~f!phfPJ8CyukX|s=mBJh zAV7cs0RjXF5FkK+009F1D$xDDz<1X_xU2NI&$s9c^y|VoIROF$2oNAZfB*pk1PBo5 zZGohHfzf$u_mBKg&Hw5P^ftfa6Cgl<009C72oNAZfB=DB6-cWuP`3W~!TTncAJ7-* z)wOYO0t5&UAV7cs0RjXF5FpU60;&1}n|E$o{py>4UaK$Augl})1PBlyK!5-N0t5&U zAV8o81iIfB_~s)wt$g-Bryu%0g21pqAoNxb48tJ^5FkK+009C72oNAZfB=C^6G++@ z*znluy?a(vf3CAH&=ClAWZJNehX4Tr1PBlyK!5-N0t5&U=$b&net{8r!GZ~)in8|B z@PcT4b2MDp)Dnrb#f}q<--~MMA|=IzRX=(0mzR9>u@ir!FVHn%?;=2e009C72oNAZ OfB*pk*(h+NFYtei&6nH& diff --git a/examples/sqlite_remember_bot/src/main.rs b/examples/sqlite_remember_bot/src/main.rs index e095150a..f48ed648 100644 --- a/examples/sqlite_remember_bot/src/main.rs +++ b/examples/sqlite_remember_bot/src/main.rs @@ -43,7 +43,7 @@ async fn main() { let dialogue = dialogue.expect("std::convert::Infallible"); handle_message(cx, dialogue).await.expect("Something wrong with the bot!") }, - SqliteStorage::open("sqlite.db", JSON).await.unwrap(), + SqliteStorage::open("db.sqlite", JSON).await.unwrap(), )) .dispatch() .await;