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

Add Insert query execution without RETURNING clause #1208

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

trueb2
Copy link
Contributor

@trueb2 trueb2 commented Nov 7, 2022

PR Info

Some databases do not support it or it may not be desirable to return from an insert statement. For example, #485 (idk why it is closed).

In TimescaleDB, you cannot use RETURNING in some cases that are fundamental. Query Error: error returned from database: insert with ON CONFLICT or RETURNING clause is not supported on compressed chunks.

This PR doesn't address most of #485 like the codegen, representation, or selection for tables without primary keys. This PR only provides an alternative insert execution path that works for TimescaleDB hypertables.

New Features

Inserts now can be performed without returning last id. This is useful, if you want to insert many rows, if you do not have any primary keys, if you cannot use the RETURNING clause.

Bug Fixes

This is an essential feature gap compared to Diesel.

Breaking Changes

None

Changes

Adds an Insert::exec_without_returning function parallel to Insert::exec and Insert::exec_with_returning.

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 this pull request may close these issues.

2 participants