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

make SQLite3::Database.open return the block result instead of the db instance #415

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

toy
Copy link
Contributor

@toy toy commented Oct 14, 2023

To make it follow common pattern, like for File:

result = File.open('/dev/zero') do |f|
  f.read(10)
end

See discussion in #414

Copy link
Member

@flavorjones flavorjones left a comment

Choose a reason for hiding this comment

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

I'm really happy with this PR. Thank you for the thoughtful additional test coverage. I have one small change I requested but otherwise I'd be happy to merge this.

test/test_database.rb Outdated Show resolved Hide resolved
… instance

To make it follow common pattern, like for File:

    result = File.open('/dev/zero') do |f|
      f.read(10)
    end

See discussion in sparklemotion#414
@toy toy marked this pull request as ready for review October 22, 2023 22:26
@toy
Copy link
Contributor Author

toy commented Oct 28, 2023

Interface tells me that I can merge, ok to do so?

@flavorjones flavorjones merged commit e60035e into sparklemotion:master Oct 29, 2023
103 checks passed
@flavorjones
Copy link
Member

Thanks for your patience, merged!

@toy toy deleted the open-return-block-result branch October 29, 2023 02:01
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.

None yet

2 participants