-
-
Notifications
You must be signed in to change notification settings - Fork 318
storage_t::pragma_t::user_version
Yevgeniy Zakharov edited this page Feb 7, 2018
·
1 revision
int user_version();
void user_version(int value);
Gets and sets user_version
PRAGMA value from sqlite database.
First overload returns PRAGMA user_version
.
Second overload returns nothing. It just calls PRAGMA user_version = %value%
.
struct Entry {
int id;
std::string uniqueColumn;
std::shared_ptr<std::string> nullableColumn;
};
auto storage = make_storage("unique.sqlite",
make_table("unique_test",
make_column("id",
&Entry::id,
primary_key(),
autoincrement()),
make_column("unique_text",
&Entry::uniqueColumn,
unique()),
make_column("nullable_text",
&Entry::nullableColumn)));
std::cout << "user version = " << storage.pragma.user_version() << std::endl;
storage.pragma.user_version(storage.pragma.user_version() + 1);
std::cout << "new user version = " << storage.pragma.user_version() << std::endl;