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 generated keys from INSERT query #207

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

nicktorwald
Copy link

Parse the 'generated_ids' array which is returned after successful
INSERT command has applied. This makes sense when a table primary key
has an autoincrement property. The driver always returns a predefined
result set with a single-column table (column name is 'GENERATED_KEYS')
where each row is one generated value.

Closes: #77

@nicktorwald nicktorwald force-pushed the nicktorwald/gh-77-generated-keys branch 2 times, most recently from 13b829c to ea2a9c3 Compare July 18, 2019 18:17
@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 75.008% when pulling ea2a9c3 on nicktorwald/gh-77-generated-keys into b53e0ba on master.

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

See one comment below.

It is not in WIP status, yep?

@nicktorwald nicktorwald changed the title WIP: Support generated keys from INSERT query Support generated keys from INSERT query Aug 7, 2019
Implement several ResultSetMetaData methods to be able be run as a
proper JDBC-driver inside Base tool.

Reworked SQL data types in relation with Tarantool NoSQL types as well
as JDBC types. A data conversations are left out of this commit.

This issue also addresses to tarantool/tarantool#3292 to be executed
in a dry-run mode. LibreOffice Base uses PreparedStatement.getMetadata()
without a real query execution to extract a metadata in advance. This
causes NPE in #198.

Follows on: #198
Parse the 'generated_ids' array which is returned after successful
INSERT command has applied. This makes sense when a table primary key
has an autoincrement property. The driver always returns a predefined
result set with a single-column table (column name is 'GENERATED_KEYS')
where each row is one generated value.

Closes: #77
@nicktorwald nicktorwald force-pushed the nicktorwald/gh-77-generated-keys branch from ea2a9c3 to 35ad713 Compare August 8, 2019 09:30
@nicktorwald nicktorwald merged commit e89eb07 into master Aug 8, 2019
@nicktorwald nicktorwald deleted the nicktorwald/gh-77-generated-keys branch August 15, 2019 10:26
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.

jdbc: Support Connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)
3 participants