Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using insertSelect with an entire Entity #367

Open
isomorpheme opened this issue Jul 7, 2023 · 0 comments
Open

Support using insertSelect with an entire Entity #367

isomorpheme opened this issue Jul 7, 2023 · 0 comments

Comments

@isomorpheme
Copy link
Contributor

Sometimes I want to insert entire entities into a table, from a SELECT query, including the primary key.1 As far as I can tell, this isn't possible with the current insertSelect & Insertion API - the PersistEntity constraint and the types of (<#) and (<&>) get in the way.

The easiest way to support this is probably with an extra insertSelectEntity, to parallel insertEntityMany from Persistent. I haven't yet tried to come up with a safe type for such a function.

Footnotes

  1. My use case right now actually involves a REPLACE, as in Support replaceSelect #86, but it's otherwise the same idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant