diff --git a/main.cpp b/main.cpp index aae0203..c640a0f 100644 --- a/main.cpp +++ b/main.cpp @@ -11,15 +11,6 @@ struct employee{ 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: @@ -27,8 +18,17 @@ auto employees = make_storage("sqlite.db3", // }; int main(){ -employees.sync_schema(); -//std::cout << sqlitedb; -system("PAUSE"); -return 0; + 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(); + employees.replace(employee{0,"Sagar","Ramsaransingh",120000}); + system("PAUSE"); + return 0; } \ No newline at end of file diff --git a/sqlite.db3 b/sqlite.db3 new file mode 100644 index 0000000..9431acb Binary files /dev/null and b/sqlite.db3 differ