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

◆ SQT_PRIMARY_KEY_AUTO_INC

#define SQT_PRIMARY_KEY_AUTO_INC ( COLUMN_NAME)
Value:
__SQT_PRIMARY_KEY(true, COLUMN_NAME)

Defines an autoincrement primary key with the specified column.

Parameters
COLUMN_NAMEThe name of the column that forms the autoincrement primary key.

This macro is similar to SQT_PRIMARY_KEY, except that it defines an autoincrement primary key.

The column's value type must be an integer type.

Example usage:

struct MyEntity {
int id{};
std::string name;
};
SQT_TABLE_BEGIN(MyEntityTable, MyEntity)
SQT_COLUMN_FIELD(Name, name)
// Define the autoincrement primary key with the ID column.
#define SQT_COLUMN_FIELD(COLUMN_NAME, FIELD)
Defines a column that binds to the specified field of the entity type.
Definition table_definition.h:273
#define SQT_TABLE_BEGIN(TABLE_NAME, ENTITY_TYPE)
Begins the definition of a table type for the specified entity type.
Definition table_definition.h:141
#define SQT_TABLE_END
Ends the definition of a table type.
Definition table_definition.h:854
#define SQT_PRIMARY_KEY_AUTO_INC(COLUMN_NAME)
Defines an autoincrement primary key with the specified column.
Definition table_definition.h:639
See also
SQT_PRIMARY_KEY