diff --git a/main.cpp b/main.cpp index 9b597af..355ab54 100644 --- a/main.cpp +++ b/main.cpp @@ -1,14 +1,41 @@ -#include +#include +#include #include "headers/3rd-party/sqlite_orm.h" -class item{ - public: - - private: +using namespace sqlite_orm; +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; }; +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(){ -std::cout << "Hello"; +employees.sync_schema(); +//std::cout << sqlitedb; +system("PAUSE"); return 0; } \ No newline at end of file