Shoppe-Manne/main.cpp

34 lines
994 B
C++
Raw Normal View History

2019-05-22 00:02:40 +00:00
#include <iostream>
#include <string>
2019-05-21 00:57:01 +00:00
#include "headers/3rd-party/sqlite_orm.h"
2019-05-20 22:46:21 +00:00
2019-05-22 00:02:40 +00:00
using namespace sqlite_orm;
2019-05-20 22:46:21 +00:00
2019-05-22 00:02:40 +00:00
struct employee{
int id;
std::string first_name;
std::string last_name;
double salary;
2019-05-20 22:46:21 +00:00
};
2019-05-22 00:02:40 +00:00
// class item{
// public:
// private:
// };
2019-05-20 22:46:21 +00:00
int main(){
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)
)
);
employees.sync_schema();
employees.remove_all<employee>();
employees.replace(employee{0,"Sagar","Ramsaransingh",120000});
system("PAUSE");
return 0;
2019-05-20 22:46:21 +00:00
}