DatabaseBackend::Sqlite -> DatabaseBackend::MySql

This commit is contained in:
Sam Samai 2021-08-25 22:42:30 +10:00
parent cd9793417b
commit f6994477eb

View File

@ -102,7 +102,7 @@ async fn list(mut con: Connection<Db>) -> Result<Json<Vec<i64>>> {
let all_posts = con let all_posts = con
.query_all(Statement::from_string( .query_all(Statement::from_string(
DatabaseBackend::Sqlite, DatabaseBackend::MySql,
"select * from posts;".to_owned(), "select * from posts;".to_owned(),
)) ))
.await .await
@ -214,7 +214,7 @@ pub fn stage() -> AdHoc {
// .await; // .await;
let create_post_table = con let create_post_table = con
.execute(Statement::from_string( .execute(Statement::from_string(
DatabaseBackend::Sqlite, DatabaseBackend::MySql,
r#" r#"
CREATE TABLE posts ( CREATE TABLE posts (
id int NOT NULL AUTO_INCREMENT, id int NOT NULL AUTO_INCREMENT,
@ -229,7 +229,7 @@ pub fn stage() -> AdHoc {
let create_post = con let create_post = con
.execute(Statement::from_string( .execute(Statement::from_string(
DatabaseBackend::Sqlite, DatabaseBackend::MySql,
"INSERT INTO posts (title, text) VALUES ('a post', 'content of a post')" "INSERT INTO posts (title, text) VALUES ('a post', 'content of a post')"
.to_owned(), .to_owned(),
)) ))