1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*!
# Using buffers to fetch results
The most efficient way to query results is not to query an ODBC data source row by row, but to
ask for a whole bulk of rows at once. The ODBC driver and driver manager will then fill these
row sets into buffers which have been previously bound. This is also the most efficient way to
query a single row many times across many queries, if the application can reuse the bound buffer.
This crate allows you to provide your own buffers by implementing the [`crate::RowSetBuffer`]
trait. However, that requires `unsafe` code.
This crate also provides three implementations of the [`crate::RowSetBuffer`] trait, ready to be
used in safe code:
* [`crate::buffers::ColumnarBuffer`]: Binds to the result set column-wise. This is usually helpful
in data engineering or data science tasks. This buffer type can be used in situations where the
schema of the queried data is known at compile time, as well as for generic applications which
work with a wide range of different data. Check the struct documentation for examples.
* [`crate::buffers::TextRowSet`]: Queries all data as text bound in columns. Since the columns are
homogeneous, you can also use this to iterate row-wise over the buffer. Excellent if you want
to print the contents of a table, or are for any reason only interested in the text
representation of the values.
* [`crate::buffers::RowVec`]: A good choice if you know the schema at compile time and your
application logic is built in a row-by-row fashion, rather than column by column.
*/
pub use ;