Compare commits
3 Commits
master
...
sqlitetest
Author | SHA1 | Date | |
---|---|---|---|
|
270c358698 | ||
|
c90064c2ae | ||
|
92612eb4ef |
30
main.cpp
30
main.cpp
@ -1,14 +1,34 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
#include "headers/3rd-party/sqlite_orm.h"
|
#include "headers/3rd-party/sqlite_orm.h"
|
||||||
|
|
||||||
class item{
|
using namespace sqlite_orm;
|
||||||
public:
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
struct employee{
|
||||||
|
int id;
|
||||||
|
std::string first_name;
|
||||||
|
std::string last_name;
|
||||||
|
double salary;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// class item{
|
||||||
|
// public:
|
||||||
|
|
||||||
|
// private:
|
||||||
|
// };
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
std::cout << "Hello";
|
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;
|
return 0;
|
||||||
}
|
}
|
BIN
sqlite.db3
Normal file
BIN
sqlite.db3
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user