typed-sql icon indicating copy to clipboard operation
typed-sql copied to clipboard

Is it possible to manually rename the table?

Open BeneCollyridam opened this issue 4 years ago • 0 comments

Hey,

I love this project, and I am very excited to try it out, however I ran into a problem, where the name of my table is different from the struct name (as it is namespaced).

Are you able to change the table name in any way for a struct derived with Table? My code looks like this:

#[derive(Table, FromRow, Debug)]
struct Parent {
    id: i32,
    first_name: String,
    last_name: String,
}

In Diesel I believe they allow you to add #[table_name="people_parent"] to change the name of a table. Do you have a similar feature planned/does it exist?

BeneCollyridam avatar Jun 17 '21 14:06 BeneCollyridam