Skip to content

How to add test to check that SeaORM table is correct? #915

Answered by ghost
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks.

Here is the corrected code

./Cargo.toml

[package]
name = "media_wiki"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
futures = "0.3.21"
sea-orm = { version = "^0.9.0", features = [ "sqlx-sqlite", "runtime-async-std-native-tls", "macros" ] }
sea-orm-migration = "^0.9.0"

./src/main.rs

mod migrator;

use futures::executor::block_on;
use sea_orm::{ConnectionTrait, Database, DbBackend, DbErr, Statement};
use sea_orm_migration::prelude::*;

const DATABASE_URL: &str = "sqlite:./sqlite.db?mode=rwc";

async fn run() -> Result<(), DbErr> {
    let db = Database::connect(DATABASE_URL).await…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant