automatic cargo CI changes
This commit is contained in:
parent
0603c3f460
commit
4c1355a94f
|
@ -13,7 +13,6 @@ use libpt::log::{error, info, warn};
|
||||||
|
|
||||||
use self::models::*;
|
use self::models::*;
|
||||||
use self::schema::posts::dsl::*;
|
use self::schema::posts::dsl::*;
|
||||||
use diesel::prelude::*;
|
|
||||||
|
|
||||||
pub fn establish_connection() -> anyhow::Result<SqliteConnection> {
|
pub fn establish_connection() -> anyhow::Result<SqliteConnection> {
|
||||||
dotenv()?;
|
dotenv()?;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use diesel::SqliteConnection;
|
use diesel::SqliteConnection;
|
||||||
use diesel_demo::models::PostDraft;
|
use diesel_demo::models::PostDraft;
|
||||||
use libpt::log::{self, debug, info, trace, warn};
|
use libpt::log::{self, debug, trace};
|
||||||
|
|
||||||
use diesel_demo as lib;
|
use diesel_demo as lib;
|
||||||
|
|
||||||
|
@ -32,19 +32,18 @@ fn repl(conn: &mut SqliteConnection) -> anyhow::Result<()> {
|
||||||
lib::read_buf_interactive(&mut buf)?;
|
lib::read_buf_interactive(&mut buf)?;
|
||||||
buf = buf.to_uppercase();
|
buf = buf.to_uppercase();
|
||||||
if buf.starts_with("HELP") {
|
if buf.starts_with("HELP") {
|
||||||
println!("\
|
println!(
|
||||||
|
"\
|
||||||
help - show this menu\n\
|
help - show this menu\n\
|
||||||
exit - exit the application\n\
|
exit - exit the application\n\
|
||||||
new - create a new post")
|
new - create a new post"
|
||||||
}
|
)
|
||||||
else if buf.starts_with("EXIT") {
|
} else if buf.starts_with("EXIT") {
|
||||||
break;
|
break;
|
||||||
}
|
} else if buf.starts_with("NEW") {
|
||||||
else if buf.starts_with("NEW") {
|
|
||||||
let post = PostDraft::interactive_create()?;
|
let post = PostDraft::interactive_create()?;
|
||||||
post.post(conn)?;
|
post.post(conn)?;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
println!("Bad input: try 'help'");
|
println!("Bad input: try 'help'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue