fn insert_returning_count_returns_number_of_rows_inserted() {
    use crate::schema::users::table as users;
    let connection = &mut connection();
    drop_table_cascade(connection, "users");
    connection
        .execute(
            "CREATE TABLE users (
        id SERIAL PRIMARY KEY,
        name VARCHAR NOT NULL,
        hair_color VARCHAR NOT NULL DEFAULT 'Green'
    )",
        )
        .unwrap();
    let new_users: &[_] = &[
        BaldUser {
            name: "Sean".to_string(),
        },
        BaldUser {
            name: "Tess".to_string(),
        },
    ];
    let count = insert_into(users)
        .values(new_users)
        .execute(connection)
        .unwrap();
    let second_count = insert_into(users)
        .values(&BaldUser {
            name: "Guy".to_string(),
        })
        .execute(connection)
        .unwrap();

    assert_eq!(2, count);
    assert_eq!(1, second_count);
}
// FIXME: Figure out how to handle tests that modify schema
Figure out how to handle tests that modify schema
Figure out how to handle tests that modify schema
fn insert_returning_count_returns_number_of_rows_inserted() {
    use crate::schema::users::table as users;
    let connection = &mut connection();
    drop_table_cascade(connection, "users");
    connection
        .execute(
            "CREATE TABLE users (
        id SERIAL PRIMARY KEY,
        name VARCHAR NOT NULL,
        hair_color VARCHAR NOT NULL DEFAULT 'Green'
    )",
        )
        .unwrap();
    let new_users: &[_] = &[
        BaldUser {
            name: "Sean".to_string(),
        },
        BaldUser {
            name: "Tess".to_string(),
        },
    ];
    let count = insert_into(users)
        .values(new_users)
        .execute(connection)
        .unwrap();
    let second_count = insert_into(users)
        .values(&BaldUser {
            name: "Guy".to_string(),
        })
        .execute(connection)
        .unwrap();
    assert_eq!(2, count);
    assert_eq!(1, second_count);
}
fn insert_returning_count_returns_number_of_rows_inserted ( ) { use crate :: schema :: users :: table as users ; let connection = & mut connection ( ) ; drop_table_cascade ( connection , " " ) ; connection . execute ( " " , ) . unwrap ( ) ; let new_users : & [ _ ] = & [ BaldUser { name : " " . to_string ( ) , } , BaldUser { name : " " . to_string ( ) , } , ] ; let count = insert_into ( users ) . values ( new_users ) . execute ( connection ) . unwrap ( ) ; let second_count = insert_into ( users ) . values ( & BaldUser { name : " " . to_string ( ) , } ) . execute ( connection ) . unwrap ( ) ; assert_eq ! ( 2 count ) ; assert_eq ! ( 1 second_count ) ; }
FIXME: Figure out how to handle tests that modify schema
FIXME : Figure out how to handle tests that modify schema