Conclude example
This commit is contained in:
parent
13aacc3b6b
commit
78ef2762e7
21 changed files with 1809 additions and 6 deletions
9
simple_text_board/Cargo.lock
generated
9
simple_text_board/Cargo.lock
generated
|
@ -1,5 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.14.1"
|
||||
|
@ -79,6 +81,12 @@ dependencies = [
|
|||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b"
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.14"
|
||||
|
@ -1179,6 +1187,7 @@ dependencies = [
|
|||
name = "simple_text_board"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
"diesel",
|
||||
"log 0.4.13",
|
||||
|
|
|
@ -10,6 +10,7 @@ chrono = { version = "0.4", features = ["serde"] }
|
|||
diesel = { version = "1.4", features = ["sqlite", "chrono"] }
|
||||
log = "0.4"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
anyhow = "1.0"
|
||||
|
||||
[dependencies.rocket_contrib]
|
||||
version = "0.4"
|
||||
|
|
|
@ -15,7 +15,7 @@ pub struct NewPost<'a> {
|
|||
}
|
||||
|
||||
impl NewPost<'_> {
|
||||
pub fn insert(&self, conn: &diesel::SqliteConnection) -> QueryResult<usize> {
|
||||
pub fn insert(&self, conn: &SqliteConnection) -> QueryResult<usize> {
|
||||
diesel::insert_into(table_posts).values(self).execute(conn)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue