AugustNagro / magnum

A 'new look' for database access in Scala
Apache License 2.0
153 stars 10 forks source link

[WIP] added simple support for returning clause type of queries #6

Closed lbialy closed 1 year ago

lbialy commented 1 year ago

This PR is mostly a proposal, hence limited testing. Currently it's not possible to write a custom returning scheme update because .update call does not allow it. This PR introduces this capability but it's not refined and probably lacks necessary genericity to work with all databases (that piece of handling is quite different from what I recall and see in Magnum's codebase anyway). A discussion on how to support this would be nice. Maybe it should be done the other way around - via extension methods for Frag available in scopes of DbType subtype imports?

AugustNagro commented 1 year ago

Thanks for this contribution. I think this scheme looks good to me. If a user chooses a database that doesn't support RETURNING (which is part of the SQL standard), they should know not to write such statements.

lbialy commented 1 year ago

ok, resolving conflicts

lbialy commented 1 year ago

@AugustNagro bump