Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
database::orm Namespace Reference

Classes

class  entity_base
 Base class for all ORM entities. More...
 
class  entity_manager
 Manages entity metadata and provides factory methods. More...
 
class  entity_metadata
 Metadata for entire entities including table mapping and relationships. More...
 
class  field_accessor
 Template class for type-safe field access. More...
 
class  field_metadata
 Metadata for entity fields including constraints and relationships. More...
 
struct  is_entity
 
struct  is_entity< T, std::void_t< typename T::primary_key_type, decltype(std::declval< T >().table_name()), decltype(std::declval< T >().get_metadata()) > >
 
class  query_builder
 Template query builder for type-safe ORM queries. More...
 

Enumerations

enum class  field_constraint {
  none = 0 , primary_key = 1 , not_null = 2 , unique = 4 ,
  auto_increment = 8 , index = 16 , foreign_key = 32 , default_now = 64
}
 

Functions

field_constraint operator| (field_constraint a, field_constraint b)
 
bool has_constraint (field_constraint constraints, field_constraint check)
 
field_constraint primary_key ()
 
field_constraint not_null ()
 
field_constraint unique ()
 
field_constraint auto_increment ()
 
field_constraint default_now ()
 
field_constraint index (const std::string &name="")
 
field_constraint foreign_key (const std::string &table, const std::string &field)
 

Variables

template<typename T >
constexpr bool is_entity_v = is_entity<T>::value
 
template<typename T >
constexpr bool is_field_type_v
 

Enumeration Type Documentation

◆ field_constraint

Enumerator
none 
primary_key 
not_null 
unique 
auto_increment 
index 
foreign_key 
default_now 
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h.

Definition at line 54 of file entity.h.

54 {
55 none = 0,
56 primary_key = 1,
57 not_null = 2,
58 unique = 4,
60 index = 16,
61 foreign_key = 32,
62 default_now = 64
63 };
field_constraint foreign_key(const std::string &table, const std::string &field)
Definition entity.h:310
field_constraint auto_increment()
Definition entity.h:303
field_constraint unique()
Definition entity.h:302
field_constraint not_null()
Definition entity.h:301
field_constraint primary_key()
Definition entity.h:300
field_constraint default_now()
Definition entity.h:304
field_constraint index(const std::string &name="")
Definition entity.h:306
@ none
No specific database type is set.

Function Documentation

◆ auto_increment()

field_constraint database::orm::auto_increment ( )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h, and orm_framework_demo.cpp.

Definition at line 303 of file entity.h.

303{ return field_constraint::auto_increment; }

References auto_increment.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ default_now()

field_constraint database::orm::default_now ( )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h, and orm_framework_demo.cpp.

Definition at line 304 of file entity.h.

304{ return field_constraint::default_now; }

References default_now.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ foreign_key()

field_constraint database::orm::foreign_key ( const std::string & table,
const std::string & field )
inline

Definition at line 310 of file entity.h.

310 {
311 return field_constraint::foreign_key;
312 }

References foreign_key.

◆ has_constraint()

◆ index()

field_constraint database::orm::index ( const std::string & name = "")
inline

Definition at line 306 of file entity.h.

306 {
307 return field_constraint::index;
308 }

References index.

◆ not_null()

field_constraint database::orm::not_null ( )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h, and orm_framework_demo.cpp.

Definition at line 301 of file entity.h.

301{ return field_constraint::not_null; }

References not_null.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ operator|()

field_constraint database::orm::operator| ( field_constraint a,
field_constraint b )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h.

Definition at line 65 of file entity.h.

65 {
66 return static_cast<field_constraint>(static_cast<int>(a) | static_cast<int>(b));
67 }

◆ primary_key()

field_constraint database::orm::primary_key ( )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h, and orm_framework_demo.cpp.

Definition at line 300 of file entity.h.

300{ return field_constraint::primary_key; }

References primary_key.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ unique()

field_constraint database::orm::unique ( )
inline
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h, and orm_framework_demo.cpp.

Definition at line 302 of file entity.h.

302{ return field_constraint::unique; }

References unique.

Referenced by TEST_F().

Here is the caller graph for this function:

Variable Documentation

◆ is_entity_v

template<typename T >
bool database::orm::is_entity_v = is_entity<T>::value
inlineconstexpr

◆ is_field_type_v

template<typename T >
bool database::orm::is_field_type_v
inlineconstexpr
Initial value:
=
std::is_same_v<T, int32_t> ||
std::is_same_v<T, int64_t> ||
std::is_same_v<T, double> ||
std::is_same_v<T, std::string> ||
std::is_same_v<T, bool> ||
std::is_same_v<T, std::chrono::system_clock::time_point>
Examples
/home/runner/work/database_system/database_system/database/orm/entity.h.

Definition at line 41 of file entity.h.