Skip to content

Request for setting statement properties ROW_PREFETCH and LOBPREFETCH_SIZE #39

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

Closed
daviessm opened this issue Jun 18, 2021 · 6 comments
Closed

Comments

@daviessm
Copy link
Contributor

I would like to be able to set the properties DEFAULT_LOBPREFETCH_SIZE and DEFAULT_ROW_PREFETCH when connections are created (incl. pooled connections from r2d2_oracle): https://docs.oracle.com/cd/E18283_01/appdev.112/e10646/ociaahan.htm#sthref5292

@daviessm daviessm changed the title Request for setting connection properties Request for setting statement properties ROW_PREFETCH and LOBPREFETCH_SIZE Jun 18, 2021
@daviessm
Copy link
Contributor Author

LOBPREFETCH_SIZE isn't yet implemented in ODPI-C, I've requested it here: oracle/odpi#163

@kubo
Copy link
Owner

kubo commented Jun 26, 2021

In oracle/odpi#163 (comment)

I'll add Statement.define() to rust-oracle.

I didn't after I thought about use cases. Instead, I changed the type for LOB columns to string to follow @anthony-tuininga's suggestion.

@anthony-tuininga
Copy link

anthony-tuininga commented Jun 26, 2021

Returning CLOBs as strings and BLOBs as bytes (whatever those are called in Rust!) makes good sense. There may still be occasions, however, where you want to return the LOB -- for those cases where you have a LOB that won't fit in memory and you want to only read or write portions of it at a time. Those situations are rare, but definitely exist!

@kubo
Copy link
Owner

kubo commented Jun 26, 2021

@anthony-tuininga I agree with you.

I have a plan to support reading and writing portions of LOBs. I did it two month ago in my local repository excluding documentation and small tweaks. When I make it public, I'll add a statement parameter to get LOB column data as Lob data types. I thought that they were rare so LOB data are got as strings or bytes by default.

@daviessm
Copy link
Contributor Author

Resolved with 7ec5577 - configurability of ROW_PREFETCH; and d29652c - directly access CLOBs as Strings and BLOBs as bytes

@kubo
Copy link
Owner

kubo commented Jul 26, 2021

FYI though the following may be unnecessary by d29652c.

I added Connection::set_oci_attr corresponding to dpiConn_setOciAttr, which sets OCI handle attributes to connections.
I also added types corresponding to some OCI handle attributes, including DEFAULT_LOBPREFETCH_SIZE. See here.

Note: Connection::set_oci_attr may be changed to unsafe function later.

@kubo kubo closed this as completed Jul 26, 2021
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 a pull request may close this issue.

3 participants