Skip to content

Commit 547d330

Browse files
committed
Updated connection reference doco and added missing newline
1 parent 5c8dc08 commit 547d330

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

dev/connection_holder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ namespace sqlite_orm {
228228

229229
/*
230230
Acquires a database connection upon construction and releases it upon destruction.
231+
232+
Note: It is important to cache the `sqlite3*` pointer for cache-friendliness (thus avoiding to access the holder on each `get()` call).
231233
*/
232234
struct connection_ref {
233235
connection_ref(connection_holder& holder) : holder{&holder}, db{holder.retain()} {}
@@ -259,6 +261,8 @@ namespace sqlite_orm {
259261

260262
/*
261263
Increases the reference count of an existing open connection upon construction and releases it upon destruction.
264+
265+
Note: It is important to cache the `sqlite3*` pointer for cache-friendliness (thus avoiding to access the holder on each `get()` call).
262266
*/
263267
struct connection_ptr {
264268
connection_ptr(connection_holder& holder) : holder{&holder}, db{holder.retain_if_open()} {}

dev/functional/cxx_scope_guard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ namespace sqlite_orm::internal {
1313

1414
F f;
1515
};
16-
}
16+
}

include/sqlite_orm/sqlite_orm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14514,6 +14514,7 @@ namespace sqlite_orm::internal {
1451414514
F f;
1451514515
};
1451614516
}
14517+
1451714518
// #include "functional/gsl.h"
1451814519

1451914520
// #include "error_code.h"
@@ -14851,6 +14852,8 @@ namespace sqlite_orm {
1485114852

1485214853
/*
1485314854
Acquires a database connection upon construction and releases it upon destruction.
14855+
14856+
Note: It is important to cache the `sqlite3*` pointer for cache-friendliness (thus avoiding to access the holder on each `get()` call).
1485414857
*/
1485514858
struct connection_ref {
1485614859
connection_ref(connection_holder& holder) : holder{&holder}, db{holder.retain()} {}
@@ -14882,6 +14885,8 @@ namespace sqlite_orm {
1488214885

1488314886
/*
1488414887
Increases the reference count of an existing open connection upon construction and releases it upon destruction.
14888+
14889+
Note: It is important to cache the `sqlite3*` pointer for cache-friendliness (thus avoiding to access the holder on each `get()` call).
1488514890
*/
1488614891
struct connection_ptr {
1488714892
connection_ptr(connection_holder& holder) : holder{&holder}, db{holder.retain_if_open()} {}

0 commit comments

Comments
 (0)