Diesel - Invalid `table!` syntax. Please see the `table!` macro docs for more info

I tried the Diesel example for MySQL. Made a schema exactly like in the example.

mod schema {
    table! {
        users (id) {
            id -> Integer,
            username -> VarChar,
            email -> VarChar,
            password -> VarChar,
            birthdate -> Timestamp
        }
    }
}

Error:
Invalid table! syntax. Please see the table! macro docs for more info.

What's wrong here?

Solved.

mod schema {
    table! {
        users (id) {
            id -> Integer,
            username -> VarChar,
            email -> VarChar,
            password -> VarChar,
            birthdate -> Timestamp,
        }
    }
}

For some reason this macro requires a trailing comma. Very consistent...

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.