Skip to content

Commit a4c4e6b

Browse files
committed
Runner-up: Conformance fallback for NSMDI
Amends commit 7bb1a39
1 parent 785868c commit a4c4e6b

File tree

12 files changed

+130
-1
lines changed

12 files changed

+130
-1
lines changed

examples/blob_binding.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ struct Rect {
1515
int y = 0;
1616
int width = 0;
1717
int height = 0;
18+
19+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
20+
Rect() = default;
21+
Rect(int x, int y, int width, int height) : x{x}, y{y}, width{width}, height{height} {}
22+
#endif
1823
};
1924

2025
bool operator==(const Rect& lhs, const Rect& rhs) {
@@ -24,6 +29,11 @@ bool operator==(const Rect& lhs, const Rect& rhs) {
2429
struct Zone {
2530
int id = 0;
2631
Rect rect; // this member will be mapped as BLOB column
32+
33+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
34+
Zone() = default;
35+
Zone(int id, Rect rect) : id{id}, rect{rect} {}
36+
#endif
2737
};
2838

2939
bool operator==(const Zone& lhs, const Zone& rhs) {

examples/case.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ int main() {
1515
std::string name;
1616
std::string email;
1717
float marks = 0;
18+
19+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
20+
Student() {}
21+
Student(int id, std::string name, std::string email, float marks) :
22+
id{id}, name{move(name)}, email{move(email)}, marks{marks} {}
23+
#endif
1824
};
1925

2026
auto storage = make_storage({},

examples/check.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ int main() {
1313
std::string lastName;
1414
std::string email;
1515
std::string phone;
16+
17+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
18+
Contact() {}
19+
Contact(int id, std::string firstName, std::string lastName, std::string email, std::string phone) :
20+
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, email{move(email)}, phone{move(phone)} {}
21+
#endif
1622
};
1723

1824
struct Product {
1925
int id = 0;
2026
std::string name;
2127
float listPrice = 0;
2228
float discount = 0;
29+
30+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
31+
Product() {}
32+
Product(int id, std::string name, float listPrice, float discount) :
33+
id{id}, name{move(name)}, listPrice{listPrice}, discount{discount} {}
34+
#endif
2335
};
2436

2537
auto storage = make_storage(":memory:",

examples/column_aliases.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ void marvel_hero_ordered_by_o_pos() {
1313
std::string name;
1414
std::string abilities;
1515
short points = 0;
16+
17+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
18+
MarvelHero() {}
19+
MarvelHero(int id, std::string name, std::string abilities, short points) :
20+
id{id}, name{move(name)}, abilities{move(abilities)}, points{points} {}
21+
#endif
1622
};
1723

1824
auto storage = make_storage("",

examples/core_functions.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ struct MarvelHero {
1010
std::string name;
1111
std::string abilities;
1212
short points = 0;
13+
14+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
15+
MarvelHero() {}
16+
MarvelHero(int id, std::string name, std::string abilities, short points) :
17+
id{id}, name{move(name)}, abilities{move(abilities)}, points{points} {}
18+
#endif
1319
};
1420

1521
struct Contact {
1622
int id = 0;
1723
std::string firstName;
1824
std::string lastName;
1925
std::string phone;
26+
27+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
28+
Contact() {}
29+
Contact(int id, std::string firstName, std::string lastName, std::string phone) :
30+
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, phone{move(phone)} {}
31+
#endif
2032
};
2133

2234
struct Customer {
@@ -33,6 +45,27 @@ struct Customer {
3345
std::unique_ptr<std::string> fax;
3446
std::string email;
3547
int supportRepId = 0;
48+
49+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
50+
Customer() {}
51+
Customer(int id,
52+
std::string firstName,
53+
std::string lastName,
54+
std::string company,
55+
std::string address,
56+
std::string city,
57+
std::string state,
58+
std::string country,
59+
std::string postalCode,
60+
std::string phone,
61+
std::unique_ptr<std::string> fax,
62+
std::string email,
63+
int supportRepId) :
64+
id{id},
65+
firstName{move(firstName)}, lastName{move(lastName)}, company{move(company)}, address{move(address)},
66+
city{move(city)}, state{move(state)}, country{move(country)}, postalCode{move(postalCode)}, phone{move(phone)},
67+
fax{move(fax)}, email{move(email)}, supportRepId{supportRepId} {}
68+
#endif
3669
};
3770

3871
int main(int, char** argv) {

examples/custom_aliases.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,23 @@ struct Employee {
1717
int age = 0;
1818
std::string address;
1919
float salary = 0;
20+
21+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
22+
Employee() {}
23+
Employee(int id, std::string name, int age, std::string address, float salary) :
24+
id{id}, name{move(name)}, age{age}, address{move(address)}, salary{salary} {}
25+
#endif
2026
};
2127

2228
struct Department {
2329
int id = 0;
2430
std::string dept;
2531
int empId = 0;
32+
33+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
34+
Department() {}
35+
Department(int id, std::string dept, int empId) : id{id}, dept{move(dept)}, empId{empId} {}
36+
#endif
2637
};
2738

2839
using namespace sqlite_orm;

examples/except_intersection.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ using std::endl;
1111
struct DeptMaster {
1212
int deptId = 0;
1313
std::string deptName;
14+
15+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
16+
DeptMaster() = default;
17+
DeptMaster(int deptId, std::string deptName) : deptId{deptId}, deptName{move(deptName)} {}
18+
#endif
1419
};
1520

1621
struct EmpMaster {
@@ -19,6 +24,17 @@ struct EmpMaster {
1924
std::string lastName;
2025
long salary;
2126
decltype(DeptMaster::deptId) deptId;
27+
28+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
29+
EmpMaster() = default;
30+
EmpMaster(int empId,
31+
std::string firstName,
32+
std::string lastName,
33+
long salary,
34+
decltype(DeptMaster::deptId) deptId) :
35+
empId{empId},
36+
firstName{move(firstName)}, lastName{move(lastName)}, salary{salary}, deptId{deptId} {}
37+
#endif
2238
};
2339

2440
int main() {

examples/generated_column.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ int main() {
1818
int quantity = 0;
1919
float price = 0;
2020
float totalValue = 0;
21+
22+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
23+
Product() {}
24+
Product(int id, std::string name, int quantity, float price, float totalValue = 0.f) :
25+
id{id}, name{move(name)}, quantity{quantity}, price{price}, totalValue{totalValue} {}
26+
#endif
2127
};
2228
auto storage = make_storage({},
2329
make_table("products",

examples/prepared_statement.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,36 @@ struct Doctor {
1818
int doctor_id = 0;
1919
std::string doctor_name;
2020
std::string degree;
21+
22+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
23+
Doctor() = default;
24+
Doctor(int doctor_id, std::string doctor_name, std::string degree) :
25+
doctor_id{doctor_id}, doctor_name{move(doctor_name)}, degree{move(degree)} {}
26+
#endif
2127
};
2228

2329
struct Speciality {
2430
int spl_id = 0;
2531
std::string spl_descrip;
2632
int doctor_id = 0;
33+
34+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
35+
Speciality() = default;
36+
Speciality(int spl_id, std::string spl_descrip, int doctor_id) :
37+
spl_id{spl_id}, spl_descrip{move(spl_descrip)}, doctor_id{doctor_id} {}
38+
#endif
2739
};
2840

2941
struct Visit {
3042
int doctor_id = 0;
3143
std::string patient_name;
3244
std::string vdate;
45+
46+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
47+
Visit() = default;
48+
Visit(int doctor_id, std::string patient_name, std::string vdate) :
49+
doctor_id{doctor_id}, patient_name{move(patient_name)}, vdate{move(vdate)} {}
50+
#endif
3351
};
3452

3553
int main() {

examples/triggers.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ struct Lead {
1616
std::string lastName;
1717
std::string email;
1818
std::string phone;
19+
20+
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
21+
Lead() = default;
22+
Lead(int id, std::string firstName, std::string lastName, std::string email, std::string phone) :
23+
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, email{move(email)}, phone{move(phone)} {}
24+
#endif
1925
};
2026

2127
struct LeadLog {

0 commit comments

Comments
 (0)