docudb  1.0
Loading...
Searching...
No Matches
docudb::db_document_ref Struct Reference

Reference to a database document. More...

#include <docudb.hpp>

Public Member Functions

 db_document_ref (db_document const &doc)
 Constructs a new db_document_ref object from a db_document object.
 
 db_document_ref (std::string_view table_name, std::string_view doc_id, sqlite3 *db_handle)
 Constructs a new db_document_ref object.
 
std::string id () const
 Gets the document ID.
 
db_document doc () const
 Gets the full document object.
 
void erase ()
 Removes the document from the collection.
 

Detailed Description

Reference to a database document.

Definition at line 515 of file docudb.hpp.

Constructor & Destructor Documentation

◆ db_document_ref() [1/2]

docudb::db_document_ref::db_document_ref ( db_document const & doc)

Constructs a new db_document_ref object from a db_document object.

Parameters
docThe document object.

◆ db_document_ref() [2/2]

docudb::db_document_ref::db_document_ref ( std::string_view table_name,
std::string_view doc_id,
sqlite3 * db_handle )

Constructs a new db_document_ref object.

Parameters
table_nameThe name of the table.
doc_idThe document ID.
db_handleThe SQLite database handle.

Member Function Documentation

◆ doc()

db_document docudb::db_document_ref::doc ( ) const

Gets the full document object.

Returns
db_document The document object.

◆ erase()

void docudb::db_document_ref::erase ( )

Removes the document from the collection.

Returns
void

◆ id()

std::string docudb::db_document_ref::id ( ) const

Gets the document ID.

Returns
std::string The document ID.

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