Skip to content

Need a way to get the primary key back from an insert call #19

@sc68cal

Description

@sc68cal

Generally, it is useful to have the primary key get returned from an insert call in an ORM, so that you can insert rows into other tables and reference that newly created row in the primary table, do HTTP redirects using that primary key, etc etc etc.

Currently repo.insert return is void which is not very helpful.

Looking briefly at the PostgreSQL docs, it appears that the INSERT INTO <> VALUES <> RETURNING id seems to be the general practice for PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions