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

◆ SQT_INDEX_UNIQUE

#define SQT_INDEX_UNIQUE ( ...)

Defines an unique index with auto-generated names based on the specified columns.

Parameters
...The names of the columns that form the unique index. An index can consist of up to 8 columns.

This macro is similar to SQT_INDEX, except that it defines an unique index.

Example usage:

struct MyEntity {
int id{};
std::string name;
};
SQT_TABLE_BEGIN(MyEntityTable, MyEntity)
SQT_COLUMN_FIELD(Name, name)
// Define an unique index with the Name 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_INDEX_UNIQUE(...)
Defines an unique index with auto-generated names based on the specified columns.
Definition table_definition.h:805
See also
SQT_INDEX