SQT
A C++ ORM framework for SQLite
Loading...
Searching...
No Matches

◆ SQT_COLUMN_FIELD_2_DEFAULT

#define SQT_COLUMN_FIELD_2_DEFAULT ( COLUMN_NAME,
INSTANCE_NAME,
FIELD,
DEFAULT_VALUE )

Defines a column with a custom instance name and a default value that binds to the specified field of the entity type.

Parameters
COLUMN_NAMEThe name of the column in the database.
INSTANCE_NAMEThe name of the column instance.
FIELDThe field of the entity type to which the column is bound.
DEFAULT_VALUEThe default value of the column.

This macro is similar to the SQT_COLUMN_FIELD_2 macro, except that it allows specifying a default value for the column.

Example usage:

struct MyEntity {
int value{};
};
SQT_TABLE_BEGIN(MyEntityTable, MyEntity)
SQT_COLUMN_FIELD_2_DEFAULT(Value, CustomValue, value, 0)
#define SQT_TABLE_BEGIN(TABLE_NAME, ENTITY_TYPE)
Begins the definition of a table type for the specified entity type.
Definition table_definition.h:147
#define SQT_TABLE_END
Ends the definition of a table type.
Definition table_definition.h:1091
#define SQT_COLUMN_FIELD_2_DEFAULT(COLUMN_NAME, INSTANCE_NAME, FIELD, DEFAULT_VALUE)
Defines a column with a custom instance name and a default value that binds to the specified field of...
Definition table_definition.h:416
See also
SQT_COLUMN_FIELD_2