Struct mimir::Lob [] [src]

pub struct Lob { /* fields omitted */ }

LOB handles are used to represent large objects (CLOB, BLOB, NCLOB, BFILE).

Methods

impl Lob
[src]

Adds a reference to the LOB. This is intended for situations where a reference to the LOB needs to be maintained independently of the reference returned when the LOB was created.

Closes the LOB resource. This should be done when a batch of writes has been completed so that the indexes associated with the LOB can be updated. It should only be performed if a call to function Lob::open_resource() has been performed.

Creates an independent copy of a LOB and returns a reference to the newly created LOB. This reference should be released as soon as it is no longer needed.

Flush or write all buffers for this LOB to the server.

Returns the size of the buffer needed to hold the number of characters specified for a buffer of the type associated with the LOB. If the LOB does not refer to a character LOB the value is returned unchanged.

  • size_in_chars - the number of characters for which a buffer size needs to be determined.

Returns the chunk size of the internal LOB. Reading and writing to the LOB in multiples of this size will improve performance.

Returns the directory alias name and file name for a BFILE type LOB.

Returns a (String, String) tuple representing the directory alias and filename.

Returns a bool value indicating if the file referenced by the BFILE type LOB exists.

Returns a boolean value indicating if the LOB resource has been opened by making a call to the function Lob::open_resource() or not.

Returns the size of the data stored in the LOB. For character LOBs the size is in characters; for binary LOBs the size is in bytes.

Opens the LOB resource for writing. This will improve performance when writing to the LOB in chunks and there are functional or extensible indexes associated with the LOB. If this function is not called, the LOB resource will be opened and closed for each write that is performed. A call to the function Lob::close_resource() should be done before performing a call to the function Connection::commit().

Reads data from the LOB at the specified offset into the provided buffer.

Releases a reference to the LOB. A count of the references to the LOB is maintained and when this count reaches zero, the memory associated with the LOB is freed. The LOB is also closed unless that has already taken place using the function Lob:::close().

Sets the directory alias name and file name for a BFILE type LOB.

  • directory - the name of the directory alias.
  • filename - the name of the file.

Replaces all of the data in the LOB with the contents of the provided buffer. The LOB will first be cleared and then the provided data will be written.

  • buffer - the buffer from which the data is written.

Trims the data in the LOB so that it only contains the specified amount of data.

  • length - the new size of the data in the LOB. For character LOBs this value is in characters; for binary LOBs this value is in bytes.

Write data to the LOB at the specified offset using the provided buffer as the source. If multiple calls to this function are planned, the LOB should first be opened using the function Lob::open_resource().

  • buffer - the buffer from which the data is written.
  • offset - the offset into the LOB data from which to start writing. The first position is
  • For character LOBs this represents the number of characters from the beginning of the LOB; for binary LOBS, this represents the number of bytes from the beginning of the LOB.

Trait Implementations

impl From<*mut ODPILob> for Lob
[src]

Performs the conversion.