34 lines
899 B
C++
34 lines
899 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include "headers/3rd-party/sqlite_orm.h"
|
|
|
|
using namespace sqlite_orm;
|
|
|
|
struct employee{
|
|
int id;
|
|
std::string first_name;
|
|
std::string last_name;
|
|
double salary;
|
|
};
|
|
|
|
auto employees = make_storage("sqlite.db3",
|
|
make_table("Employees",
|
|
make_column("id", &employee::id, autoincrement(), primary_key()),
|
|
make_column("first_name", &employee::first_name),
|
|
make_column("last_name", &employee::last_name),
|
|
make_column("salary", &employee::salary)
|
|
)
|
|
);
|
|
|
|
// class item{
|
|
// public:
|
|
|
|
// private:
|
|
// };
|
|
|
|
int main(){
|
|
employees.sync_schema();
|
|
//std::cout << sqlitedb;
|
|
system("PAUSE");
|
|
return 0;
|
|
} |