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

fix: binary type options #65

Merged
merged 4 commits into from
Apr 18, 2024
Merged

fix: binary type options #65

merged 4 commits into from
Apr 18, 2024

Conversation

cocoa-xu
Copy link
Member

It seems that we need to use ErlNifBinary when setting binary type options. It saves one copy in the std::string and also fixes a bug I found when doing some mock tests.

I also added these mock tests in this PR, and they will only run when env var CI exists or is explicitly included (although I'm not sure if we would want these mock tests in this repo). If we don't need these mock tests in the repo I'll remove the corresponding commit. :)

@josevalim
Copy link
Member

Hi @cocoa-xu, I would prefer to not have the mock tests. Ideally, we would try to get one of the builtin databases (duckdb or sqlite3) and test those APIs directly against them, using one of their many options. Do you think this would be possible?

@cocoa-xu
Copy link
Member Author

Okay, I think that should be good too. (I was trying to test some implementation but I wasn't quite sure which SQL queries can produce correspond responses hence I added the mocked ones)

@cocoa-xu cocoa-xu merged commit 510e4a5 into main Apr 18, 2024
3 checks passed
@cocoa-xu cocoa-xu deleted the cx/fix-binary-type-option branch April 18, 2024 07:43
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