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

custom InsertStatement with returning #1526

Closed
wayerr opened this issue Jun 7, 2022 · 4 comments · Fixed by #2060
Closed

custom InsertStatement with returning #1526

wayerr opened this issue Jun 7, 2022 · 4 comments · Fixed by #2060
Assignees

Comments

@wayerr
Copy link

wayerr commented Jun 7, 2022

For some cases I want to create 'insert on conflict update' (for Postgres) with RETURNING and custom conflict_target (in PG terms).
For this i was use InsertStatement as base class and override InsertStatement#prepareSQL it is works fine. Except insert is does not return column when it is presented in arguments.
Returning values is replaced with arguments:

I can not override processResults - it is private.
I can override PreparedStatementApi.executeInternal(transaction: Transaction): Int, but resultedValues setter is private.

Therefore current design does not provide easy way to disable replacement of returned values.

@zak905
Copy link

zak905 commented Nov 7, 2022

Hi @wayerr,

would you mind sharing an example of how you managed to achieve an insert with returning please ?

@zak905
Copy link

zak905 commented Nov 8, 2022

Hi @wayerr, I see that you posted, and removed again, any particular reason ? by the way, I still have the code you posted from the email notification

@wayerr
Copy link
Author

wayerr commented Nov 8, 2022

@zak905 I am not sure that this code is worked properly, and I does not have time to test it.

@zak905
Copy link

zak905 commented Nov 8, 2022

Ok thanks anyway, It seems so complex anyway, I think I will wait for #1456

@bog-walk bog-walk self-assigned this Apr 10, 2024
@bog-walk bog-walk linked a pull request Apr 26, 2024 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

3 participants