0 | module Oracle.FFI.Lob
 1 |
 2 | %default total
 3 |
 4 | ||| Retrieve the LOB handle stored inside a dpiData value.
 5 | |||
 6 | ||| Parameters:
 7 | ||| - dpiData pointer
 8 | |||
 9 | ||| Returns:
10 | ||| - dpiLob pointer.
11 | ||| - NULL if no LOB is present.
12 | |||
13 | ||| The returned LOB handle is owned by the statement row and must not be released with `oracle_lob_release`.
14 | |||
15 | export %foreign "C:oracle_data_lob,oracle-idris"
16 | prim__dataLob : AnyPtr -> PrimIO AnyPtr
17 |
18 | ||| Retrieve the byte size of a LOB.
19 | |||
20 | ||| Returns:
21 | ||| - Size of the LOB.
22 | ||| - Negative value on failure.
23 | |||
24 | export %foreign "C:oracle_lob_size,oracle-idris"
25 | prim__lobSize : AnyPtr -> PrimIO Int64
26 |
27 | ||| Read bytes from a BLOB.
28 | |||
29 | ||| Parameters:
30 | ||| - LOB handle
31 | ||| - offset
32 | ||| - length
33 | |||
34 | ||| Returns:
35 | ||| - Allocated buffer containing the data.
36 | |||
37 | ||| The returned buffer must be released with `oracle_lob_free_buffer`.
38 | |||
39 | export %foreign "C:oracle_lob_read,oracle-idris"
40 | prim__lobRead : AnyPtr -> Int64 -> Int64 -> PrimIO String
41 |
42 | ||| Read a CLOB as UTF-8 text.
43 | |||
44 | ||| The returned string is allocated by the C layer and must be released.
45 | |||
46 | export %foreign "C:oracle_clob_read,oracle-idris"
47 | prim__clobRead : AnyPtr -> PrimIO String
48 |
49 | ||| Release a LOB handle.
50 | |||
51 | export %foreign "C:oracle_lob_release,oracle-idris"
52 | prim__lobRelease : AnyPtr -> PrimIO ()
53 |