Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
sqlite.hh File Reference
#include <functional>
#include <string>
#include "error.hh"

Go to the source code of this file.

Classes

struct  nix::SQLite
 
struct  nix::SQLiteStmt
 
class  nix::SQLiteStmt::Use
 
struct  nix::SQLiteTxn
 
struct  nix::SQLiteError
 

Enumerations

enum class  nix::SQLiteOpenMode { Normal , NoCreate , Immutable }
 

Functions

 nix::MakeError (SQLiteBusy, SQLiteError)
 
void nix::handleSQLiteBusy (const SQLiteBusy &e, time_t &nextWarning)
 
template<typename T, typename F>
nix::retrySQLite (F &&fun)
 

Enumeration Type Documentation

◆ SQLiteOpenMode

enum class nix::SQLiteOpenMode
strong
Enumerator
Normal 

Open the database in read-write mode. If the database does not exist, it will be created.

NoCreate 

Open the database in read-write mode. Fails with an error if the database does not exist.

Immutable 

Open the database in immutable mode. In addition to the database being read-only, no wal or journal files will be created by sqlite. Use this mode if the database is on a read-only filesystem. Fails with an error if the database does not exist.

Function Documentation

◆ retrySQLite()

template<typename T, typename F>
T nix::retrySQLite ( F && fun)

Convenience function for retrying a SQLite transaction when the database is busy.