lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
lintel::sqlite::Connection Class Reference

#include <Connection.h>

Public Member Functions

 Connection (const std::string &connectionInfo)
 
 Connection (const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
 
 Connection (Connection &connection)=delete
 
bool isHealthy () const
 
 ~Connection ()
 

Friends

class Transaction
 
class Statement
 
class PreparedStatement
 
class Notify
 
class Cursor
 

Detailed Description

SQLite database connection wrapping a sqlite3 handle.

Constructor & Destructor Documentation

◆ Connection() [1/3]

lintel::sqlite::Connection::Connection ( const std::string &  connectionInfo)
explicit

Constructs an SQLite connection from a file path.

Parameters
connectionInfothe path to the SQLite database file

◆ Connection() [2/3]

lintel::sqlite::Connection::Connection ( const std::shared_ptr< DatabaseConnectionEntry > &  connectionEntry)
explicit

Constructs an SQLite connection from a configuration entry.

Parameters
connectionEntrythe database connection configuration entry

◆ Connection() [3/3]

lintel::sqlite::Connection::Connection ( Connection &  connection)
delete

◆ ~Connection()

lintel::sqlite::Connection::~Connection ( )

Destructor, closes the database.

Member Function Documentation

◆ isHealthy()

bool lintel::sqlite::Connection::isHealthy ( ) const

Lightweight liveness probe.

Runs SELECT 1 on the open handle instead of reading sqlite3_errcode, because the error code stays set after a non-fatal error (e.g. a constraint violation) and would wrongly report a healthy connection as broken.

Returns
true when the connection answered SELECT 1

Friends And Related Symbol Documentation

◆ Cursor

◆ Notify

◆ PreparedStatement

◆ Statement

◆ Transaction


The documentation for this class was generated from the following file: