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 inserts(entities) to SqlAgent #145

Merged
merged 8 commits into from
Jan 15, 2019
Merged

Conversation

ota-meshi
Copy link
Member

@ota-meshi ota-meshi commented Jan 11, 2019

This PR adds insertion methods for multiple entities.

  • SqlAgent#inserts(entities) ... Insert multiple entities.
  • SqlAgent#inserts(entities, condition) ... The condition limits the number of records for each execution.

The method of insert is switched by jp.co.future.uroborosql.enums.InsertsType selection.

  • BULK ... BULK INSERT. e.g. INSERT INTO ... VALUES ( ... ), ( ... )
  • BATCH ... BATCH INSERT

By setting the default value of jp.co.future.uroborosql.enums.InsertsType, users can use it without being conscious. (default BULK)
The default value can be set with SqlAgentFactory#setDefaultInsertsType.

You can also select by calling method. SqlAgent#inserts(entities, insertsType)


This API solves one of issue #102 .

@coveralls
Copy link

coveralls commented Jan 11, 2019

Coverage Status

Coverage increased (+0.3%) to 75.163% when pulling 1517e39 on dev/bulk-insert into d55c18e on master.

Copy link
Contributor

@HidekiSugimoto189 HidekiSugimoto189 left a comment

Choose a reason for hiding this comment

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

I pointed out some considerations

@ota-meshi
Copy link
Member Author

ota-meshi commented Jan 14, 2019

@HidekiSugimoto189 Thank you for your review!
I fixed this PR according to your requests. so please check again.

@HidekiSugimoto189 HidekiSugimoto189 merged commit 46d12a2 into master Jan 15, 2019
@ota-meshi ota-meshi deleted the dev/bulk-insert branch January 15, 2019 22:42
@HidekiSugimoto189 HidekiSugimoto189 added this to the v0.10.0 milestone Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants