userver
C++ Async Framework
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/storages/sqlite/component.hpp
4
/// @brief components::SQLite
5
6
#
include
<
userver
/
components
/
component_base
.
hpp
>
7
8
#
include
<
userver
/
utils
/
statistics
/
entry
.
hpp
>
9
10
#
include
<
userver
/
storages
/
sqlite
/
client
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
components
{
15
16
/// @ingroup userver_components
17
///
18
/// @brief SQLite client component
19
///
20
/// Provides access to a SQLite connections via storages::sqlite::Client.
21
///
22
/// ## Static configuration example:
23
///
24
/// ```
25
/// # yaml
26
/// sqlite-dv:
27
/// db-path: "/tmp/kv.db"
28
/// task_processor: fs-task-processor
29
/// journal_mode: wal
30
/// busy_timeout: 1000 # ms
31
/// read_only: false
32
/// initial_read_only_pool_size: 4
33
/// max_read_only_pool_size: 16
34
/// persistent_prepared_statements: true
35
/// cache_size: -65536 # KiB
36
/// foreign_keys: true
37
/// ```
38
/// You must specify `db-path`.
39
///
40
/// Please see [SQLite documentation](https://www.sqlite.org/pragma.html)
41
/// on connection strings.
42
///
43
/// ## Static options of components::SQLite :
44
/// @include{doc} scripts/docs/en/components_schema/sqlite/src/storages/sqlite/component.md
45
///
46
/// Options inherited from @ref components::ComponentBase :
47
/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
48
class
SQLite
final
:
public
components
::
ComponentBase
{
49
public
:
50
/// Component constructor
51
SQLite
(
const
ComponentConfig&,
const
ComponentContext&);
52
53
/// Component destructor
54
~
SQLite
()
override
;
55
56
/// Client accessor
57
storages::sqlite::ClientPtr
GetClient
()
const
;
58
59
static
yaml_config
::Schema GetStaticConfigSchema();
60
61
private
:
62
const
storages::sqlite::settings::
SQLiteSettings
settings_;
63
engine
::TaskProcessor& fs_task_processor_;
64
const
storages::sqlite::ClientPtr client_;
65
utils::statistics::Entry statistics_holder_;
66
};
67
68
template
<>
69
inline
constexpr
bool
kHasValidate<SQLite> =
true
;
70
71
}
// namespace components
72
73
USERVER_NAMESPACE_END
userver
storages
sqlite
component.hpp
Generated on Wed Jan 14 2026 20:03:03 for userver by
Doxygen
1.13.2