A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/fnc12/sqlite_orm/wiki/make_table below:

make_table · fnc12/sqlite_orm Wiki · GitHub

template<class ...Cs>
internal::table<Cs...> make_table(const std::string &name, Cs ...args)

Create table result is used as make_storage function argument.

(1) name Table name from database.

(2) args Columns pack created with make_column.

internal::table_t<Cs...> instance.

struct Employee {
    int id;
    std::string name;
    int age;
    std::shared_ptr<std::string> address;   //  optional
    std::shared_ptr<double> salary; //  optional
};

using namespace sqlite_orm;
auto storage = make_storage("make_storage_example.sqlite",
                            make_table("COMPANY",
                                       make_column("ID", &Employee::id, primary_key()),
                                       make_column("NAME", &Employee::name),
                                       make_column("AGE", &Employee::age),
                                       make_column("ADDRESS", &Employee::address),
                                       make_column("SALARY", &Employee::salary)));

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4