Shoppe-Manne/main.cpp

41 lines
1.1 KiB
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
static inline std::string getPath(){
std::string filePath(__FILE__);
return filePath.substr( 0, filePath.length() - std::string("main.cpp").length());
}
static const std::string sqlitedb = getPath() + "/sqlite.db3";
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
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:
// };
2019-05-20 22:46:21 +00:00
int main(){
2019-05-22 00:02:40 +00:00
employees.sync_schema();
//std::cout << sqlitedb;
system("PAUSE");
2019-05-20 22:46:21 +00:00
return 0;
}