(db: &DbConn)
| 24 | |
| 25 | #[cfg(feature = "sqlx-sqlite")] |
| 26 | async fn setup_schema(db: &DbConn) -> Result<(), DbErr> { |
| 27 | use sea_query::*; |
| 28 | |
| 29 | let stmt = sea_query::Table::create() |
| 30 | .table(cake::Entity) |
| 31 | .col( |
| 32 | ColumnDef::new(cake::Column::Id) |
| 33 | .integer() |
| 34 | .not_null() |
| 35 | .auto_increment() |
| 36 | .primary_key(), |
| 37 | ) |
| 38 | .col(ColumnDef::new(cake::Column::Name).string()) |
| 39 | .to_owned(); |
| 40 | |
| 41 | let builder = db.get_database_backend(); |
| 42 | let result = db.execute(builder.build(&stmt)).await?; |
| 43 | println!("Create table cake: {result:?}"); |
| 44 | |
| 45 | Ok(()) |
| 46 | } |
| 47 | |
| 48 | #[cfg(feature = "sqlx-sqlite")] |
| 49 | async fn crud_cake(db: &DbConn) -> Result<(), DbErr> { |
no test coverage detected