-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for Zig arrays as MySql values #21
Conversation
Thanks for submitting the PR. My preference is about the same as yours (truncating), it's a little implicit, but I guess user should expect this when they are using field with fixed sized array type, so I am fine with it. They would be on their own. Do you mind adding test cases in
Also, adding this to |
Sure thing! I am also working on support for std.bounded_array |
Added some tests. |
@evyatark2 Thanks! The test looks great! I have left one comment. The Types support can be found in the last section: https://github.com/speed2exe/myzql/?tab=readme-ov-file#binary-column-types-support |
LGTM |
I'll create a new PR with documentation for both arrays and BoundedArrays soon |
@evyatark2 PR is looks good. Do you mind resolving the merge conflict? |
Done. |
I am conflicted on how to handle insufficiently-sized arrays.
In this PR, I just truncate the data to fit the array, but in Connector/C they return an error indicating that a short-read was performed.
Would like to hear your opinion on this.
EDIT: Forgot to mention that this should be used for fixed-length MySql columns (i.e. a hash of 16-bytes), so maybe it is a user error to pass an incorrectly-sized array?