lintel 0.2.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
lintel::db::Serialization< T > Class Template Reference

#include <Serialization.h>

Static Public Member Functions

static std::string serialize (T type, const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
 
static T deserialize (const std::string &value, const std::shared_ptr< DatabaseConnectionEntry > &connectionEntry)
 

Detailed Description

template<typename T>
class lintel::db::Serialization< T >

Dispatcher for type serialization that delegates to the appropriate backend (PostgreSQL or SQLite) based on the connection entry type.

Template Parameters
Tthe type to serialize/deserialize

Member Function Documentation

◆ deserialize()

template<typename T >
static T lintel::db::Serialization< T >::deserialize ( const std::string &  value,
const std::shared_ptr< DatabaseConnectionEntry > &  connectionEntry 
)
inlinestatic

Deserializes a string to a value using the backend for the given connection type.

Parameters
valuethe string to deserialize
connectionEntrythe connection entry specifying the backend
Returns
the deserialized value
Exceptions
std::runtime_errorif the connection type is not supported

◆ serialize()

template<typename T >
static std::string lintel::db::Serialization< T >::serialize ( T  type,
const std::shared_ptr< DatabaseConnectionEntry > &  connectionEntry 
)
inlinestatic

Serializes a value to a string using the backend for the given connection type.

Parameters
typethe value to serialize
connectionEntrythe connection entry specifying the backend
Returns
the serialized string
Exceptions
std::runtime_errorif the connection type is not supported

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