ATLAS Offline Software
Loading...
Searching...
No Matches
Database
SQLiteDBSvc
src
SQLiteDBSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SQLiteDBSvc.h
"
6
7
StatusCode
SQLiteDBSvc::initialize
() {
8
sqlite3* temp =
nullptr
;
9
const
int
err = sqlite3_open_v2(
m_databasePath
.value().c_str(), &temp,
10
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
11
SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_URI,
12
nullptr
);
13
if
(err != 0) {
14
ATH_MSG_ERROR
(
"Error opening SQLite DB: << "
<< sqlite3_errstr(err));
15
return
StatusCode::FAILURE;
16
}
17
m_db.reset(temp);
18
ATH_MSG_INFO
(
"Opened db connection to "
<<
m_databasePath
.value().c_str());
19
return
StatusCode::SUCCESS;
20
}
21
22
SQLite::Statement
SQLiteDBSvc::createStatement
(std::string_view statement,
23
std::source_location call) {
24
return
SQLite::Statement
(m_db.get(), statement, call);
25
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
SQLiteDBSvc.h
SQLiteDBSvc::createStatement
virtual SQLite::Statement createStatement(std::string_view statement, std::source_location call=std::source_location::current()) override
Compile a prepared statement attached to this database.
Definition
SQLiteDBSvc.cxx:22
SQLiteDBSvc::m_databasePath
Gaudi::Property< std::string > m_databasePath
Definition
SQLiteDBSvc.h:42
SQLiteDBSvc::initialize
virtual StatusCode initialize() override
Initialize.
Definition
SQLiteDBSvc.cxx:7
SQLite::Statement
SQLite prepared statement.
Definition
Statement.h:50
Generated on
for ATLAS Offline Software by
1.14.0