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