Compare commits
5 Commits
e715879f43
...
sqlitetest
Author | SHA1 | Date | |
---|---|---|---|
270c358698 | |||
c90064c2ae | |||
92612eb4ef | |||
48eec85893 | |||
0c48596130 |
@ -2,18 +2,25 @@
|
||||
|
||||
2.Clearly declare "private" inside of class. For example:
|
||||
|
||||
use class item{
|
||||
use
|
||||
```c++
|
||||
class item{
|
||||
private:
|
||||
int price;
|
||||
public:
|
||||
getPrice();
|
||||
}
|
||||
```
|
||||
|
||||
instead of class item{
|
||||
int price
|
||||
instead of class
|
||||
|
||||
```c++
|
||||
class item{
|
||||
int price;
|
||||
public:
|
||||
getprice();
|
||||
getPrice();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
3.Declare inheritance type(public, private, protected) when using inheritance.
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Shoppe-Manne
|
||||
|
||||
Basic shop management system written in
|
||||
Basic shop management system written in c++
|
9711
headers/3rd-party/sqlite_orm.h
vendored
Normal file
9711
headers/3rd-party/sqlite_orm.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
31
main.cpp
31
main.cpp
@ -1,13 +1,34 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "headers/3rd-party/sqlite_orm.h"
|
||||
|
||||
class item{
|
||||
public:
|
||||
|
||||
private:
|
||||
using namespace sqlite_orm;
|
||||
|
||||
struct employee{
|
||||
int id;
|
||||
std::string first_name;
|
||||
std::string last_name;
|
||||
double salary;
|
||||
};
|
||||
|
||||
int main(){
|
||||
// class item{
|
||||
// public:
|
||||
|
||||
// private:
|
||||
// };
|
||||
|
||||
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;
|
||||
}
|
BIN
sqlite.db3
Normal file
BIN
sqlite.db3
Normal file
Binary file not shown.
Reference in New Issue
Block a user