felipecrv commented on issue #4428: URL: https://github.com/apache/arrow-adbc/issues/4428#issuecomment-4850013548
There are two scenarios: 1. Rust driver being used from C ABI: the layer can turn &CStr it’s receiving into &str by taking the strlen() of the &CStr and producing a length-bound &str. 2. Rust code loading a C driver (or any other language): keys and values are &str but you still have to allocate CString to take a &CStr on them. I was referring to scenario 2 in my message. You are looking only at scenario 1. As y’all might know, I’m a big enthusiast of dynamically loading drivers. So even when using Rust-written drivers, I want to use them via the C ABI to avoid the dependency hell with all the SDKs and Arrow dependencies that drivers need. From this PoV, a solution to scenario 1 doesn’t help. The best of both worlds would be adbc.h supporting Pascal strings (pointer and length arguments). C code could always pass NUL-terminated strings with the strlen(ptr) and non-C code (like Rust) would happily pass their pointers and known-length values. On Wed, 1 Jul 2026 at 00:06 David Li ***@***.***> wrote: > *lidavidm* left a comment (apache/arrow-adbc#4428) > <https://github.com/apache/arrow-adbc/issues/4428#issuecomment-4849894668> > > For setting an option, would that apply? Presumably Rust ignores the > trailing NUL? We would have to copy/reallocate when exporting an option, > that's true. > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/arrow-adbc/issues/4428?email_source=notifications&email_token=AABSXM6WOG2BZRKJVBSNCHD5CR54JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBUHE4DSNBWGY4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4849894668>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AABSXM5ZYNBVT5F3GEHGVLD5CR54JAVCNFSNUABFKJSXA33TNF2G64TZHM2DSOBXHA2TKMJXHNEXG43VMU5TINZRHA3DANJRGM4KC5QC> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> > -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
