odbc_api/
buffers.rs

1/*!
2# Using buffers to fetch results
3
4The most efficient way to query results is not query an ODBC data source row by row, but to
5ask for a whole bulk of rows at once. The ODBC driver and driver manager will then fill these
6row sets into buffers which have been previously bound. This is also the most efficient way to
7query a single row many times for many queries, if the application can reuse the bound buffer.
8This crate allows you to provide your own buffers by implementing the [`crate::RowSetBuffer`]
9trait. That however requires `unsafe` code.
10
11This crate also provides three implementations of the [`crate::RowSetBuffer`] trait, ready to be
12used in safe code:
13
14* [`crate::buffers::ColumnarBuffer`]: Binds to the result set column wise. This is usually helpful
15  in dataengineering or data sciense tasks. This buffer type can be used in situations there the
16  schema of the queried data is known at compile time, as well as for generic applications which do
17  work with wide range of different data. Checkt the struct documentation for examples.
18* [`crate::buffers::TextRowSet`]: Queries all data as text bound in columns. Since the columns are
19  homogeneous, you can also use this, to iterate row wise over the buffer. Excellent if you want
20  to print the contents of a table, or are for any reason only interessted in the text
21  representation of the values.
22* [`crate::buffers::RowVec`]: A good choice if you know the schema at compile time and your
23  application logic is build in a row by row fashion, rather than column by column.
24
25*/
26
27mod any_buffer;
28mod bin_column;
29mod column_with_indicator;
30mod columnar;
31mod description;
32mod indicator;
33mod item;
34mod row_vec;
35mod text_column;
36
37pub use self::{
38    any_buffer::{AnyBuffer, AnySlice, AnySliceMut, ColumnarAnyBuffer},
39    bin_column::{BinColumn, BinColumnIt, BinColumnSliceMut, BinColumnView},
40    column_with_indicator::{NullableSlice, NullableSliceMut},
41    columnar::{ColumnBuffer, ColumnarBuffer, TextRowSet},
42    description::BufferDesc,
43    indicator::Indicator,
44    item::Item,
45    row_vec::{FetchRow, FetchRowMember, RowVec},
46    text_column::{
47        CharColumn, TextColumn, TextColumnIt, TextColumnSliceMut, TextColumnView, WCharColumn,
48    },
49};