Skip to content

generate insert struct to enable autoincrement / serial usage #70

@thomas725

Description

@thomas725

The current diesel getting started guide makes use of a serial (postgres) / autoncrement (sqlite) primary key and tells the reader to write an additional insert model struct to be able to make use of that database feature.

I'd love it if there where a way to generate a separate insert struct that skips columns with auto-increment and default values.

Even nicer would be if those fields where generated as options - even when they're defined as not null - since there's still a sensible scenario for them being None on creation before inserting them to the database = to make use of those defaults defined on the SQL side. But I guess that's something diesel itself would need to support and I'm not sure if it does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions