Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c2290f84b | ||
|
|
efc8e4bbf9 | ||
|
|
5c986b142b | ||
|
|
4ec77f8d02 | ||
|
|
d7dfb4c2ed | ||
|
|
f4a32edbb9 | ||
|
|
8bb9ef0849 | ||
|
|
0210144ea9 | ||
|
|
2842bc92ca | ||
|
|
2ca857d895 | ||
|
|
95ec107134 | ||
|
|
18c65eecb6 | ||
|
|
3c1ab47843 | ||
|
|
6b706bbc85 | ||
|
|
e6435ade96 | ||
|
|
c854b5a88a | ||
|
|
f2d51d2feb | ||
|
|
95cd6f3c4f | ||
|
|
4a0d8602e2 | ||
|
|
a83f76be10 | ||
|
|
10420e6426 | ||
|
|
5ab90c1b6c | ||
|
|
5c70477a04 | ||
|
|
cb4a0f349e | ||
|
|
9a0db52c9b | ||
|
|
7cf7300129 | ||
|
|
6fbeed1a2a | ||
|
|
1defe3aaf1 | ||
|
|
074af18152 | ||
|
|
43c9aa3474 | ||
|
|
d95a76a47a | ||
|
|
ae8c1f11a9 | ||
|
|
4decdd7dea | ||
|
|
1d41807e25 | ||
|
|
571a70e073 | ||
|
|
2822c959f8 | ||
|
|
d8c5d85fcb | ||
|
|
3f493fa7a8 | ||
|
|
cecc3cffdc | ||
|
|
5ea0cf6cdd | ||
|
|
3ebbddb9f3 | ||
|
|
238f01725b | ||
|
|
51b975e872 | ||
|
|
4b9643daf2 | ||
|
|
6daf078fc3 | ||
|
|
7aced9b925 | ||
|
|
16fc88ba09 | ||
|
|
4ac7e3d15c | ||
|
|
48b8c1ee14 | ||
|
|
1af981255d | ||
|
|
6a07361614 | ||
|
|
f32f5e2d7b | ||
|
|
322959f1c4 | ||
|
|
eaca12aed1 | ||
|
|
96a8b46214 | ||
|
|
7f2f4fdfcc | ||
|
|
ceccbb38fb | ||
|
|
af21c82dd6 | ||
|
|
b2573a12bc | ||
|
|
d00de45e4f | ||
|
|
6512e7bf61 | ||
|
|
1cd88114ec | ||
|
|
86cf024a78 | ||
|
|
afdde192cd | ||
|
|
0b321dfedf | ||
|
|
7617bb258d | ||
|
|
104466170b | ||
|
|
4b5a1340aa | ||
|
|
6ea56060a2 | ||
|
|
3733648598 | ||
|
|
40341d4e98 | ||
|
|
5393d97033 | ||
|
|
8bf9e5e30f | ||
|
|
bc5ba1fda5 | ||
|
|
034cf065c1 | ||
|
|
d7743d0a56 | ||
|
|
5ed0a4a6ed | ||
|
|
dd2e8bb063 | ||
|
|
790b678c74 | ||
|
|
abb50a0786 | ||
|
|
2862edcea8 | ||
|
|
91c17aca41 | ||
|
|
fc546e25e2 | ||
|
|
a5b6a0a51f | ||
|
|
befeb07234 | ||
|
|
8fe3d41d18 | ||
|
|
9628eaffb9 | ||
|
|
7be7e1cade | ||
|
|
db54c567de | ||
|
|
db6ea3b85e | ||
|
|
33f3e868da | ||
|
|
d4e380c35b | ||
|
|
0dd78f1580 | ||
|
|
267bfb29fe | ||
|
|
4e551c8c6e | ||
|
|
554a84cf28 | ||
|
|
2cfd51401a | ||
|
|
948f9d3f22 | ||
|
|
728efd3d67 | ||
|
|
1b0dd4ae25 | ||
|
|
e1b91e0642 | ||
|
|
74b71b024b | ||
|
|
c86d2d654f | ||
|
|
ff6bdc38ef | ||
|
|
ef5b284f11 | ||
|
|
836efb120f | ||
|
|
3a76b84eae | ||
|
|
ae17e9f893 | ||
|
|
6ea1e6aeaf | ||
|
|
ed32e44bc2 | ||
|
|
60a9494434 | ||
|
|
51991213ef | ||
|
|
dc16fae72e | ||
|
|
b485d4d3dc | ||
|
|
7634d3f950 | ||
|
|
6abbf82a89 | ||
|
|
2de9b2d9ed | ||
|
|
cc0611847d | ||
|
|
c844438dd6 | ||
|
|
0d6f68646c | ||
|
|
af55215356 | ||
|
|
f4f44c51d9 | ||
|
|
77a1becba1 | ||
|
|
5546961c8c | ||
|
|
d09571c0ad | ||
|
|
9b15011f17 | ||
|
|
e72007c1dd | ||
|
|
ab502baa20 | ||
|
|
eb0e0d4cdd | ||
|
|
c8818c1d44 | ||
|
|
1ff825c861 | ||
|
|
13946f1d8d | ||
|
|
6a68e31903 | ||
|
|
618be9b5e4 | ||
|
|
4a6a2c5495 | ||
|
|
6082fc4e54 | ||
|
|
4e8d129162 | ||
|
|
472b5bc604 | ||
|
|
cad788e59e | ||
|
|
2cb4cf51c3 | ||
|
|
5eff2448bb | ||
|
|
aabf6e6247 | ||
|
|
23c93eebdf | ||
|
|
732ec36b67 | ||
|
|
f1196bf924 | ||
|
|
fcd6a453f0 | ||
|
|
85af2deced | ||
|
|
b70f85d94b | ||
|
|
b715206502 | ||
|
|
18885d4ca1 | ||
|
|
555ed025bc | ||
|
|
d0e4d536d9 | ||
|
|
8c225105c2 | ||
|
|
c36539adb3 | ||
|
|
b636c391df | ||
|
|
659af2cd2a | ||
|
|
f70e2b4e37 | ||
|
|
b16e12cb6e | ||
|
|
df5c62d2d9 | ||
|
|
b89d11f8ec | ||
|
|
992f2a2d83 | ||
|
|
f94cecb329 | ||
|
|
89c117425e | ||
|
|
26c7441b49 | ||
|
|
a6d80ce208 | ||
|
|
c287449258 | ||
|
|
f9c98b4a1f | ||
|
|
86cfee4e23 | ||
|
|
a3351513ce | ||
|
|
95be9b7bb6 | ||
|
|
1c2dd8617b | ||
|
|
7f71174159 | ||
|
|
098ddf27ec | ||
|
|
bbce741688 | ||
|
|
c56382f04a | ||
|
|
71841f0a07 | ||
|
|
e43fae2a63 | ||
|
|
022a06b4bc | ||
|
|
7df77aa2d0 | ||
|
|
f18bcb67e4 | ||
|
|
cc68ef5872 | ||
|
|
5b3eee53c2 | ||
|
|
63255cabf8 | ||
|
|
9d1bcec132 | ||
|
|
b60f39e7cc | ||
|
|
5464d64180 | ||
|
|
1e2d07a16f | ||
|
|
66b23d423f | ||
|
|
3094c274df | ||
|
|
378279ee1a | ||
|
|
e509d7af65 | ||
|
|
9da4bc09c3 | ||
|
|
462461c1c9 | ||
|
|
7ded56dfc4 | ||
|
|
836a0a5e37 | ||
|
|
91dd13e2be | ||
|
|
a1f0f2c9b7 | ||
|
|
6f409f2140 | ||
|
|
64776682fe | ||
|
|
a21e6575d8 | ||
|
|
4ee6f3293a | ||
|
|
17b884b3dc | ||
|
|
0f6d36bfc2 | ||
|
|
0dc9215df6 | ||
|
|
333ffc1ebe | ||
|
|
181c930e39 | ||
|
|
65337e74d9 | ||
|
|
69c116507b | ||
|
|
2b82de42d8 | ||
|
|
10dfa3fba9 | ||
|
|
339062f01f | ||
|
|
eb2346dfce | ||
|
|
1d0adaacf6 | ||
|
|
5e8f95ca09 | ||
|
|
b085a29c8c | ||
|
|
992e8f3423 | ||
|
|
49e6923156 | ||
|
|
a7a4858364 | ||
|
|
3a38cbe87f | ||
|
|
2c42d0129c | ||
|
|
da5ef961d6 | ||
|
|
d35373dcdf | ||
|
|
adc6ba1226 | ||
|
|
b1d162c14e | ||
|
|
2b6c3fb868 | ||
|
|
a70b42cbf5 | ||
|
|
06000abbfd | ||
|
|
67bc47c3b5 | ||
|
|
5c34ab19e2 | ||
|
|
6d14f792e6 | ||
|
|
1238843a44 | ||
|
|
8000332ec4 | ||
|
|
9896607dff | ||
|
|
1be0a6cd5c | ||
|
|
0191676063 | ||
|
|
c16da693df | ||
|
|
f31dd0033c | ||
|
|
b7b89c5fa9 | ||
|
|
c776ee8d47 | ||
|
|
c36fc2813b | ||
|
|
ec2640a459 | ||
|
|
755782759a | ||
|
|
9275d4ddf8 | ||
|
|
96951b3d4e | ||
|
|
36a8cd1352 | ||
|
|
2bb9f5ce0d | ||
|
|
e1d3c1d7dc | ||
|
|
00a7eb53e8 | ||
|
|
e7dcf25063 | ||
|
|
d2b7b4240a | ||
|
|
b6ef89c116 | ||
|
|
2a917823ed | ||
|
|
2135f8e768 | ||
|
|
2c45ecf56c | ||
|
|
52f831936e | ||
|
|
28f6b64f67 | ||
|
|
cc0365d794 | ||
|
|
59ad47d640 | ||
|
|
27662f99b0 | ||
|
|
4c5c2dfb6c | ||
|
|
517a7b2984 | ||
|
|
10bb596b7c | ||
|
|
6913f1e39b | ||
|
|
fe8e32586b | ||
|
|
e0c91ed2ee | ||
|
|
428433672c | ||
|
|
f71a2f7cd8 | ||
|
|
102b037c7d | ||
|
|
46c3839ea0 | ||
|
|
2c51c04708 | ||
|
|
d0a7a49c19 | ||
|
|
0024a4e654 | ||
|
|
d66a3f4ab3 | ||
|
|
645aa1d67b | ||
|
|
06db4af649 | ||
|
|
baf1ef32d1 | ||
|
|
d5638f8e53 | ||
|
|
c65b5b28b9 | ||
|
|
1301e16f6e | ||
|
|
caa382f41b | ||
|
|
24fd69a9be | ||
|
|
2389ec691b | ||
|
|
b8dd2ce2f4 | ||
|
|
5114cc4d6d | ||
|
|
57036c4470 | ||
|
|
81166432a8 | ||
|
|
5dc8502c8b | ||
|
|
67e10926db | ||
|
|
e971e210a3 | ||
|
|
f7e6169c23 | ||
|
|
6fc4e31dfb | ||
|
|
dfc22bdf00 | ||
|
|
54b5f47ffa | ||
|
|
62a4251f90 | ||
|
|
a41c12252a | ||
|
|
e7cf816062 | ||
|
|
ff28cadd57 | ||
|
|
9039b18b84 | ||
|
|
480381deb5 | ||
|
|
84dbace4af | ||
|
|
44f80f4c7c | ||
|
|
1cb9e52123 | ||
|
|
4d7ddb9c26 | ||
|
|
1b29d7eca3 | ||
|
|
5c779b11db | ||
|
|
dc344c07de | ||
|
|
b7b3c3ab32 | ||
|
|
6fa20284ec | ||
|
|
978b570826 | ||
|
|
688e393ed1 | ||
|
|
8ede868068 | ||
|
|
667d42eeb4 | ||
|
|
1f87d5a375 | ||
|
|
4f0a6cf9e1 | ||
|
|
3318858b80 | ||
|
|
9c6f19f55f | ||
|
|
48ee93c244 | ||
|
|
ee4197bcc0 | ||
|
|
079c476148 | ||
|
|
aa909b7635 | ||
|
|
9167ebda98 | ||
|
|
38682c69da | ||
|
|
2a7f41c494 | ||
|
|
071bbc7905 | ||
|
|
ca18f509e7 | ||
|
|
5e2bb1d57a | ||
|
|
dd2950e4ca | ||
|
|
34f3097616 | ||
|
|
948e91126a | ||
|
|
85b781bf0e | ||
|
|
bd853a8bc0 | ||
|
|
bfc76b96f3 | ||
|
|
99ea59ee06 | ||
|
|
f8a0e8e4b5 | ||
|
|
14e32a2bd1 | ||
|
|
f84e25f929 | ||
|
|
6884bf10b0 | ||
|
|
8803eafe31 | ||
|
|
9909ca4c96 | ||
|
|
5d36d5735d | ||
|
|
ef368a2bc2 | ||
|
|
8433b09650 | ||
|
|
d2eb92d1a2 | ||
|
|
ba98aab046 | ||
|
|
00d15339b6 | ||
|
|
1ea4a44bb8 | ||
|
|
5119c065bd | ||
|
|
8be6aa7358 | ||
|
|
438f99deff | ||
|
|
c556c056d8 | ||
|
|
613baf30f9 | ||
|
|
0ac7e2d299 | ||
|
|
929465eb52 | ||
|
|
13de0a5cce | ||
|
|
c12f42b385 | ||
|
|
2ccd01299c | ||
|
|
fb2efb8df9 | ||
|
|
795daf284f | ||
|
|
354b815835 | ||
|
|
7d8e20685d | ||
|
|
5050c36c4e | ||
|
|
6348c6f151 | ||
|
|
8cb468cf05 | ||
|
|
55c9e48a21 | ||
|
|
db3ae357ea | ||
|
|
f62b952d70 | ||
|
|
bf1c025612 | ||
|
|
ba253dcbf2 | ||
|
|
1829706faa | ||
|
|
f9f16df065 | ||
|
|
66173b345f | ||
|
|
ac54c808c5 | ||
|
|
7761b137ba | ||
|
|
3d144b9e5d | ||
|
|
b2f5d425b6 | ||
|
|
64028e03dc | ||
|
|
e52047d82e | ||
|
|
5adbd9b3e3 | ||
|
|
fd21f97007 | ||
|
|
d74c5264d3 | ||
|
|
654611c365 | ||
|
|
18e09ec061 | ||
|
|
8e2fb1fb22 | ||
|
|
7a2c1413fe | ||
|
|
3c38aa1996 | ||
|
|
886f75bbea | ||
|
|
5820b30cc6 | ||
|
|
ce4bfb9df6 | ||
|
|
be787d3e8a | ||
|
|
ededd8668a | ||
|
|
7b788e3988 | ||
|
|
0eb854cebd | ||
|
|
9529939262 | ||
|
|
6ee7db48c8 | ||
|
|
8cc82ae2b7 | ||
|
|
474c2c3a76 | ||
|
|
843624044c | ||
|
|
454b9d5546 | ||
|
|
c532b8709c | ||
|
|
bf1d6038e1 | ||
|
|
86b9616dd7 | ||
|
|
bc993f63f5 | ||
|
|
531d732437 | ||
|
|
24f9b2c01b | ||
|
|
c4991176f4 | ||
|
|
0ea70d6bfc | ||
|
|
845ae7e0e4 | ||
|
|
dc8d74b609 | ||
|
|
2f54eda08a | ||
|
|
a526351b4c | ||
|
|
d08d3b311f | ||
|
|
25baecdc39 | ||
|
|
e2816905bb | ||
|
|
ee2d8eae50 | ||
|
|
1823e11090 | ||
|
|
294ed772c1 | ||
|
|
62f33e1d55 | ||
|
|
e3f1992536 | ||
|
|
baf3a8ec26 | ||
|
|
a9ca4450f8 | ||
|
|
54ceba6dfa | ||
|
|
fc64d868ef | ||
|
|
45fdb50dc2 | ||
|
|
e704ffeba1 | ||
|
|
2fb2cee5db | ||
|
|
3fa8c15c33 | ||
|
|
70b70a069a | ||
|
|
f16dcc56ae | ||
|
|
4bf21cc5ce | ||
|
|
b9bb514709 | ||
|
|
67db8a0f3e | ||
|
|
606cc2cb37 | ||
|
|
bed1f28b30 | ||
|
|
5c6130fbed | ||
|
|
c1079ac1a9 | ||
|
|
ef7d2e06f6 | ||
|
|
08d235bdc3 | ||
|
|
ac8af6bbf0 | ||
|
|
1729c0b967 | ||
|
|
b02b995b76 | ||
|
|
7f229468d2 | ||
|
|
ebae30342b | ||
|
|
07092169bf | ||
|
|
838a03c0ef | ||
|
|
4565c1fff9 | ||
|
|
519410fc3a | ||
|
|
9743c89c56 | ||
|
|
94d1134ec2 | ||
|
|
df92e350c0 | ||
|
|
065913f6ab | ||
|
|
a75a7b82ce | ||
|
|
90e7449d6a | ||
|
|
f9bd457cbd | ||
|
|
2f6f8f88f8 | ||
|
|
604ac92a6d | ||
|
|
4718de0f6c | ||
|
|
002287ca28 | ||
|
|
31e8d926a8 | ||
|
|
99ed742555 | ||
|
|
67d3fa1e68 | ||
|
|
8a8518a961 | ||
|
|
ae41859bbb | ||
|
|
813950f832 | ||
|
|
cce8c832c7 | ||
|
|
fc3e64989d | ||
|
|
d05f11293e | ||
|
|
b36a92c853 | ||
|
|
995d90ae86 | ||
|
|
229fb36074 | ||
|
|
68785d1c2d | ||
|
|
ed7faa3714 | ||
|
|
90f2642ec6 | ||
|
|
4c3029e5c1 | ||
|
|
46e9e28a3f | ||
|
|
effdc8df6c | ||
|
|
268a45a635 | ||
|
|
97cb1d595e | ||
|
|
a328faa834 | ||
|
|
2201026ce8 | ||
|
|
bd4a76d5de | ||
|
|
63d5fb1d2b | ||
|
|
cea8c1708f | ||
|
|
ad7b044e20 | ||
|
|
1123fdbb23 | ||
|
|
baa86102ff | ||
|
|
0d514b56f6 | ||
|
|
138cc752a6 | ||
|
|
924a596873 | ||
|
|
4266b1fb45 | ||
|
|
f58c7f6701 | ||
|
|
a9b02a2d2e | ||
|
|
74459be4f7 | ||
|
|
bcf912079b | ||
|
|
2a640823c7 | ||
|
|
9e77083d40 | ||
|
|
e4fbeb1c81 | ||
|
|
733b405f79 | ||
|
|
66f0314542 | ||
|
|
039f2661b6 | ||
|
|
48bc859801 | ||
|
|
672e10a0ff | ||
|
|
0fe7b2985b | ||
|
|
9b24c8213e | ||
|
|
a193ac1474 | ||
|
|
7066980f7b | ||
|
|
f27a297e95 | ||
|
|
11fcb4c749 | ||
|
|
22bb800f2e | ||
|
|
a0ce362197 | ||
|
|
329b010bfa | ||
|
|
6470141f17 | ||
|
|
994893951d | ||
|
|
4573e80e1c | ||
|
|
4cdb71bfda | ||
|
|
7820b59996 | ||
|
|
8be9acf9a6 | ||
|
|
3a4ab7a6aa | ||
|
|
115f293e26 | ||
|
|
4e8b231c42 | ||
|
|
54adc18988 | ||
|
|
e7b17ea0a9 | ||
|
|
0e12a9acba | ||
|
|
099d5a311e | ||
|
|
d199f0da83 | ||
|
|
9e37b6b68e | ||
|
|
006492a02c | ||
|
|
07de1d0105 | ||
|
|
42cd8881a2 | ||
|
|
5c4b282e27 | ||
|
|
7e7c232fc0 | ||
|
|
2c90820f0f | ||
|
|
dd76cdffec | ||
|
|
276c6a4acf | ||
|
|
f97e0cc540 | ||
|
|
0fedc0cdbb | ||
|
|
0390c3ae93 | ||
|
|
4cdb45e012 | ||
|
|
4e182a511f | ||
|
|
a4443b8ebb | ||
|
|
0f55f76caa | ||
|
|
e3e1feee2b | ||
|
|
1a1c0cd3d1 | ||
|
|
dd63ddf7f2 | ||
|
|
c4ab23761e | ||
|
|
86a8439473 | ||
|
|
47cf3b0108 | ||
|
|
ab97ceb784 | ||
|
|
ae7cdb1f5b | ||
|
|
c0cf3c0525 | ||
|
|
82feed42c2 | ||
|
|
5c697659b4 | ||
|
|
efc12c2ef9 | ||
|
|
280c9f0155 | ||
|
|
9608b5edd5 | ||
|
|
7662e53dce | ||
|
|
1f5cc801e1 | ||
|
|
2c6ca91985 | ||
|
|
023a04aff9 | ||
|
|
ffe40dbf79 | ||
|
|
cf9b9206bd | ||
|
|
0f70af7a22 | ||
|
|
7068a4f149 | ||
|
|
70714768d9 | ||
|
|
ec0e8672be | ||
|
|
9215f88e7f | ||
|
|
510daa84a7 | ||
|
|
eacf48fef3 | ||
|
|
0dee6425d1 | ||
|
|
842846dbc4 | ||
|
|
8b800ecbe1 | ||
|
|
f1e65fbb2c | ||
|
|
372996deb3 | ||
|
|
45f5ece534 | ||
|
|
a95b3264de | ||
|
|
8d44ad7256 | ||
|
|
a136384c7d | ||
|
|
b15999e4c9 | ||
|
|
e8235f8d6a | ||
|
|
e31f7a4763 | ||
|
|
3103e6e373 | ||
|
|
3a42a4bf9f | ||
|
|
3e5a21b49b | ||
|
|
6f3ec89bcd | ||
|
|
56f6984f9d | ||
|
|
5f88a400d5 | ||
|
|
91ed7d762b | ||
|
|
668c1d632e | ||
|
|
20f693c508 | ||
|
|
f67f9ebd4b | ||
|
|
53dade2740 | ||
|
|
9ec9880889 | ||
|
|
eb27b0cfc5 | ||
|
|
d3cc23d5a3 | ||
|
|
e129463bae | ||
|
|
b567d64489 | ||
|
|
d94fcc398b | ||
|
|
3c48a434f1 | ||
|
|
d04dda1888 | ||
|
|
842c6ced0c | ||
|
|
59c5d2e43b | ||
|
|
2aeddda77d | ||
|
|
9aeccce227 | ||
|
|
45e5333c2c | ||
|
|
f4581b993b | ||
|
|
d2b1853b7b | ||
|
|
800b9ffc3d | ||
|
|
a93f75a6fc | ||
|
|
04df4ba157 | ||
|
|
d55e16de3c | ||
|
|
780ba744f1 | ||
|
|
8027925ae6 | ||
|
|
b29695b024 | ||
|
|
d98904727f | ||
|
|
4cd421ff7c | ||
|
|
a8b58cb7e7 | ||
|
|
578fa162f1 | ||
|
|
7333b1a080 | ||
|
|
961e5e46c1 | ||
|
|
a2dce4a238 | ||
|
|
996c1c994f | ||
|
|
9540df84cf | ||
|
|
b47680638d | ||
|
|
5f7a9de8a5 | ||
|
|
b80814a77e | ||
|
|
b95d7cb647 | ||
|
|
3e25faabba | ||
|
|
2677cf8de8 | ||
|
|
81213f2649 | ||
|
|
30f619ca2c | ||
|
|
9552a5ce40 | ||
|
|
318564a13c | ||
|
|
9ee3fd38b5 | ||
|
|
03a66af35e | ||
|
|
00c2f61535 | ||
|
|
289394c7ac | ||
|
|
a5de2b9288 | ||
|
|
e0266bdde3 | ||
|
|
e82ecfee9f | ||
|
|
80f0379d71 | ||
|
|
449c0e37b1 | ||
|
|
f825c52ecf | ||
|
|
4c2042c3ce | ||
|
|
af0946fd21 | ||
|
|
2bb53026ef | ||
|
|
0929fe72b8 | ||
|
|
e0a40776ee | ||
|
|
e99015bcff | ||
|
|
abd7ee9f17 | ||
|
|
364c624a37 | ||
|
|
00e10324d8 | ||
|
|
0539c41d17 | ||
|
|
212a6f7e53 | ||
|
|
cff769ddd5 | ||
|
|
ed6ad9d373 | ||
|
|
44772f89d7 | ||
|
|
2aa61c3403 | ||
|
|
3fea5db763 | ||
|
|
b2bc0e7941 | ||
|
|
c7d98e0231 | ||
|
|
6fcf4f565a | ||
|
|
8c11a751ff | ||
|
|
c0217d56ca | ||
|
|
89ba8c3398 | ||
|
|
d814ab216d | ||
|
|
284ec22dd5 | ||
|
|
57e5735e9a | ||
|
|
5786d19ff4 | ||
|
|
c73872549a | ||
|
|
f799d5f30c | ||
|
|
e94be4a06e | ||
|
|
e9a68d82e6 | ||
|
|
b16a0da88c | ||
|
|
a318d4cc82 | ||
|
|
4f500de04b | ||
|
|
a77b195c7c | ||
|
|
d2928a9929 | ||
|
|
476e72cca2 | ||
|
|
375ed0135c | ||
|
|
17e745f52b | ||
|
|
a3cc5745ac | ||
|
|
8a595be54f | ||
|
|
68203b5373 | ||
|
|
a79fc34071 | ||
|
|
7f66f41026 | ||
|
|
956f419b20 | ||
|
|
e414aca05b | ||
|
|
76e0a9f6b6 | ||
|
|
94b4131ce4 | ||
|
|
a26901cb80 | ||
|
|
a4d7f39ad8 | ||
|
|
6f02a90a7a | ||
|
|
ae3c06f761 | ||
|
|
f29a98aac3 | ||
|
|
a641b1efd4 | ||
|
|
fc6c46e628 | ||
|
|
cb8c9f5ba3 | ||
|
|
a8122b44f1 | ||
|
|
6b86e61056 | ||
|
|
97bbb5bced | ||
|
|
b3b155459f | ||
|
|
e4803c1e0c | ||
|
|
db7fb96142 | ||
|
|
3eb7d57754 | ||
|
|
7af96a69a0 | ||
|
|
00e6d4ed0e | ||
|
|
f4b2c2d40a | ||
|
|
75e9056ac8 | ||
|
|
a69be48066 | ||
|
|
420fb93356 | ||
|
|
425e506862 | ||
|
|
f09a62415d | ||
|
|
90028ee9f5 | ||
|
|
e37d2ae18c | ||
|
|
0322537b63 | ||
|
|
7b6bd84ac2 | ||
|
|
6a98a46c85 | ||
|
|
0ab974e1b7 | ||
|
|
85b84f217d | ||
|
|
5e9cbf41a5 | ||
|
|
773db56d79 | ||
|
|
f68cbb03ee | ||
|
|
15f1e5259d | ||
|
|
7ede3edf0c | ||
|
|
14d16ffd20 | ||
|
|
a7df6cc7df | ||
|
|
aaa5986e33 | ||
|
|
3173dd20fe | ||
|
|
a29ca8348f | ||
|
|
278e72ecc8 | ||
|
|
cf738588f2 | ||
|
|
146b06f27a | ||
|
|
fa4a90f720 | ||
|
|
93f4d43ee6 | ||
|
|
da4b96c2ca | ||
|
|
420a257650 | ||
|
|
39f327fcb3 | ||
|
|
27ffb2a418 | ||
|
|
0dc18cdaab | ||
|
|
1ac9051384 | ||
|
|
691bb73d3e | ||
|
|
61d7740767 | ||
|
|
7f7554f601 | ||
|
|
ee68550052 | ||
|
|
4de63ca9a2 | ||
|
|
ef42035fe4 | ||
|
|
eb93b25301 | ||
|
|
2502747a7b | ||
|
|
de5477d8f0 | ||
|
|
fae562f20d | ||
|
|
307c3d5a13 | ||
|
|
7a1afba26e | ||
|
|
b2370dd597 | ||
|
|
513b7e9379 | ||
|
|
9392722bab | ||
|
|
321b6a3488 | ||
|
|
443d44cc7a | ||
|
|
df2cc0af36 | ||
|
|
dfcc6f99a5 | ||
|
|
664c1ed281 | ||
|
|
057679a2ba | ||
|
|
e05b8b2b47 | ||
|
|
d67f4802d3 | ||
|
|
72e4fc620b | ||
|
|
9c53ed94a7 | ||
|
|
cac605749d | ||
|
|
9006c701b3 | ||
|
|
05c001865b | ||
|
|
cb7a7633b1 | ||
|
|
1e92b98165 | ||
|
|
0bf23477f8 | ||
|
|
359df39b7e | ||
|
|
cfd4141469 | ||
|
|
90415fa936 | ||
|
|
1d89d184fd | ||
|
|
026e5b288f | ||
|
|
be249bc697 | ||
|
|
69641ff7d6 | ||
|
|
4245e8f09e | ||
|
|
94fed7965b | ||
|
|
a15233eff1 | ||
|
|
e47a584c3e | ||
|
|
188f51c513 | ||
|
|
e800c71cbc | ||
|
|
3d86f45aa2 | ||
|
|
473bc3a88e | ||
|
|
4b9336f5c5 | ||
|
|
8bcf9257f6 | ||
|
|
ca59d706e9 | ||
|
|
82ff6cb4c5 | ||
|
|
21552d8838 | ||
|
|
26f40efece | ||
|
|
c82dbb35ad | ||
|
|
84ca69d27c | ||
|
|
6dca9e1068 | ||
|
|
8cb75dd814 | ||
|
|
59e81f70bd | ||
|
|
399766fe10 | ||
|
|
f543784241 | ||
|
|
0b0f0e53da | ||
|
|
f738fdfa8e | ||
|
|
a8f7978ec4 | ||
|
|
d1af9dbdf1 | ||
|
|
d0ba9e342c | ||
|
|
b38ccb5f40 | ||
|
|
605aad79ad | ||
|
|
6fd3a7b225 | ||
|
|
6b1910fce7 | ||
|
|
5ee47c3c27 | ||
|
|
5652a01366 | ||
|
|
132d01f9f7 | ||
|
|
1d760ff9ce | ||
|
|
dc4d516493 | ||
|
|
62c6187ad4 | ||
|
|
18154f29be | ||
|
|
a715c6328d | ||
|
|
bffe4d32f5 | ||
|
|
3fd00012d1 | ||
|
|
6d901b06e9 | ||
|
|
f677310703 | ||
|
|
0200f64e6c | ||
|
|
c6b5c935bb | ||
|
|
2d30f06f54 | ||
|
|
a98350d206 | ||
|
|
6918bda82d | ||
|
|
a065926fb1 | ||
|
|
0569b95a5a | ||
|
|
d17866d3fd | ||
|
|
6c0f1dc389 | ||
|
|
e7750e6fe0 | ||
|
|
e4addc4243 | ||
|
|
d35ad59f9c | ||
|
|
07609e8a3f | ||
|
|
f4e2645e13 | ||
|
|
c352ca70b2 | ||
|
|
b182a26759 | ||
|
|
c493b17232 | ||
|
|
94d34a744d | ||
|
|
0cda88bd28 | ||
|
|
c62ccf1de7 | ||
|
|
5760b9c0cc | ||
|
|
75525bdb56 | ||
|
|
2fa57cdafa | ||
|
|
2319572552 | ||
|
|
5f26a71c5b | ||
|
|
d0558ee2f0 | ||
|
|
fc09fd6654 | ||
|
|
1ea5d1713a | ||
|
|
aa0ae00c56 | ||
|
|
0372c1dd63 | ||
|
|
c052b44999 | ||
|
|
f27d6b07c0 | ||
|
|
4f8b681737 | ||
|
|
5b9ae9371b | ||
|
|
68f4db468a | ||
|
|
62dbc78090 | ||
|
|
bd7bec22a1 | ||
|
|
722e74db6a | ||
|
|
e9439a1d58 | ||
|
|
3c70814cdc | ||
|
|
fea89100d9 | ||
|
|
2c3d0b1e17 | ||
|
|
478ae7bc24 | ||
|
|
da81c8b87c | ||
|
|
4088a477ec | ||
|
|
85dcd32c8d | ||
|
|
62c72c20e9 | ||
|
|
1b4e26f61c | ||
|
|
474310e00b | ||
|
|
7a475ad476 | ||
|
|
65ac210dfb | ||
|
|
f19e5bf67c | ||
|
|
419bedd73b | ||
|
|
8eb58926a4 | ||
|
|
ccacbc9706 | ||
|
|
7db59867cb | ||
|
|
37aa7feee9 | ||
|
|
e49800d21d | ||
|
|
078aa83e3b | ||
|
|
8ef4c9b241 | ||
|
|
f9157da590 | ||
|
|
27120643b9 | ||
|
|
306033b63b | ||
|
|
d988be49a6 | ||
|
|
1a5661c890 | ||
|
|
ccaad8d860 | ||
|
|
c9d95af646 | ||
|
|
3e081f0dd6 | ||
|
|
444525d748 | ||
|
|
c778e1ac0c | ||
|
|
bfe037c61d | ||
|
|
e2790c863f | ||
|
|
3c3df9ad24 | ||
|
|
3c30e6d0c1 | ||
|
|
a5ad4dd23d | ||
|
|
0505b1cef9 | ||
|
|
2ac6f9766a | ||
|
|
10fcd1092f | ||
|
|
cbcbbe9c8f | ||
|
|
2b7b03846e | ||
|
|
05f9854cea | ||
|
|
8cb67f1c22 | ||
|
|
48987f39c3 | ||
|
|
e5f711f68c | ||
|
|
ac92fc95e3 | ||
|
|
ed15498871 | ||
|
|
97a05b97d9 | ||
|
|
0b69aa82fd | ||
|
|
bf07c49171 | ||
|
|
c59d42dfca | ||
|
|
80b15f7f07 | ||
|
|
9647a78ed6 | ||
|
|
2c743531d0 | ||
|
|
9e967ccc93 | ||
|
|
86330000db | ||
|
|
af597736f6 | ||
|
|
119ce30ad1 | ||
|
|
85c3f12b86 | ||
|
|
f95e01cbd5 | ||
|
|
21eb87fa49 | ||
|
|
4614cfda06 | ||
|
|
a4bda6da96 | ||
|
|
2d2b8494d0 | ||
|
|
7ce6a8a094 | ||
|
|
3756c43691 | ||
|
|
bfc4738097 | ||
|
|
afcb9183ad | ||
|
|
c3474471f7 | ||
|
|
65c009a018 | ||
|
|
d60fe3c22f | ||
|
|
5727163966 | ||
|
|
d72000c6a3 | ||
|
|
381f716e4b | ||
|
|
eee2c65c14 | ||
|
|
c01c4d6de5 | ||
|
|
f4c763dc31 | ||
|
|
66989f2ff7 | ||
|
|
73aada9194 | ||
|
|
5665a2428a | ||
|
|
ba0c771346 | ||
|
|
66dc482b02 | ||
|
|
3c20adb0c6 | ||
|
|
1bffc4f628 | ||
|
|
97a84c6470 | ||
|
|
70c6f3ec44 | ||
|
|
ccd73bf63d | ||
|
|
d4327faf0a | ||
|
|
87b54f5da2 | ||
|
|
a28ae9a523 | ||
|
|
055a4882f8 | ||
|
|
90d5316781 | ||
|
|
303a0cc150 | ||
|
|
08ef740002 | ||
|
|
5d196c449d | ||
|
|
fdb2f63e60 | ||
|
|
c83d390e60 | ||
|
|
a6ac69eded | ||
|
|
1914ace5f9 | ||
|
|
88ddce5fac | ||
|
|
23d428290b | ||
|
|
ff104686f6 | ||
|
|
a9ea6dd8bf | ||
|
|
9866ed1dfc | ||
|
|
65a347fd98 | ||
|
|
7e50869d39 | ||
|
|
703ce643b5 | ||
|
|
42d2891df8 | ||
|
|
f0effaa4fa | ||
|
|
022fee8788 | ||
|
|
25a2bd653c | ||
|
|
c03de9cc16 | ||
|
|
97d06a0fae | ||
|
|
154125d3ae | ||
|
|
c4b7e0017b | ||
|
|
469814985e | ||
|
|
f16105ad03 | ||
|
|
4309eaba64 | ||
|
|
1580be3883 | ||
|
|
b4b5d9b602 | ||
|
|
27dd08f945 | ||
|
|
b9c4d26731 | ||
|
|
7217f696b6 | ||
|
|
880f8c8bdd | ||
|
|
6f7efa2b9a | ||
|
|
3a11d94bee | ||
|
|
e68bd077ee | ||
|
|
e84e984c23 | ||
|
|
12de05dc9b | ||
|
|
ea8110110c | ||
|
|
79d6b02a2f | ||
|
|
1195439226 | ||
|
|
ff2629a31c | ||
|
|
61e74f9ad4 | ||
|
|
f711978145 | ||
|
|
a647e200d9 | ||
|
|
294a04e9f6 | ||
|
|
9792edc008 | ||
|
|
143f3d1673 | ||
|
|
121f7be847 | ||
|
|
4af7fda4f2 | ||
|
|
56f332122d | ||
|
|
d494d12293 | ||
|
|
ce6afd680d | ||
|
|
dfd5dd2478 | ||
|
|
327f07422f | ||
|
|
6b33e656be | ||
|
|
97a7117564 | ||
|
|
e8fefc82a1 | ||
|
|
0963b162e7 | ||
|
|
5210ae8385 | ||
|
|
78dc7aee15 | ||
|
|
cf1360701c | ||
|
|
b3fb61858a | ||
|
|
8d6708a12e | ||
|
|
06f6b31368 | ||
|
|
9562e8eac4 | ||
|
|
1325a3a6a2 | ||
|
|
89058f4447 | ||
|
|
f6da862145 | ||
|
|
0c464def7f | ||
|
|
e824c70e7d | ||
|
|
7a583e02e8 | ||
|
|
98d381ed67 | ||
|
|
e16d29f277 | ||
|
|
6bf322f79e | ||
|
|
c42aab26e3 | ||
|
|
e16b320cda | ||
|
|
9d4bef1c9a | ||
|
|
b392458c1c | ||
|
|
031b55eca6 | ||
|
|
3e0486743b | ||
|
|
7ab9a8b29a | ||
|
|
22086c088f | ||
|
|
3ee231afd3 | ||
|
|
4ffced0b7b | ||
|
|
ed6673f2f5 | ||
|
|
7935168379 | ||
|
|
3c891b7ebd | ||
|
|
8f5c7985e5 | ||
|
|
2150b6688a | ||
|
|
65b8fbb361 | ||
|
|
2bb894108c | ||
|
|
26d2245ae8 | ||
|
|
2b78a646ed | ||
|
|
1c59278115 | ||
|
|
2824636650 | ||
|
|
5a884ad93d | ||
|
|
dab8e28f6d | ||
|
|
e831c64e93 | ||
|
|
50f64dc45d | ||
|
|
24872373c4 | ||
|
|
f04efea09c | ||
|
|
cda254bb2d | ||
|
|
c1d1797576 | ||
|
|
a0faf6aa68 | ||
|
|
c6db8962b3 | ||
|
|
5a9085c34d | ||
|
|
c698b30c0a | ||
|
|
dfa40ea18f | ||
|
|
936c92eba6 | ||
|
|
b0155b8aca | ||
|
|
84eef52cb0 | ||
|
|
46fba47efb | ||
|
|
bf3f97b64d | ||
|
|
b605076bd0 | ||
|
|
329b034423 | ||
|
|
5e0535d511 | ||
|
|
b96d71d937 | ||
|
|
28c32c6af8 | ||
|
|
f80c5ce348 | ||
|
|
6a582869c6 | ||
|
|
813f28e5da | ||
|
|
cc16a00f5a | ||
|
|
4f74997235 | ||
|
|
2f4187b084 | ||
|
|
9a6d6cf9c0 | ||
|
|
26e2db02aa | ||
|
|
d66f2c8cfd | ||
|
|
6f239a5ad3 | ||
|
|
2224042114 | ||
|
|
4fe201f8aa | ||
|
|
3973b66ab3 | ||
|
|
e48b654ad6 | ||
|
|
3467376d7a | ||
|
|
1b6f9f9971 | ||
|
|
c70b627f92 | ||
|
|
435f5ff559 | ||
|
|
0b34ad55b6 | ||
|
|
262cdc5b9a | ||
|
|
19061934ce | ||
|
|
7614f36bbd | ||
|
|
f48180549d | ||
|
|
93aa9bf3e5 | ||
|
|
4d60dc6cbb | ||
|
|
1698afadb9 | ||
|
|
9aa67f9db9 | ||
|
|
57d12e6c47 | ||
|
|
cc9fbed07e | ||
|
|
8718d525d4 | ||
|
|
3beba2b578 | ||
|
|
1b08a822ee | ||
|
|
7865b0a2ee | ||
|
|
a31984724e | ||
|
|
a504452846 | ||
|
|
00b0dc2a04 | ||
|
|
41e0885bce | ||
|
|
694adcec64 | ||
|
|
5dd86d2453 | ||
|
|
b9d4a5215a | ||
|
|
456d2aee75 | ||
|
|
02890a6d3a | ||
|
|
0f503fe0db | ||
|
|
bfdd0696da | ||
|
|
130e510f8c | ||
|
|
512764403f | ||
|
|
b85eca3260 | ||
|
|
73975e4462 | ||
|
|
816887b811 | ||
|
|
20baaf9a7f | ||
|
|
9578f984ec | ||
|
|
3b7f232aef | ||
|
|
df1ed3cf2f | ||
|
|
59eceb9af1 | ||
|
|
d7e821785d | ||
|
|
b264087a3b | ||
|
|
759bb8cd25 | ||
|
|
4486f73432 | ||
|
|
224e0b7d58 | ||
|
|
9db86ff2d6 | ||
|
|
f3af89cb6a | ||
|
|
98e9cc7861 | ||
|
|
30f7b39a42 | ||
|
|
6b9e7e7eb3 | ||
|
|
f6e6758525 | ||
|
|
039dd37759 | ||
|
|
e9dd8b2b09 | ||
|
|
ee64f8ff9d | ||
|
|
db546bf478 | ||
|
|
5a7c6fb33f | ||
|
|
fa7ae31894 | ||
|
|
48097ba7e7 | ||
|
|
7c684d06c1 | ||
|
|
c8321201d8 | ||
|
|
ea421865aa | ||
|
|
f5019eeb60 | ||
|
|
62222f441d | ||
|
|
0e43f1b95a | ||
|
|
50cd4418d2 | ||
|
|
e1b14d4ee5 | ||
|
|
ce0df653f4 | ||
|
|
11f8807545 | ||
|
|
7af846c87f | ||
|
|
9f46f34d16 | ||
|
|
e62df26a53 | ||
|
|
b71de1559a | ||
|
|
c2c587752c | ||
|
|
fd029ff230 | ||
|
|
c534193f5c | ||
|
|
7b29156664 | ||
|
|
9ed8cb3eff | ||
|
|
a7d02b90a5 | ||
|
|
522639282d | ||
|
|
eb98f50891 | ||
|
|
f07735f05f | ||
|
|
32675b38f1 | ||
|
|
d35d6fc2f8 | ||
|
|
fa26faa6fd | ||
|
|
91a3557281 | ||
|
|
f09e0b5ed2 | ||
|
|
0580705b1e | ||
|
|
0c7e14eb9b | ||
|
|
92e8ef9b87 | ||
|
|
692af926be | ||
|
|
a17669b082 | ||
|
|
2ff8c66b9e | ||
|
|
be53b0d403 | ||
|
|
ba02ba4237 | ||
|
|
0d2ede4440 | ||
|
|
bf89883ff5 | ||
|
|
efcc3a3dfb | ||
|
|
fefeb1e9e2 | ||
|
|
f12436e55b | ||
|
|
98c4356638 | ||
|
|
e5c4fb7e30 | ||
|
|
4f9878a1da | ||
|
|
8557d113a3 | ||
|
|
9400e7f5d5 | ||
|
|
193509db58 | ||
|
|
d7ce175b8e | ||
|
|
0a8001a128 | ||
|
|
b46a8c897a | ||
|
|
bad8d85729 | ||
|
|
eb6f6e57ff | ||
|
|
cc495e3fd5 | ||
|
|
d190a26737 | ||
|
|
7ee4e269c3 | ||
|
|
f7465896fa | ||
|
|
4c8574aa4c | ||
|
|
7475c25fa7 | ||
|
|
3379bf3b08 | ||
|
|
7af3f48150 | ||
|
|
1b8511ab51 | ||
|
|
355ae49bc2 | ||
|
|
8c3274bd3c | ||
|
|
591384576f | ||
|
|
cdda2852d3 | ||
|
|
03992ab45c | ||
|
|
1f4b374bce | ||
|
|
a5b2757128 | ||
|
|
b961962f93 | ||
|
|
c64b2d1032 | ||
|
|
3ccfcb61ce | ||
|
|
e4c6029e72 | ||
|
|
d448bd8bd5 | ||
|
|
e999ab5ecb | ||
|
|
db8585aa85 | ||
|
|
e2545b3427 | ||
|
|
38a161f92b | ||
|
|
d14ac3e8d3 | ||
|
|
09087bdbf9 | ||
|
|
538252a4bf | ||
|
|
371e8f0dbe | ||
|
|
b8c5af5cef | ||
|
|
ddd22a1dfb | ||
|
|
2d3a9991d4 | ||
|
|
7f513cbc1d | ||
|
|
812f30fb75 | ||
|
|
86e32cdc23 | ||
|
|
554cbaa307 | ||
|
|
6a0cc838da | ||
|
|
4811bc3c5b | ||
|
|
65c94590eb | ||
|
|
5e67ca5566 | ||
|
|
d7ef314a15 | ||
|
|
a3c43efb85 | ||
|
|
9dcd0b8f42 | ||
|
|
349e34b1c1 | ||
|
|
66bce33a36 | ||
|
|
f67232b80f | ||
|
|
6b32c3aeec | ||
|
|
f3bc08160d | ||
|
|
1cca8a2303 | ||
|
|
ac215430c2 | ||
|
|
7f8a088306 | ||
|
|
2717b52e97 | ||
|
|
25cf030498 | ||
|
|
4bfab90750 | ||
|
|
95ddae7968 | ||
|
|
62fad30af5 | ||
|
|
c9373929ca | ||
|
|
01b47a833a | ||
|
|
a398c6dc99 | ||
|
|
32a40b18fd | ||
|
|
c7fcde83cf | ||
|
|
a9cd4faff0 | ||
|
|
ddccbaacdb | ||
|
|
6a7ecb2c63 | ||
|
|
0b07a6a696 | ||
|
|
58a36ec509 | ||
|
|
ebdfa9e52a | ||
|
|
4c145b11a5 | ||
|
|
c14739cb4a | ||
|
|
5b841cf4cb | ||
|
|
8fa17c578c | ||
|
|
183612a4e3 | ||
|
|
e3fbfe6541 | ||
|
|
69b9d04aad | ||
|
|
ffd1222990 | ||
|
|
07266d0b31 | ||
|
|
eb8ec327a8 | ||
|
|
f79b60083e | ||
|
|
fc50302e14 | ||
|
|
4896741706 | ||
|
|
fd7783c39d | ||
|
|
c60a945610 | ||
|
|
ef9bab627d | ||
|
|
9ca2a2e782 | ||
|
|
3613b6ed45 | ||
|
|
adc7079943 | ||
|
|
cd8fbbe8f2 | ||
|
|
e5726f3993 | ||
|
|
14c3c7865e | ||
|
|
9dd5fd198b | ||
|
|
2595729c8c | ||
|
|
6b6a422ead | ||
|
|
72a4e2073f | ||
|
|
1fa93abb5b | ||
|
|
81c763750f | ||
|
|
944f4309a8 | ||
|
|
b302051f87 | ||
|
|
070f85b541 | ||
|
|
71d97b04a5 | ||
|
|
b1edf78f13 | ||
|
|
fa5198354a | ||
|
|
e8803804ec | ||
|
|
baa9695678 | ||
|
|
a42a5cc2ca | ||
|
|
db7edd389f | ||
|
|
985794e733 | ||
|
|
5d0e37e2cc | ||
|
|
e69fb4a0db | ||
|
|
8512607fb6 | ||
|
|
299bfef7b5 | ||
|
|
a7f99b83f9 | ||
|
|
e7f1153c85 | ||
|
|
f873bb1cfb | ||
|
|
aadc58d349 | ||
|
|
5e75f0e0aa | ||
|
|
a450df823b | ||
|
|
af305afc2a | ||
|
|
3d15751e44 | ||
|
|
a09b8522ad | ||
|
|
16186b6ac7 | ||
|
|
1c2bd4134c | ||
|
|
c4b6fbec76 | ||
|
|
974055b90b | ||
|
|
4bf5724543 | ||
|
|
19ba7d67e8 | ||
|
|
34eff46e56 | ||
|
|
0529869617 | ||
|
|
81ce5c9134 | ||
|
|
6656f72782 | ||
|
|
dfb013bf78 | ||
|
|
2b37e28691 | ||
|
|
69fc6a0496 | ||
|
|
daba7e13fc | ||
|
|
580fa6a554 | ||
|
|
e90ef7aa6e | ||
|
|
d1e1dcd097 | ||
|
|
16354be1c5 | ||
|
|
a0fddfe7ec | ||
|
|
d6a459ad78 | ||
|
|
7b4dc14485 | ||
|
|
7208f53176 | ||
|
|
2c9bef6440 | ||
|
|
820772fc6d | ||
|
|
710cea5437 | ||
|
|
b6ede15b18 | ||
|
|
aa536813d9 | ||
|
|
2b9932c1ee | ||
|
|
2efb4e0d7d | ||
|
|
64935e78e3 | ||
|
|
831ded3ec2 | ||
|
|
bbf8e773f8 | ||
|
|
e4073cbe9a | ||
|
|
6d0bdd3a4d | ||
|
|
698dc262e0 | ||
|
|
41cd4c2140 | ||
|
|
12106387d1 | ||
|
|
17864d3dcc | ||
|
|
4e26e8e744 | ||
|
|
7f66c85e67 | ||
|
|
9efd5965ea | ||
|
|
2b4a920732 | ||
|
|
16025356bf | ||
|
|
7015b66636 | ||
|
|
f604005b4c | ||
|
|
1c318892c9 | ||
|
|
f66cf92bba | ||
|
|
559aae0263 | ||
|
|
74bb9c11d7 | ||
|
|
98dc5df039 | ||
|
|
d85a7883bb | ||
|
|
d1db8406f4 | ||
|
|
c8bb6873be | ||
|
|
b54a8f7fe8 | ||
|
|
9cdebc45c0 | ||
|
|
f8b6c1a285 | ||
|
|
1fb12a2fdf | ||
|
|
e3d25bda61 | ||
|
|
eb05c9b87d | ||
|
|
8145915d19 | ||
|
|
62ef81c5fb | ||
|
|
d4fa4c9d5e | ||
|
|
64cb3091cf | ||
|
|
b5ff80e858 | ||
|
|
cae66fd5e0 | ||
|
|
79871e2d00 | ||
|
|
fa1abdff2b | ||
|
|
af00fd0f30 | ||
|
|
f90a408630 | ||
|
|
f3e9c29f82 | ||
|
|
3ed7174838 | ||
|
|
0a83848cfc | ||
|
|
047ada75c7 | ||
|
|
129d2fae06 | ||
|
|
15a97f2b2b | ||
|
|
975d15733f | ||
|
|
62f091a40b | ||
|
|
078f259061 | ||
|
|
a67070dd9a | ||
|
|
f257fb7a4e | ||
|
|
3f79892fdb | ||
|
|
cd6d46e349 | ||
|
|
9ea160b116 | ||
|
|
8f03b5c8f3 | ||
|
|
3ce3f2fa71 | ||
|
|
d9c26a40b4 | ||
|
|
09e271de77 | ||
|
|
205dea122f | ||
|
|
2eb10aa19a | ||
|
|
63fc59fd7c | ||
|
|
bf6ee31491 | ||
|
|
146151ffd7 | ||
|
|
5b24f598a5 | ||
|
|
51a1c418a6 | ||
|
|
e1ff862ffc | ||
|
|
630a2c358a | ||
|
|
e0ea30041f | ||
|
|
58263e9b60 | ||
|
|
1e80aecfbd | ||
|
|
d5c6dde3d9 | ||
|
|
7819c9026a | ||
|
|
e6617c8e12 | ||
|
|
d03a01a84a | ||
|
|
90735fb3a7 | ||
|
|
264906221e | ||
|
|
be21704633 | ||
|
|
b68bb00033 | ||
|
|
1dd5c17bc7 | ||
|
|
c8a2c68728 | ||
|
|
f40c6511ef | ||
|
|
60aa6c2bf2 | ||
|
|
fe7446431b | ||
|
|
abe2a62d47 | ||
|
|
65d0f1edcc | ||
|
|
c09615bab0 | ||
|
|
218afa72c3 | ||
|
|
cb77fe2ed3 | ||
|
|
7345c5f2dd | ||
|
|
efdebf59d3 | ||
|
|
35d7490092 | ||
|
|
dd4a2c5d9c | ||
|
|
eae70f426e | ||
|
|
c7a6ca964c | ||
|
|
acb0004cea | ||
|
|
995d1b851a | ||
|
|
beab493dd5 | ||
|
|
1c76eb7e9f | ||
|
|
205398b65a | ||
|
|
61a6c5785f | ||
|
|
d983c6407c | ||
|
|
7cb78a4c86 | ||
|
|
733f6883d0 | ||
|
|
594874656a | ||
|
|
6142020c50 | ||
|
|
6f5b18854d | ||
|
|
b39c678a3d | ||
|
|
a8a85d9a1f | ||
|
|
182b92f010 | ||
|
|
a78f3699eb | ||
|
|
89bc509170 | ||
|
|
cfa615444e | ||
|
|
35389ed978 | ||
|
|
caacecfd83 | ||
|
|
924b460c7a | ||
|
|
60a9cf4942 | ||
|
|
f9f3080819 | ||
|
|
02c024e819 | ||
|
|
10249675ff | ||
|
|
b6553c0b59 | ||
|
|
dfd3e50b9c | ||
|
|
79b8f7ed1d | ||
|
|
f184c626e0 | ||
|
|
24ba40a77e | ||
|
|
66326d79a2 | ||
|
|
fcd6c100ee | ||
|
|
95b7879e33 | ||
|
|
404532f6f0 | ||
|
|
751262cdb3 | ||
|
|
0ac0d31796 | ||
|
|
9d5d7f0216 | ||
|
|
b59521e247 | ||
|
|
7dd90c4af3 | ||
|
|
b06e4ad298 | ||
|
|
ff21f86341 | ||
|
|
c89d41adbb | ||
|
|
b3e1bf6f05 | ||
|
|
fc57a69672 | ||
|
|
fdbc0c8ec8 | ||
|
|
e3edf6daec | ||
|
|
1b8f7b95f4 | ||
|
|
f756f39772 | ||
|
|
836f34297d | ||
|
|
cd6d2579a5 | ||
|
|
2892424006 | ||
|
|
856792d688 | ||
|
|
00115ba60c | ||
|
|
1cdddd35c8 | ||
|
|
ccaf4c942f | ||
|
|
9f9fcb1a8e | ||
|
|
b6955377c9 | ||
|
|
5f085f2df8 | ||
|
|
3cc5bb7c98 | ||
|
|
3dc4567233 | ||
|
|
37477adada | ||
|
|
a44afd79e0 | ||
|
|
61088ee2e7 | ||
|
|
a721917d95 | ||
|
|
a08b078c3e | ||
|
|
aa1cfb9020 | ||
|
|
0d961ce48e | ||
|
|
1b753802dd | ||
|
|
3f3bdde10c | ||
|
|
b2ea9e51d2 | ||
|
|
27a05028db | ||
|
|
725e16390b | ||
|
|
6b83ba3585 | ||
|
|
62e50b1a73 | ||
|
|
bf7192cef1 | ||
|
|
18d634b171 | ||
|
|
a5b5bccc61 | ||
|
|
988852a438 | ||
|
|
2313713603 | ||
|
|
6a5ce71c12 | ||
|
|
9872e945ba | ||
|
|
b3341cc552 | ||
|
|
0a1e3afa82 | ||
|
|
483728bfbf | ||
|
|
b459536b66 | ||
|
|
d990b47814 |
No files matched your search
@@ -0,0 +1 @@
|
||||
github: [groue]
|
||||
@@ -106,7 +106,8 @@ Podfile.lock
|
||||
|
||||
# SPM
|
||||
.build
|
||||
Package.resolved
|
||||
GRDB.xcworkspace/xcshareddata/swiftpm
|
||||
#Package.resolved
|
||||
Tests/SPM/Packages
|
||||
|
||||
# Ruby
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
[submodule "Tests/Performance/fmdb"]
|
||||
path = Tests/Performance/fmdb
|
||||
url = https://github.com/ccgus/fmdb.git
|
||||
[submodule "Tests/Performance/SQLite.swift"]
|
||||
path = Tests/Performance/SQLite.swift
|
||||
url = https://github.com/stephencelis/SQLite.swift.git
|
||||
[submodule "Tests/Performance/Realm"]
|
||||
path = Tests/Performance/Realm
|
||||
url = https://github.com/realm/realm-cocoa.git
|
||||
[submodule "SQLiteCustom/src"]
|
||||
path = SQLiteCustom/src
|
||||
url = https://github.com/swiftlyfalling/SQLiteLib.git
|
||||
@@ -2,7 +2,9 @@ included:
|
||||
- GRDB
|
||||
|
||||
disabled_rules:
|
||||
- comment_spacing
|
||||
- cyclomatic_complexity
|
||||
- duplicate_enum_cases
|
||||
- file_length
|
||||
- force_cast
|
||||
- force_try
|
||||
@@ -24,20 +26,26 @@ disabled_rules:
|
||||
opt_in_rules:
|
||||
- anyobject_protocol
|
||||
- array_init
|
||||
- attributes
|
||||
- closure_spacing
|
||||
- collection_alignment
|
||||
- contains_over_filter_count
|
||||
- contains_over_filter_is_empty
|
||||
- contains_over_first_not_nil
|
||||
- contains_over_range_nil_comparison
|
||||
- convenience_type
|
||||
- empty_collection_literal
|
||||
- empty_count
|
||||
- empty_string
|
||||
- explicit_init
|
||||
- fatal_error_message
|
||||
- first_where
|
||||
- flatmap_over_map_reduce
|
||||
- identical_operands
|
||||
- joined_default_parameter
|
||||
- last_where
|
||||
- legacy_multiple
|
||||
- legacy_random
|
||||
- lower_acl_than_parent
|
||||
- modifier_order
|
||||
- no_extension_access_modifier
|
||||
- overridden_super_call
|
||||
@@ -49,7 +57,6 @@ opt_in_rules:
|
||||
- toggle_bool
|
||||
- unused_declaration
|
||||
- unused_import
|
||||
- unused_private_declaration
|
||||
- yoda_condition
|
||||
|
||||
vertical_whitespace:
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
# The OS X Build Environment
|
||||
# https://docs.travis-ci.com/user/reference/osx/#xcode-version
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
|
||||
language: objective-c
|
||||
xcode_project: GRDB.xcodeproj
|
||||
|
||||
@@ -23,377 +28,134 @@ jobs:
|
||||
include:
|
||||
|
||||
###########################################
|
||||
## Test GRDB Xcode 10.2
|
||||
## Test GRDB Xcode 12.2
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBOSX - Swift 5.3"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBOSX (Swift 5, macOS)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBOSX_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBOSX - Swift 5.2"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBOSX (Swift 4.2, macOS)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBOSX_minSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBWatchOS"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBWatchOS (watchOS)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBWatchOS
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBiOS iOS maxTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 5, iOS <MAX>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBiOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBiOS iOS minTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
script: make test_framework_GRDBiOS_maxTarget_minSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 5, iOS <MIN>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBiOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - GRDBtvOS maxTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 5, tvOS <MAX>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBtvOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12 - GRDBtvOS minTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 4.2, tvOS <MAX>)
|
||||
script: make test_framework_GRDBtvOS_maxTarget_minSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 5, tvOS <MIN>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBtvOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10.2
|
||||
- name: "Test GRDB Xcode 12.2 - SPM"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDB [SPM] (macOS)
|
||||
osx_image: xcode12.2
|
||||
script: make test_SPM
|
||||
|
||||
###########################################
|
||||
## Test GRDBCustom Xcode 10.2
|
||||
## Test GRDBCustom Xcode 12.2
|
||||
|
||||
- stage: Test GRDBCustom Xcode 10.2
|
||||
- name: "Test GRDBCustom Xcode 12.2 - GRDBOSX"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBOSX (Swift 5, macOS)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBCustomSQLiteOSX
|
||||
|
||||
- stage: Test GRDBCustom Xcode 10.2
|
||||
- name: "Test GRDBCustom Xcode 12.2 - GRDBiOS maxTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 5, iOS <MAX>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDBCustom Xcode 10.2
|
||||
- name: "Test GRDBCustom Xcode 12.2 - GRDBiOS minTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_minSwift
|
||||
|
||||
- stage: Test GRDBCustom Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 5, iOS <MIN>)
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_GRDBCustomSQLiteiOS_minTarget
|
||||
|
||||
###########################################
|
||||
## Test SQLCipher Xcode 10.2
|
||||
## Test SQLCipher Xcode 12.2
|
||||
|
||||
- stage: Test SQLCipher Xcode 10.2
|
||||
- name: "Test SQLCipher Xcode 12.2 - SQLCipher 3"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=SQLCipher 3
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_SQLCipher3
|
||||
|
||||
- stage: Test SQLCipher Xcode 10.2
|
||||
- name: "Test SQLCipher Xcode 12.2 - SQLCipher 4"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=SQLCipher 4
|
||||
osx_image: xcode12.2
|
||||
script: make test_framework_SQLCipher4
|
||||
|
||||
###########################################
|
||||
## Test Installation Xcode 10.2
|
||||
## Test Installation Xcode 12.2
|
||||
|
||||
# Manual Install
|
||||
- stage: Test Installation Xcode 10.2
|
||||
- name: "Test Installation Xcode 12.2 - Manual Install"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=Manual Install
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_manual
|
||||
|
||||
# CocoaPods Lint
|
||||
- stage: Test Installation Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=CocoaPods Lint
|
||||
script: make test_CocoaPodsLint_GRDB
|
||||
|
||||
# CocoaPods Install GRDB
|
||||
- stage: Test Installation Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=CocoaPods GRDB (framework)
|
||||
script: make test_install_GRDB_CocoaPods_framework
|
||||
|
||||
# CocoaPods Install GRDB
|
||||
- stage: Test Installation Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=CocoaPods GRDB (static)
|
||||
script: make test_install_GRDB_CocoaPods_static
|
||||
|
||||
# SPM Install
|
||||
- stage: Test Installation Xcode 10.2
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- TID=SPM
|
||||
script: make test_install_SPM
|
||||
|
||||
###########################################
|
||||
## Test GRDB Xcode 10.1
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBOSX (Swift 4.2, macOS)
|
||||
script: make test_framework_GRDBOSX_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBWatchOS (watchOS)
|
||||
script: make test_framework_GRDBWatchOS
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
script: make test_framework_GRDBiOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MIN>)
|
||||
script: make test_framework_GRDBiOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 4.2, tvOS <MAX>)
|
||||
script: make test_framework_GRDBtvOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 4.2, tvOS <MIN>)
|
||||
script: make test_framework_GRDBtvOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10.1
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10.1
|
||||
env:
|
||||
- TID=GRDB [SPM] (macOS)
|
||||
script: make test_SPM
|
||||
|
||||
# ###########################################
|
||||
# ## Test GRDBCustom Xcode 10.1
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10.1
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10.1
|
||||
# env:
|
||||
# - TID=GRDBOSX (Swift 4.2, macOS)
|
||||
# script: make test_framework_GRDBCustomSQLiteOSX
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10.1
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10.1
|
||||
# env:
|
||||
# - TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
# script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_maxSwift
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10.1
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10.1
|
||||
# env:
|
||||
# - TID=GRDBiOS (Swift 4.2, iOS <MIN>)
|
||||
# script: make test_framework_GRDBCustomSQLiteiOS_minTarget
|
||||
|
||||
###########################################
|
||||
## Test GRDB Xcode 10
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBOSX (Swift 4.2, macOS)
|
||||
script: make test_framework_GRDBOSX_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBWatchOS (watchOS)
|
||||
script: make test_framework_GRDBWatchOS
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
script: make test_framework_GRDBiOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBiOS (Swift 4.2, iOS <MIN>)
|
||||
script: make test_framework_GRDBiOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 4.2, tvOS <MAX>)
|
||||
script: make test_framework_GRDBtvOS_maxTarget_maxSwift
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDBtvOS (Swift 4.2, tvOS <MIN>)
|
||||
script: make test_framework_GRDBtvOS_minTarget
|
||||
|
||||
- stage: Test GRDB Xcode 10
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=GRDB [SPM] (macOS)
|
||||
script: make test_SPM
|
||||
|
||||
# ###########################################
|
||||
# ## Test GRDBCustom Xcode 10
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=GRDBOSX (Swift 4.2, macOS)
|
||||
# script: make test_framework_GRDBCustomSQLiteOSX
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=GRDBiOS (Swift 4.2, iOS <MAX>)
|
||||
# script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_maxSwift
|
||||
#
|
||||
# - stage: Test GRDBCustom Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=GRDBiOS (Swift 4.2, iOS <MIN>)
|
||||
# script: make test_framework_GRDBCustomSQLiteiOS_minTarget
|
||||
#
|
||||
# ###########################################
|
||||
# ## Test SQLCipher Xcode 10
|
||||
#
|
||||
# - stage: Test SQLCipher Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=SQLCipher 3
|
||||
# script: make test_framework_SQLCipher3
|
||||
#
|
||||
# - stage: Test SQLCipher Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=SQLCipher 4
|
||||
# script: make test_framework_SQLCipher4
|
||||
|
||||
###########################################
|
||||
## Test Installation Xcode 10
|
||||
|
||||
# # Manual Install
|
||||
# - stage: Test Installation Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=Manual Install
|
||||
# script: make test_install_manual
|
||||
#
|
||||
# Travis is much too slow, and always fail this job
|
||||
# # CocoaPods Lint
|
||||
# - stage: Test Installation Xcode 10
|
||||
# - name: "Test Installation Xcode 12.2 - CocoaPods Lint"
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=CocoaPods Lint
|
||||
# osx_image: xcode12.2
|
||||
# script: make test_CocoaPodsLint_GRDB
|
||||
|
||||
# CocoaPods Install GRDB
|
||||
- stage: Test Installation Xcode 10
|
||||
- name: "Test Installation Xcode 12.2 - CocoaPods Framework"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=CocoaPods GRDB (framework)
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_GRDB_CocoaPods_framework
|
||||
|
||||
# CocoaPods Install GRDB
|
||||
- stage: Test Installation Xcode 10
|
||||
- name: "Test Installation Xcode 12.2 - CocoaPods Static"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode10
|
||||
env:
|
||||
- TID=CocoaPods GRDB (static)
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_GRDB_CocoaPods_static
|
||||
|
||||
# # SPM Install
|
||||
# - stage: Test Installation Xcode 10
|
||||
# gemfile: .ci/gemfiles/Gemfile.travis
|
||||
# osx_image: xcode10
|
||||
# env:
|
||||
# - TID=SPM
|
||||
# script: make test_install_SPM
|
||||
# SPM Install
|
||||
- name: "Test Installation Xcode 12.2 - SPM Package"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_SPM_Package
|
||||
|
||||
# SPM Install
|
||||
- name: "Test Installation Xcode 12.2 - SPM Package in Xcode Project"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_SPM_Project
|
||||
|
||||
# Custom SQLite Install
|
||||
- name: "Test Installation Xcode 12.2 - Custom SQLite"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode12.2
|
||||
script: make test_install_customSQLite
|
||||
|
||||
###########################################
|
||||
## Test GRDB Xcode 11.4
|
||||
|
||||
- name: "Test GRDB Xcode 11.4 - GRDBiOS iOS maxTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode11.4
|
||||
script: make test_framework_GRDBiOS_maxTarget_maxSwift
|
||||
|
||||
- name: "Test GRDB Xcode 11.4 - GRDBiOS iOS minTarget"
|
||||
gemfile: .ci/gemfiles/Gemfile.travis
|
||||
osx_image: xcode11.4
|
||||
script: make test_framework_GRDBiOS_minTarget
|
||||
@@ -0,0 +1,135 @@
|
||||
# Brag Document
|
||||
|
||||
Here is a list of people who were happy to meet GRDB :-)
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/peres/status/1352219836508729346
|
||||
|
||||
> Just the occasional reminder that GRDB and its documentation is the gold standard. That's it.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/steipete/status/1275305583718129664
|
||||
|
||||
> This is the future of Core Data
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/_maxheld/status/1266509824994553860
|
||||
|
||||
> I tried out GRDB since I saw you mention it a few days ago and absolutely love it. It’s so nice and testing the database logic is so much nicer than CoreData
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/stephencelis/status/1263518304980918274
|
||||
|
||||
> GRDB.swift is great! (I say this as the person that started SQLite.swift long ago.) And @groue’s very helpful and friendly.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/peres/status/1262682199482142720
|
||||
|
||||
> GRDB in already in my top3 when it comes to documentation. Clearly and pragmatically explained.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/layoutsubviews/status/1249940744929816582
|
||||
|
||||
> Mixing SQLite / GRDB with Combine is my whole world right now, and it is delightful.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/steipete/status/1231105339954802694
|
||||
|
||||
> It [Core Data] gets the job done, but folks made some really amazing Swift native sqlite wrappers.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/BelleBCooper/status/1223148814980091904
|
||||
|
||||
> I LOVE GRDB and highly recommend it. If you don’t need it now, do keep it in mind for future because it’s great and the documentation and support are top notch.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/layoutSubviews/status/1202092984822648832
|
||||
|
||||
> GRDB is quickly becoming the best package I have ever dealt with.
|
||||
> What an exceptional piece of work: the philosophy, the documentation, the API, the abstractions, the Swiftiness👌
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/fpillet/status/1193608995405209607
|
||||
|
||||
> GRDB keeps being the best-in-class interface to your database, and if you're not using it you're missing out. As always, amazing work from @groue !
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/lordmooch/status/1193537540583755776
|
||||
|
||||
> Best SQLite/Swift integration 😀👍🏻
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/BelleBCooper/status/1192195655743111168
|
||||
|
||||
> I’ve been working on a side project recently that uses SwiftUI (+UIKit for parent controllers and nav), Combine, GRDB, and GRDBCombine for automatic updating based on DB changes. I’m really liking this setup.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/BelleBCooper/status/1186034269577048064
|
||||
|
||||
> Working on a new project today and using GRDB by @groue for the backend. This is my go-to for new Swift projects. Highly recommend it!
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/krzyzanowskim/status/1156568071303290882
|
||||
|
||||
> I think GRDB.swift is a godsend. So far sooooo good. (change my mind?)
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/iOSDevWeekly/status/1133780078398021637
|
||||
|
||||
> How had I never heard of GRDB before this week? Was I the only one missing out, or is this wonderful database library from @groue news to you all too? https://buff.ly/2X8yHGf #iosdev
|
||||
|
||||
----
|
||||
|
||||
https://twitter.com/micpringle/status/1132264501812891648
|
||||
|
||||
> Spent the last few weeks integrating it and it’s amazing! And this release brings a whole load more features—especially excited about eager loading of hasMany relationships.
|
||||
>
|
||||
> Quite possibly one of the best documented open source libs I’ve come across as well👌🏼
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/danielemargutti/status/1132217792902647808
|
||||
|
||||
> It’s a great successor for FMDB with tons of great stuff. Worth a look, we have choose it in our new project even if, actually, I preferred not using some of the ‘ORM’ like features.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/lordmooch/status/1131664588494254086
|
||||
|
||||
> Woohoo! Absolutely superb Swift library for SQLite - I love it 😀
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/JadenGeller/status/1115483150564487168
|
||||
|
||||
> Wow, there are some *really* good looking SQLite frameworks in Swift.
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/strawb3rryx7/status/1073620070784516096
|
||||
|
||||
> If you looking for a SQLite wrapper in Swift, just take a look the GRDB library! 👇🏼 https://github.com/groue/GRDB.swift Well-maintained and documented! ✊🏼
|
||||
|
||||
---
|
||||
|
||||
https://twitter.com/BelleBCooper/status/1047017928112128000
|
||||
|
||||
> http://blog.bellebcooper.com/2018-10-02-16-39.html
|
||||
>
|
||||
> I love the way issues are handled in GRDB (SQLite for Swift). Groue is so friendly, and always goes above-and-beyond in helping to solve problems or explore new features for the library. It makes me happy to be a GRDB user.
|
||||
|
||||
@@ -3,16 +3,28 @@ Release Notes
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
GRDB adheres to [Semantic Versioning](https://semver.org/), with one expection: APIs flagged [**:fire: EXPERIMENTAL**](README.md#what-are-experimental-features). Those are unstable, and may break between any two minor releases of the library.
|
||||
GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: APIs flagged [**:fire: EXPERIMENTAL**](README.md#what-are-experimental-features). Those are unstable, and may break between any two minor releases of the library.
|
||||
|
||||
#### 5.x Releases
|
||||
|
||||
<!--
|
||||
[Next Release](#next-release)
|
||||
-->
|
||||
|
||||
- `5.3.x` Releases - [5.3.0](#530)
|
||||
- `5.2.x` Releases - [5.2.0](#520)
|
||||
- `5.1.x` Releases - [5.1.0](#510)
|
||||
- `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) | [5.0.3](#503)
|
||||
- `5.0.0` Betas - [5.0.0-beta](#500-beta) | [5.0.0-beta.2](#500-beta2) | [5.0.0-beta.3](#500-beta3) | [5.0.0-beta.4](#500-beta4) | [5.0.0-beta.5](#500-beta5) | [5.0.0-beta.6](#500-beta6) | [5.0.0-beta.7](#500-beta7) | [5.0.0-beta.8](#500-beta8) | [5.0.0-beta.9](#500-beta9) | [5.0.0-beta.10](#500-beta10) | [5.0.0-beta.11](#500-beta11)
|
||||
|
||||
#### 4.x Releases
|
||||
|
||||
- `4.14.x` Releases - [4.14.0](#4140)
|
||||
- `4.13.x` Releases - [4.13.0](#4130)
|
||||
- `4.12.x` Releases - [4.12.0](#4120) | [4.12.1](#4121) | [4.12.2](#4122)
|
||||
- `4.11.x` Releases - [4.11.0](#4110)
|
||||
- `4.10.x` Releases - [4.10.0](#4100)
|
||||
- `4.9.x` Releases - [4.9.0](#490)
|
||||
- `4.8.x` Releases - [4.8.0](#480) | [4.8.1](#481)
|
||||
- `4.7.x` Releases - [4.7.0](#470)
|
||||
- `4.6.x` Releases - [4.6.0](#460) | [4.6.1](#461) | [4.6.2](#462)
|
||||
- `4.5.x` Releases - [4.5.0](#450)
|
||||
- `4.4.x` Releases - [4.4.0](#440)
|
||||
- `4.3.x` Releases - [4.3.0](#430)
|
||||
- `4.2.x` Releases - [4.2.0](#420) | [4.2.1](#421)
|
||||
@@ -57,9 +69,580 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one expection:
|
||||
- [0.110.0](#01100), ...
|
||||
|
||||
|
||||
<!--
|
||||
## Next Release
|
||||
-->
|
||||
## 5.3.0
|
||||
|
||||
Released January 9, 2021 • [diff](https://github.com/groue/GRDB.swift/compare/v5.2.0...v5.3.0)
|
||||
|
||||
- **New**: [#880](https://github.com/groue/GRDB.swift/pull/880): Common Table Expressions
|
||||
- **New**: [#892](https://github.com/groue/GRDB.swift/pull/892) by [@eburns-vmware](https://github.com/eburns-vmware): Provide SQLCipher passphrase as Data
|
||||
- **Fixed**: [#881](https://github.com/groue/GRDB.swift/pull/881) by [@felixscheinost](https://github.com/felixscheinost) and [#883](https://github.com/groue/GRDB.swift/pull/883) by [@professordeng](https://github.com/professordeng): Documentation improvements
|
||||
- **Fixed**: [#885](https://github.com/groue/GRDB.swift/pull/885): Robustness of eager loading of to-many associations based on compound foreign keys
|
||||
- **Fixed**: [#901](https://github.com/groue/GRDB.swift/pull/901) by [@wuyuehyang](https://github.com/wuyuehyang): Fix creation of FTS5 tokenizer with arguments
|
||||
- **Fixed**: [#903](https://github.com/groue/GRDB.swift/pull/903) by [@chrisballinger](https://github.com/chrisballinger): Fix SPM installation instructions
|
||||
- **Documentation update**: A new guide: [Common Table Expressions](https://github.com/groue/GRDB.swift/blob/master/Documentation/CommonTableExpressions.md)
|
||||
- **Documentation update**: The [Foreign Keys](https://github.com/groue/GRDB.swift/blob/master/Documentation/AssociationsBasics.md#foreign-keys) chapter of the Associations Guide clarifies the behavior of SQLite and GRDB regarding the presence of NULL if compound foreign keys.
|
||||
|
||||
|
||||
## 5.2.0
|
||||
|
||||
Released November 29, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.1.0...v5.2.0)
|
||||
|
||||
- **New**: [#868](https://github.com/groue/GRDB.swift/pull/868): ValueObservation optimization is opt-in.
|
||||
- **New**: [#872](https://github.com/groue/GRDB.swift/pull/872): Parse time zones
|
||||
- **Documentation update**: The [ValueObservation Performance](https://github.com/groue/GRDB.swift/blob/master/README.md#valueobservation-performance) chapter was extended with a tip for observations that track a constant database region.
|
||||
- **Documentation update**: The [Date and DateComponents](https://github.com/groue/GRDB.swift/blob/master/README.md#date-and-datecomponents) chapter describes the support for time zones.
|
||||
- **Documentation update**: A caveat ([#871](https://github.com/groue/GRDB.swift/issues/871)) with the `including(all:)` method, which may fail with a database error of code [`SQLITE_ERROR`](https://www.sqlite.org/rescode.html#error) (1) "Expression tree is too large" when you use a compound foreign key and there are a lot of parent records, is detailed in the [Joining And Prefetching Associated Records](https://github.com/groue/GRDB.swift/blob/master/Documentation/AssociationsBasics.md#joining-and-prefetching-associated-records) chapter.
|
||||
|
||||
|
||||
## 5.1.0
|
||||
|
||||
Released November 1, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.3...v5.1.0)
|
||||
|
||||
- **New**: Clarifications on [ValueObservation that track a varying database region](https://github.com/groue/GRDB.swift/blob/master/README.md#observing-a-varying-database-region).
|
||||
- **New**: FAQ [Why is ValueObservation not publishing value changes?](https://github.com/groue/GRDB.swift/blob/master/README.md#why-is-valueobservation-not-publishing-value-changes)
|
||||
- **New**: [#855](https://github.com/groue/GRDB.swift/pull/855) by [@mallman](https://github.com/mallman): Support for generated columns with custom SQLite build, and upgrade custom SQLite builds to version 3.33.0
|
||||
- **New**: [#864](https://github.com/groue/GRDB.swift/pull/864): Prevent filter misuse with a deprecation warning
|
||||
|
||||
|
||||
## 5.0.3
|
||||
|
||||
Released October 25, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.2...v5.0.3)
|
||||
|
||||
- **Fixed**: [#859](https://github.com/groue/GRDB.swift/pull/859): Database.close() is idempotent
|
||||
- **Fixed**: [#850](https://github.com/groue/GRDB.swift/pull/850) by [@mtancock](https://github.com/mtancock): Add buildActiveScheme to playground settings so they'll build under Xcode 12
|
||||
- **Fixed**: [#849](https://github.com/groue/GRDB.swift/pull/849) by [@MarshalGeazipp](https://github.com/MarshalGeazipp): Fix grammar mistake AssociationsBasics.md
|
||||
|
||||
|
||||
## 5.0.2
|
||||
|
||||
Released October 6, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.1...v5.0.2)
|
||||
|
||||
- **Fixed**: [#844](https://github.com/groue/GRDB.swift/issues/844): Fix a crash in the demo app
|
||||
- **Fixed**: [#847](https://github.com/groue/GRDB.swift/issues/847): Remove dependency on SQLITE_ENABLE_SNAPSHOT
|
||||
|
||||
|
||||
## 5.0.1
|
||||
|
||||
Released September 27, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0...v5.0.1)
|
||||
|
||||
- **Fixed**: [#841](https://github.com/groue/GRDB.swift/issues/841): Fix GRDB 5 regression with indexes on expressions
|
||||
- The [GRDBCombineDemo](Documentation/DemoApps/GRDBCombineDemo/README.md) Combine + SwiftUI demo application was updated for the SwiftUI App lifecycle introduced in iOS 14.
|
||||
|
||||
|
||||
## 5.0.0
|
||||
|
||||
Released September 20, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.11...v5.0.0)
|
||||
|
||||
- **Fixed**: [#838](https://github.com/groue/GRDB.swift/issues/838): Have indexed colums inherit the `ifNotExists` flag from table creation.
|
||||
|
||||
|
||||
## 5.0.0-beta.11
|
||||
|
||||
Released September 7, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.10...v5.0.0-beta.11)
|
||||
|
||||
- **Breaking Change**: [#831](https://github.com/groue/GRDB.swift/pull/831): Improve Configuration.prepareDatabase
|
||||
|
||||
|
||||
## 5.0.0-beta.10
|
||||
|
||||
Released July 30, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.9...v5.0.0-beta.10)
|
||||
|
||||
- **New**: DatabasePool readers don't invalidate their database schema cache until schema is actually changed.
|
||||
- **Breaking Change**: [#817](https://github.com/groue/GRDB.swift/pull/817): Allow query planner to optimize some boolean tests
|
||||
|
||||
|
||||
## 5.0.0-beta.9
|
||||
|
||||
Released July 23, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.8...v5.0.0-beta.9)
|
||||
|
||||
- **New**: [#813](https://github.com/groue/GRDB.swift/pull/813): Expose SQLite 3.31.1 APIs to iOS, macOS, tvOS, watchOS
|
||||
- **Fixed**: [#814](https://github.com/groue/GRDB.swift/pull/814): Fix regression with views
|
||||
|
||||
|
||||
## 5.0.0-beta.8
|
||||
|
||||
Released July 19, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.7...v5.0.0-beta.8)
|
||||
|
||||
- **New**: [#811](https://github.com/groue/GRDB.swift/pull/811): Introduce RenameColumnAdapter
|
||||
|
||||
|
||||
## 5.0.0-beta.7
|
||||
|
||||
Released July 14, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.6...v5.0.0-beta.7)
|
||||
|
||||
- **New**: [#802](https://github.com/groue/GRDB.swift/pull/802) by [@GetToSet](https://github.com/GetToSet): Add tokenchars support for ascii tokenizer in FTS5
|
||||
- **New**: `fetchSet` has joined `fetchCursor`, `fetchAll` and `fetchOne` in the group of universal fetching methods.
|
||||
- **Breaking Change**: [#803](https://github.com/groue/GRDB.swift/pull/803): Remove FetchedRecordsController
|
||||
- **Breaking Change**: Removed `TableRecord.primaryKey` and `selectPrimaryKey(as:)` introduced in 5.0.0-beta.5
|
||||
- **Breaking Change**: Many types and methods that support the query builder used to be publicly exposed and flagged as experimental. They are now private, or renamed with an underscore prefix, which means they are not for public use.
|
||||
- **Breaking Change**: Defining custom `FetchRequest` types is no longer supported.
|
||||
- **Breaking Change**: Defining custom `RowAdapter` types is no longer supported.
|
||||
- **Fixed**: Fix rare occurences of an `SQLITE_BUSY` error when opening a DatabaseSnapshot.
|
||||
- **Fixed**: Work around an SQLite bug which prevents rollbacking a transaction with `sqlite3_commit_hook`.
|
||||
- The [How do I filter records and only keep those that are NOT associated to another record?](README.md#how-do-i-filter-records-and-only-keep-those-that-are-not-associated-to-another-record) FAQ has been updated.
|
||||
|
||||
|
||||
## 5.0.0-beta.6
|
||||
|
||||
Released June 29, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.5...v5.0.0-beta.6)
|
||||
|
||||
- **New**: [#798](https://github.com/groue/GRDB.swift/pull/798): Debugging operators for ValueObservation
|
||||
- **New**: [#800](https://github.com/groue/GRDB.swift/pull/800): Xcode 12 support
|
||||
- **New**: [#801](https://github.com/groue/GRDB.swift/pull/801): Combine support
|
||||
- **New**: Faster decoding of Date and DateComponents
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- The [ValueObservation Operators](README.md#valueobservation-operators) chapter was extended with a description of the two new debugging operators `handleEvents` and `print`.
|
||||
|
||||
- A new [GRDB ❤️ Combine](Documentation/Combine.md) guide describes the various Combine publishers that read, write, and observe the database.
|
||||
|
||||
- [GRDBCombineDemo](Documentation/DemoApps/GRDBCombineDemo/README.md) is a new Combine + SwiftUI demo application.
|
||||
|
||||
|
||||
## 5.0.0-beta.5
|
||||
|
||||
Released June 15, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.4...v5.0.0-beta.5)
|
||||
|
||||
- **Breaking Change** [#795](https://github.com/groue/GRDB.swift/pull/795): Enhanced support for WAL Checkpoints
|
||||
- **New**: `Database.maximumStatementArgumentCount` returns the maximum number of arguments accepted by an SQLite statement.
|
||||
- **New**: Optimize DatabasePool handling of ValueObservation when SQLite is compiled with the SQLITE_ENABLE_SNAPSHOT option. We are now able to avoid fetching the observed value when we can prove that the database wasn't changed between the initial fetch and the beginning of transaction tracking. This optimization avoids duplicate notifications.
|
||||
- **New**: The query interface now exposes the primary key through `TableRecord.primaryKey`, as well as the `selectPrimaryKey(as:)` method.
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- The [Demo Application](Documentation/DemoApps/GRDBDemoiOS) was updated for better conformance with the [Good Practices for Designing Record Types](Documentation/GoodPracticesForDesigningRecordTypes.md) Guide.
|
||||
|
||||
- A new [FAQ: Associations](README.md#faq-associations) addresses three frequent questions:
|
||||
- [How do I filter records and only keep those that are associated to another record?](README.md#how-do-i-filter-records-and-only-keep-those-that-are-associated-to-another-record)
|
||||
- [How do I filter records and only keep those that are NOT associated to another record?](README.md#how-do-i-filter-records-and-only-keep-those-that-are-not-associated-to-another-record)
|
||||
- [How do I select only one column of an associated record?](README.md#how-do-i-select-only-one-column-of-an-associated-record)
|
||||
|
||||
- The guide for [Custom SQLite builds](Documentation/CustomSQLiteBuilds.md) now recommends enabling the `SQLITE_ENABLE_SNAPSHOT` option.
|
||||
|
||||
|
||||
## 5.0.0-beta.4
|
||||
|
||||
Released June 6, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.3...v5.0.0-beta.4)
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) was updated for RxGRDB and GRDBCombine 1.0 beta 2, which haved change their way to configure how ValueObservation schedules fresh database values.
|
||||
- The [SQL Functions](README.md#sql-functions) chapter was updated for the new `julianDay` and `dateTime` functions.
|
||||
|
||||
### New
|
||||
|
||||
- [#794](https://github.com/groue/GRDB.swift/pull/794): Name of Database Connections
|
||||
- Add the `julianDay` and `dateTime` functions
|
||||
|
||||
|
||||
## 5.0.0-beta.3
|
||||
|
||||
Released June 1, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta.2...v5.0.0-beta.3)
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- Updated FAQ: [How do I print a request as SQL?](README.md#how-do-i-print-a-request-as-sql)
|
||||
- New FAQ: [How do I monitor the duration of database statements execution?](README.md#how-do-i-monitor-the-duration-of-database-statements-execution)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#784](https://github.com/groue/GRDB.swift/pull/784): Fix observation of eager-loaded to-many associations
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- [#790](https://github.com/groue/GRDB.swift/pull/790): Bump required iOS version to 10.0
|
||||
- [#791](https://github.com/groue/GRDB.swift/pull/791): Extend tracing of statement execution
|
||||
|
||||
|
||||
## 5.0.0-beta.2
|
||||
|
||||
Released May 11, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.0-beta...v5.0.0-beta.2)
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) describes the sunsetting of custom `FetchRequest` types.
|
||||
- The [Sharing a Database](Documentation/SharingADatabase.md) guide has an updated recommendation for opening writer connections to a shared database.
|
||||
|
||||
### New
|
||||
|
||||
- [#772](https://github.com/groue/GRDB.swift/pull/772): Update the Database Sharing Guide with mention of the persistent WAL mode
|
||||
- [#775](https://github.com/groue/GRDB.swift/pull/775): DatabaseMigrator can check if it has been superseded
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- [#774](https://github.com/groue/GRDB.swift/pull/774): All requests are usable as SQL expressions and collections
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#773](https://github.com/groue/GRDB.swift/pull/773): Allow subqueries to refer to outer tables
|
||||
|
||||
|
||||
## 5.0.0-beta
|
||||
|
||||
Released May 2, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.14.0...v5.0.0-beta)
|
||||
|
||||
GRDB 5 is a release focused on **Swift 5.2**, and **removing technical debt**.
|
||||
|
||||
There are breaking changes, though as few as possible. They open the door for future library improvements. And they have GRDB, [GRDBCombine](http://github.com/groue/GRDBCombine), and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) offer a common behavior.
|
||||
|
||||
New features include support for SQL subqueries, and a simplified handling of database errors. The most demanding users will also find it easier to switch between the system SQLite, SQLCipher, and custom SQLite builds.
|
||||
|
||||
<details>
|
||||
<summary>A glimpse on the new features</summary>
|
||||
|
||||
All requests can now be used as subqueries:
|
||||
|
||||
```swift
|
||||
// Define a request with the query interface or raw SQL
|
||||
let maximumScore = Player.select(max(Column("score")))
|
||||
let maximumScore: SQLRequest<Int> = "SELECT MAX(score) FROM player"
|
||||
|
||||
// Use the request as a subquery in the query interface
|
||||
let request = Player.filter(Column("score") == maximumScore)
|
||||
let bestPlayers = try request.fetchAll(db)
|
||||
|
||||
// Use the request as a subquery in SQL requests
|
||||
let request: SQLRequest<Player> = "SELECT * FROM player WHERE score = (\(maximumScore))"
|
||||
let bestPlayers = try request.fetchAll(db)
|
||||
```
|
||||
|
||||
Catch specific SQLite error codes in a simplified fashion:
|
||||
|
||||
```swift
|
||||
do {
|
||||
try ...
|
||||
} catch DatabaseError.SQLITE_CONSTRAINT_FOREIGNKEY {
|
||||
// foreign key constraint error
|
||||
} catch DatabaseError.SQLITE_CONSTRAINT {
|
||||
// any other constraint error
|
||||
} catch {
|
||||
// any other database error
|
||||
}
|
||||
```
|
||||
|
||||
Reuse the same code for system SQLite, SQLCipher, and custom SQLite builds:
|
||||
|
||||
```swift
|
||||
// Supported in all GRDB flavors
|
||||
import GRDB
|
||||
let sqliteVersion = String(cString: sqlite3_libversion())
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- **[Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md)**: how to upgrade your apps, and deal with breaking changes.
|
||||
- [ValueObservation](README.md#valueobservation): this chapter describes the new ValueObservation behaviors.
|
||||
- [DatabaseError](README.md#databaseerror): learn how to catch and match DatabaseError on their codes, in a fashion similar to `CocoaError`.
|
||||
- [Batch Updates](README.md#update-requests): this chapter is updated for the new `set(to:)` method.
|
||||
- [SQL Operators](README.md#sql-operators): introduces support for SQL and query interface subqueries.
|
||||
- [How do I print a request as SQL?](README.md#how-do-i-print-a-request-as-sql) This FAQ was updated for GRDB 5.
|
||||
- [SQL Interpolation](Documentation/SQLInterpolation.md): this guide now describes how to embed subqueries and record columns in your SQL literals.
|
||||
- [Joined Queries Support](README.md#joined-queries-support): describes the GRDB 5 way of dealing with complex and hand-crafted SQL queries.
|
||||
- [Raw SQLite Pointers](README.md#raw-sqlite-pointers) and [Custom SQLite builds](Documentation/CustomSQLiteBuilds.md): `import GRDB` now provides access to the full [C SQLite API](https://www.sqlite.org/capi3ref.html), and custom SQLite builds.
|
||||
|
||||
### New
|
||||
|
||||
- [#749](https://github.com/groue/GRDB.swift/pull/749): Drop submodules used by performance tests
|
||||
- [#754](https://github.com/groue/GRDB.swift/pull/754): Match DatabaseError on ResultCode
|
||||
- [#756](https://github.com/groue/GRDB.swift/pull/756): Export the underlying SQLite library
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- [#719](https://github.com/groue/GRDB.swift/pull/719): Bump required Swift version to 5.2
|
||||
- [#720](https://github.com/groue/GRDB.swift/pull/720): Turn deprecated APIs into unavailable ones
|
||||
- [#722](https://github.com/groue/GRDB.swift/pull/722): SE-0253: Callable values of user-defined nominal types
|
||||
- [#728](https://github.com/groue/GRDB.swift/pull/728): Make ValueObservation error handling mandatory
|
||||
- [#729](https://github.com/groue/GRDB.swift/pull/729): ValueObservation always emits an initial value
|
||||
- [#731](https://github.com/groue/GRDB.swift/pull/731): Hide ValueObservation implementation details
|
||||
- [#732](https://github.com/groue/GRDB.swift/pull/732): Remove ValueObservation.compactMap
|
||||
- [#736](https://github.com/groue/GRDB.swift/pull/736): Relax ValueObservation Guarantees
|
||||
- [#737](https://github.com/groue/GRDB.swift/pull/737): Force implicit database region for ValueObservation
|
||||
- [#738](https://github.com/groue/GRDB.swift/pull/738): Remove all observationForCount/All/First methods
|
||||
- [#742](https://github.com/groue/GRDB.swift/pull/742): ValueObservation scheduling is no longer an attribute of the observation
|
||||
- [#745](https://github.com/groue/GRDB.swift/pull/745): Explicit ValueObservation cancellation
|
||||
- [#747](https://github.com/groue/GRDB.swift/pull/747): Rename GRDBCustomSQLite to GRDB
|
||||
- [#750](https://github.com/groue/GRDB.swift/pull/750): Batch updates do not need any operator
|
||||
- [#752](https://github.com/groue/GRDB.swift/pull/752): Remove ValueObservation.combine
|
||||
- [#770](https://github.com/groue/GRDB.swift/pull/770): Subqueries
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#601](https://github.com/groue/GRDB.swift/pull/601): ValueObservation won't start until concurrent write transaction has ended
|
||||
- [#697](https://github.com/groue/GRDB.swift/pull/697): `SQLInterpolation` could not work with `QueryInterfaceRequest`
|
||||
- [#743](https://github.com/groue/GRDB.swift/pull/743): Rename GRDBCustomSQLite to GRDB for compatibility with dependents?
|
||||
|
||||
|
||||
## 4.14.0
|
||||
|
||||
Released April 23, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.13.0...v4.14.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#766](https://github.com/groue/GRDB.swift/pull/766) by [@mtancock](https://github.com/mtancock): Add Codable support to DatabaseDateComponents
|
||||
|
||||
|
||||
## 4.13.0
|
||||
|
||||
Released April 15, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.12.2...v4.13.0)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- Restored support for Xcode 10.0 and Xcode 10.1, broken in 4.12.2
|
||||
- [#759](https://github.com/groue/GRDB.swift/pull/759): Fix batch updates of complex requests
|
||||
|
||||
**New**
|
||||
|
||||
- [#761](https://github.com/groue/GRDB.swift/pull/761): Deprecate the batch update `<-` operator
|
||||
|
||||
|
||||
## 4.12.2
|
||||
|
||||
Released April 13, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.12.1...v4.12.2)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- [#757](https://github.com/groue/GRDB.swift/pull/757): Don't load association inflections unless necessary
|
||||
|
||||
|
||||
## 4.12.1
|
||||
|
||||
Released March 29, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.12.0...v4.12.1)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- [#744](https://github.com/groue/GRDB.swift/pull/744): Fix DatabaseMigrator deadlock with serial target queues
|
||||
|
||||
|
||||
## 4.12.0
|
||||
|
||||
Released March 21, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.11.0...v4.12.0)
|
||||
|
||||
**New**
|
||||
|
||||
- Batch updates now accept nil assignments:
|
||||
|
||||
```swift
|
||||
// UPDATE player SET score = NULL
|
||||
try Player.updateAll(db, scoreColumn <- nil)
|
||||
```
|
||||
|
||||
- DatabaseMigrator can now recreate the database if a migration has been removed, or renamed (addresses [#725](https://github.com/groue/GRDB.swift/issues/725)).
|
||||
|
||||
- DatabaseMigrator querying methods have been enhanced:
|
||||
|
||||
```swift
|
||||
// New
|
||||
dbQueue.read(migrator.hasCompletedMigrations)
|
||||
dbQueue.read(migrator.completedMigrations).contains("v2")
|
||||
dbQueue.read(migrator.completedMigrations).last == "v2"
|
||||
dbQueue.read(migrator.appliedMigrations)
|
||||
|
||||
// Deprecated
|
||||
migrator.hasCompletedMigrations(in: dbQueue)
|
||||
migrator.hasCompletedMigrations(in: dbQueue, through: "v2")
|
||||
migrator.lastCompletedMigration(in: dbQueue) == "v2"
|
||||
migrator.appliedMigrations(in: dbQueue)
|
||||
```
|
||||
|
||||
|
||||
## 4.11.0
|
||||
|
||||
Released March 2, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.10.0...v4.11.0)
|
||||
|
||||
### New
|
||||
|
||||
- [#706](https://github.com/groue/GRDB.swift/pull/706): Enhance SQLLiteral and SQL interpolation again
|
||||
- [#710](https://github.com/groue/GRDB.swift/pull/710): Check if all migrations have been applied
|
||||
- [#712](https://github.com/groue/GRDB.swift/pull/712) by [@pakko972](https://github.com/pakko972): Automatic iOS memory management
|
||||
- [#713](https://github.com/groue/GRDB.swift/pull/713): Enhance DatabaseMigrator isolation
|
||||
|
||||
### Breaking Change
|
||||
|
||||
- [#709](https://github.com/groue/GRDB.swift/pull/709): Simplify DatabaseMigrator API
|
||||
|
||||
Database migrations have a new behavior which is a breaking change. However, it is very unlikely to impact your application.
|
||||
|
||||
In previous versions of GRDB, a foreign key violation would immediately prevent a migration from successfully complete. Now, foreign key checks are deferred until the end of each migration. This means that some migrations will change their behavior:
|
||||
|
||||
```swift
|
||||
// Used to fail, now succeeds
|
||||
migrator.registerMigration(...) { db in
|
||||
try violateForeignKeyConstraint(db)
|
||||
try fixForeignKeyConstraint(db)
|
||||
}
|
||||
|
||||
// The catch clause is no longer called
|
||||
migrator.registerMigration(...) { db in
|
||||
do {
|
||||
try performChanges(db)
|
||||
} catch let error as DatabaseError where error.resultCode == .SQL_CONSTRAINT {
|
||||
// Handle foreign key error
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If your application happens to define migrations that are impacted by this change, please open an issue so that we find a way to restore the previous behavior.
|
||||
|
||||
|
||||
## 4.10.0
|
||||
|
||||
Released February 23, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.9.0...v4.10.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#689](https://github.com/groue/GRDB.swift/pull/689) by [@gjeck](https://github.com/gjeck): Add support for renaming columns within a table
|
||||
- [#690](https://github.com/groue/GRDB.swift/pull/690): Enhance SQLLiteral and SQL interpolation
|
||||
|
||||
|
||||
## 4.9.0
|
||||
|
||||
Released January 17, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.8.1...v4.9.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#683](https://github.com/groue/GRDB.swift/pull/683): String concatenation
|
||||
- [#685](https://github.com/groue/GRDB.swift/pull/685) by [@gjeck](https://github.com/gjeck): Add cache for TableRecord.defaultDatabaseTableName
|
||||
|
||||
|
||||
## 4.8.1
|
||||
|
||||
Released January 12, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.8.0...v4.8.1)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- [#677](https://github.com/groue/GRDB.swift/pull/677): Fix associations altered by another association
|
||||
|
||||
|
||||
## 4.8.0
|
||||
|
||||
Released January 8, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.7.0...v4.8.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#676](https://github.com/groue/GRDB.swift/pull/676): More batch delete and update
|
||||
|
||||
|
||||
## 4.7.0
|
||||
|
||||
Released December 18, 2019 • [diff](https://github.com/groue/GRDB.swift/compare/v4.6.2...v4.7.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#656](https://github.com/groue/GRDB.swift/pull/656): Type inference of selected columns
|
||||
- [#659](https://github.com/groue/GRDB.swift/pull/659): Database interruption
|
||||
- [#660](https://github.com/groue/GRDB.swift/pull/660): Database Lock Prevention
|
||||
- [#662](https://github.com/groue/GRDB.swift/pull/662): Upgrade custom SQLite builds to version 3.30.1 (thanks to [@swiftlyfalling](https://github.com/swiftlyfalling/SQLiteLib))
|
||||
- [#668](https://github.com/groue/GRDB.swift/pull/668): Database Suspension
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
[Custom SQLite builds](Documentation/CustomSQLiteBuilds.md) now disable by default the support for the [Double-quoted String Literals misfeature](https://sqlite.org/quirks.html#dblquote). This is a technically a breaking change, but it fixes an SQLite bug. You can restore the previous behavior if your application relies on it:
|
||||
|
||||
```swift
|
||||
// Enable support for the Double-quoted String Literals misfeature
|
||||
var configuration = Configuration()
|
||||
configuration.acceptsDoubleQuotedStringLiterals = true
|
||||
let dbQueue = try DatabaseQueue(path: ..., configuration: configuration)
|
||||
```
|
||||
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
The new [Interrupt a Database](README.md#interrupt-a-database) chapter documents the new `interrupt()` method.
|
||||
|
||||
The new [Sharing a Datatase in an App Group Container](Documentation/AppGroupContainers.md) guide explains how to setup GRDB when you share a database in an iOS App Group container.
|
||||
|
||||
|
||||
### API Diff
|
||||
|
||||
```diff
|
||||
struct Configuration {
|
||||
+ var observesSuspensionNotifications: Bool // Experimental
|
||||
+ var acceptsDoubleQuotedStringLiterals: Bool
|
||||
}
|
||||
|
||||
class Database {
|
||||
+ static let suspendNotification: Notification.Name // Experimental
|
||||
+ static let resumeNotification: Notification.Name // Experimental
|
||||
}
|
||||
|
||||
extension DatabaseError {
|
||||
+ var isInterruptionError: Bool { get }
|
||||
}
|
||||
|
||||
protocol DatabaseReader {
|
||||
+ func interrupt()
|
||||
}
|
||||
|
||||
extension SQLSpecificExpressible {
|
||||
+ #if GRDBCUSTOMSQLITE
|
||||
+ var ascNullsLast: SQLOrderingTerm { get }
|
||||
+ var descNullsFirst: SQLOrderingTerm { get }
|
||||
+ #endif
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 4.6.2
|
||||
|
||||
Released November 20, 2019 • [diff](https://github.com/groue/GRDB.swift/compare/v4.6.1...v4.6.2)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- [#653](https://github.com/groue/GRDB.swift/pull/653) by [@michaelkirk-signal](https://github.com/michaelkirk-signal): Fix DatabaseMigrator.appliedMigrations() error on empty database
|
||||
|
||||
|
||||
## 4.6.1
|
||||
|
||||
Released November 10, 2019 • [diff](https://github.com/groue/GRDB.swift/compare/v4.6.0...v4.6.1)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- [#647](https://github.com/groue/GRDB.swift/pull/647): Honor conflict resolution for batch updates
|
||||
|
||||
|
||||
## 4.6.0
|
||||
|
||||
Released November 9, 2019 • [diff](https://github.com/groue/GRDB.swift/compare/v4.5.0...v4.6.0)
|
||||
|
||||
**New**
|
||||
|
||||
- [#646](https://github.com/groue/GRDB.swift/pull/646): Batch updates
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
The [Update Requests](README.md#update-requests) chapter documents the new support for batch updates introduced in the [query interface](README.md#the-query-interface).
|
||||
|
||||
The [Associations Guide](Documentation/AssociationsBasics.md) has gained a new [Ordered Associations](Documentation/AssociationsBasics.md#ordered-associations) chapter which explains how to define ordered HasMany and HasManyThrough associations.
|
||||
|
||||
|
||||
## 4.5.0
|
||||
|
||||
Released October 15, 2019 • [diff](https://github.com/groue/GRDB.swift/compare/v4.4.0...v4.5.0)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- The `DatabaseMigrator.eraseDatabaseOnSchemaChange` option no longer fails when migrations depend on database configuration.
|
||||
- Fixed `DatabasePool.reentrantRead` which was not actually reentrant.
|
||||
- [#631](https://github.com/groue/GRDB.swift/pull/631): Fix custom SQLite builds
|
||||
- [#632](https://github.com/groue/GRDB.swift/pull/632) by [@runhum](https://github.com/runhum): Fix documentation typo
|
||||
|
||||
**New**
|
||||
|
||||
- [#622](https://github.com/groue/GRDB.swift/pull/622): Allow observation of FTS4 virtual tables
|
||||
- [#627](https://github.com/groue/GRDB.swift/pull/627): Swift Package Manager: define SQLite as a system library target
|
||||
- [#633](https://github.com/groue/GRDB.swift/pull/633): SQLITE_ENABLE_PREUPDATE_HOOK support with CocoaPods
|
||||
- [#635](https://github.com/groue/GRDB.swift/pull/635): Sunset FetchedRecordsController
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
The [Support for SQLite Pre-Update Hooks](README.md#support-for-sqlite-pre-update-hooks) chapter has been updated with a way to enable extra GRDB APIs for the SQLITE_ENABLE_PREUPDATE_HOOK option with CocoaPods.
|
||||
|
||||
The [Demo Application](Documentation/DemoApps/GRDBDemoiOS) no longer uses [FetchedRecordsController](Documentation/FetchedRecordsController.md), which has been sunsetted. Instead, it tracks database changes with [ValueObservation](README.md#valueobservation), and animates its table view with the Swift built-in [difference(from:)](https://developer.apple.com/documentation/swift/bidirectionalcollection/3200721-difference) method.
|
||||
|
||||
|
||||
## 4.4.0
|
||||
|
||||
@@ -1231,7 +1814,7 @@ Released September 23, 2018 • [diff](https://github.com/groue/GRDB.swift/co
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- Enhanced visibility of the [Demo Application](DemoApps/GRDBDemoiOS)
|
||||
- Enhanced visibility of the [Demo Application](Documentation/DemoApps/GRDBDemoiOS)
|
||||
|
||||
|
||||
## 3.3.0
|
||||
@@ -1937,7 +2520,7 @@ Released September 17, 2017 • [diff](https://github.com/groue/GRDB.swift/co
|
||||
**Fixed**: restored support for Swift Package Manager
|
||||
|
||||
|
||||
## 2.0
|
||||
## 2.0.0
|
||||
|
||||
Released September 16, 2017 • [diff](https://github.com/groue/GRDB.swift/compare/v1.3.0...v2.0)
|
||||
|
||||
|
||||
@@ -78,14 +78,10 @@ The ideas, in alphabetical order:
|
||||
- [Date and Time Functions]
|
||||
- [Decode NSDecimalNumber from Text Columns]
|
||||
- [Documentation]
|
||||
- [FetchedRecordsController Diffing Algorithm]
|
||||
- [FetchedRecordsController Support for Any Request]
|
||||
- [FetchedRecordsController Support for Sections]
|
||||
- [Full Text Search Demo Application]
|
||||
- [JSON]
|
||||
- [Linux]
|
||||
- [More SQL Generation]
|
||||
- [Reactive Database Observation]
|
||||
- [SQL Console in the Debugger]
|
||||
- [SQLCipher in a Shared App Container]
|
||||
- [Typed Expressions]
|
||||
@@ -205,50 +201,6 @@ Inline documentation, the one which is embedded right into the source code and i
|
||||
If you are a good writer, your help will be very warmly welcomed.
|
||||
|
||||
|
||||
### FetchedRecordsController Diffing Algorithm
|
||||
|
||||
:muscle: Hard
|
||||
|
||||
[FetchedRecordsController] uses a Levenshtein-based diffing algorithm which has a terrible algorithmic complexity. This makes this very useful class unable to deal with more than hundreds of elements.
|
||||
|
||||
There exists much more efficient O(n) diffing algorithms that would lift this limitation.
|
||||
|
||||
Starting points:
|
||||
|
||||
- [RxSwiftCommunity/RxDataSources](https://github.com/RxSwiftCommunity/RxDataSources)
|
||||
- [ra1028/DifferenceKit](https://github.com/ra1028/DifferenceKit)
|
||||
- [tonyarnold/Differ](https://github.com/tonyarnold/Differ)
|
||||
- [onmyway133/DeepDiff](https://github.com/onmyway133/DeepDiff)
|
||||
- [mcudich/HeckelDiff](https://github.com/mcudich/HeckelDiff)
|
||||
|
||||
|
||||
### FetchedRecordsController Support for Any Request
|
||||
|
||||
:muscle: Hard
|
||||
|
||||
[FetchedRecordsController] is able to deal with records, but not with raw rows or values:
|
||||
|
||||
```swift
|
||||
// Supported by FetchedRecordsController
|
||||
let recordRequest = Player.all()
|
||||
|
||||
// Not supported by FetchedRecordsController
|
||||
let stringRequest = Player.select(Column("name"), as: String.self)
|
||||
let rowRequest = SQLRequest<Row>("SELECT ...")
|
||||
```
|
||||
|
||||
This limitation does not apply to [ValueObservation] and [RxGRDB]. It would be nice if FetchedRecordsController would become just as versatile.
|
||||
|
||||
|
||||
### FetchedRecordsController Support for Sections
|
||||
|
||||
:muscle: Hard
|
||||
|
||||
[FetchedRecordsController] mimics the API of Core Data's [NSFetchedResultsController](https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller), but does not yet support table and collection view sections.
|
||||
|
||||
This improvement most certainly depends on a refreshing of the [FetchedRecordsController Diffing Algorithm].
|
||||
|
||||
|
||||
### Full Text Search Demo Application
|
||||
|
||||
:baby: Starter Task :pencil: Documentation
|
||||
@@ -294,15 +246,6 @@ There are several SQLite features that GRDB could natively support:
|
||||
See [issue #575](https://github.com/groue/GRDB.swift/issues/575) for more information and guidance about the implementation of extra table alterations.
|
||||
|
||||
|
||||
### Reactive Database Observation
|
||||
|
||||
:baby: Starter Task
|
||||
|
||||
We already have the [GRDBCombine](http://github.com/groue/GRDBCombine) and [RxGRDB] companion libraries.
|
||||
|
||||
More choices of reactive engines would help more developers enjoy GRDB.
|
||||
|
||||
|
||||
### SQL Console in the Debugger
|
||||
|
||||
:question: Unknown Difficulty :hammer: Tooling
|
||||
@@ -360,17 +303,12 @@ Features that blur this focus are non-goals:
|
||||
[Date and Time Functions]: #date-and-time-functions
|
||||
[Decode NSDecimalNumber from Text Columns]: #decode-nsdecimalnumber-from-text-columns
|
||||
[Documentation]: #documentation
|
||||
[FetchedRecordsController]: README.md#fetchedrecordscontroller
|
||||
[FetchedRecordsController Diffing Algorithm]: #fetchedrecordscontroller-diffing-algorithm
|
||||
[FetchedRecordsController Support for Any Request]: #fetchedrecordscontroller-support-for-any-request
|
||||
[FetchedRecordsController Support for Sections]: #fetchedrecordscontroller-support-for-sections
|
||||
[Full Text Search Demo Application]: #full-text-search-demo-application
|
||||
[How is the Library Organized?]: Documentation/LibraryOrganization.md
|
||||
[How is the Repository Organized?]: Documentation/RepositoryOrganization.md
|
||||
[JSON]: #json
|
||||
[Linux]: #linux
|
||||
[More SQL Generation]: #more-sql-generation
|
||||
[Reactive Database Observation]: #reactive-database-observation
|
||||
[Records: Splitting Database Encoding from Ability to Write in the Database]: #records-splitting-database-encoding-from-ability-to-write-in-the-database
|
||||
[Non-Goals]: #non-goals
|
||||
[Report Bugs]: #report-bugs
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import GRDB
|
||||
|
||||
/// A type responsible for initializing the application database.
|
||||
///
|
||||
/// See AppDelegate.setupDatabase()
|
||||
struct AppDatabase {
|
||||
|
||||
/// Creates a fully initialized database at path
|
||||
static func openDatabase(atPath path: String) throws -> DatabaseQueue {
|
||||
// Connect to the database
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
let dbQueue = try DatabaseQueue(path: path)
|
||||
|
||||
// Define the database schema
|
||||
try migrator.migrate(dbQueue)
|
||||
|
||||
return dbQueue
|
||||
}
|
||||
|
||||
/// The DatabaseMigrator that defines the database schema.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#migrations
|
||||
static var migrator: DatabaseMigrator {
|
||||
var migrator = DatabaseMigrator()
|
||||
|
||||
migrator.registerMigration("createPlayer") { db in
|
||||
// Create a table
|
||||
// See https://github.com/groue/GRDB.swift#create-tables
|
||||
try db.create(table: "player") { t in
|
||||
t.autoIncrementedPrimaryKey("id")
|
||||
|
||||
// Sort player names in a localized case insensitive fashion by default
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#unicode
|
||||
t.column("name", .text).notNull().collate(.localizedCaseInsensitiveCompare)
|
||||
|
||||
t.column("score", .integer).notNull()
|
||||
}
|
||||
}
|
||||
|
||||
migrator.registerMigration("fixtures") { db in
|
||||
// Populate the players table with random data
|
||||
for _ in 0..<8 {
|
||||
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
|
||||
try player.insert(db)
|
||||
}
|
||||
}
|
||||
|
||||
// // Migrations for future application versions will be inserted here:
|
||||
// migrator.registerMigration(...) { db in
|
||||
// ...
|
||||
// }
|
||||
|
||||
return migrator
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import UIKit
|
||||
import GRDB
|
||||
|
||||
// The shared database queue
|
||||
var dbQueue: DatabaseQueue!
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
try! setupDatabase(application)
|
||||
return true
|
||||
}
|
||||
|
||||
private func setupDatabase(_ application: UIApplication) throws {
|
||||
let databaseURL = try FileManager.default
|
||||
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
||||
.appendingPathComponent("db.sqlite")
|
||||
dbQueue = try AppDatabase.openDatabase(atPath: databaseURL.path)
|
||||
|
||||
// Be a nice iOS citizen, and don't consume too much memory
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#memory-management
|
||||
dbQueue.setupMemoryManagement(in: application)
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,63 +0,0 @@
|
||||
import GRDB
|
||||
|
||||
// A plain Player struct
|
||||
struct Player {
|
||||
// Prefer Int64 for auto-incremented database ids
|
||||
var id: Int64?
|
||||
var name: String
|
||||
var score: Int
|
||||
}
|
||||
|
||||
// MARK: - Persistence
|
||||
|
||||
// Turn Player into a Codable Record.
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#records
|
||||
extension Player: Codable, FetchableRecord, MutablePersistableRecord {
|
||||
// Define database columns from CodingKeys
|
||||
private enum Columns {
|
||||
static let id = Column(CodingKeys.id)
|
||||
static let name = Column(CodingKeys.name)
|
||||
static let score = Column(CodingKeys.score)
|
||||
}
|
||||
|
||||
// Update a player id after it has been inserted in the database.
|
||||
mutating func didInsert(with rowID: Int64, for column: String?) {
|
||||
id = rowID
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Database access
|
||||
|
||||
// Define some useful player requests.
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#requests
|
||||
extension Player {
|
||||
static func orderedByName() -> QueryInterfaceRequest<Player> {
|
||||
return Player.order(Columns.name)
|
||||
}
|
||||
|
||||
static func orderedByScore() -> QueryInterfaceRequest<Player> {
|
||||
return Player.order(Columns.score.desc, Columns.name)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Player Randomization
|
||||
|
||||
extension Player {
|
||||
private static let names = [
|
||||
"Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David",
|
||||
"Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette",
|
||||
"Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl",
|
||||
"Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole",
|
||||
"Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul",
|
||||
"Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain",
|
||||
"Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann",
|
||||
"Zazie", "Zoé"]
|
||||
|
||||
static func randomName() -> String {
|
||||
return names.randomElement()!
|
||||
}
|
||||
|
||||
static func randomScore() -> Int {
|
||||
return 10 * Int.random(in: 0...100)
|
||||
}
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
import UIKit
|
||||
import GRDB
|
||||
|
||||
/// PlayersViewController displays the list of players.
|
||||
class PlayersViewController: UITableViewController {
|
||||
private enum PlayerOrdering {
|
||||
case byName
|
||||
case byScore
|
||||
}
|
||||
|
||||
@IBOutlet private weak var newPlayerButtonItem: UIBarButtonItem!
|
||||
private var playersController: FetchedRecordsController<Player>!
|
||||
private var playerCountObserver: TransactionObserver?
|
||||
private var playerOrdering: PlayerOrdering = .byScore {
|
||||
didSet {
|
||||
try! playersController.setRequest(playersRequest)
|
||||
configureOrderingBarButtonItem()
|
||||
}
|
||||
}
|
||||
private var playersRequest: QueryInterfaceRequest<Player> {
|
||||
switch playerOrdering {
|
||||
case .byName:
|
||||
return Player.orderedByName()
|
||||
case .byScore:
|
||||
return Player.orderedByScore()
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
configureToolbar()
|
||||
configureNavigationItem()
|
||||
configureTableView()
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
navigationController?.isToolbarHidden = false
|
||||
}
|
||||
|
||||
private func configureToolbar() {
|
||||
toolbarItems = [
|
||||
UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: #selector(deletePlayers)),
|
||||
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
|
||||
UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(refresh)),
|
||||
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
|
||||
UIBarButtonItem(title: "💣", style: .plain, target: self, action: #selector(stressTest)),
|
||||
]
|
||||
}
|
||||
|
||||
private func configureNavigationItem() {
|
||||
navigationItem.leftBarButtonItems = [editButtonItem, newPlayerButtonItem]
|
||||
configureOrderingBarButtonItem()
|
||||
configureTitle()
|
||||
}
|
||||
|
||||
private func configureOrderingBarButtonItem() {
|
||||
switch playerOrdering {
|
||||
case .byScore:
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
title: "Score ⬇︎",
|
||||
style: .plain,
|
||||
target: self, action: #selector(sortByName))
|
||||
case .byName:
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
title: "Name ⬆︎",
|
||||
style: .plain,
|
||||
target: self, action: #selector(sortByScore))
|
||||
}
|
||||
}
|
||||
|
||||
private func configureTitle() {
|
||||
// Track changes in the number of players
|
||||
let observation = ValueObservation.tracking { db in
|
||||
try Player.fetchCount(db)
|
||||
}
|
||||
playerCountObserver = observation.start(
|
||||
in: dbQueue,
|
||||
onError: { error in
|
||||
fatalError("Unexpected error: \(error)")
|
||||
},
|
||||
onChange: { [unowned self] count in
|
||||
switch count {
|
||||
case 0: self.navigationItem.title = "No Player"
|
||||
case 1: self.navigationItem.title = "1 Player"
|
||||
default: self.navigationItem.title = "\(count) Players"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private func configureTableView() {
|
||||
// Track changes in the database players
|
||||
playersController = try! FetchedRecordsController(dbQueue, request: playersRequest)
|
||||
|
||||
// Animate changes in the table view
|
||||
playersController.trackChanges(
|
||||
willChange: { [unowned self] _ in
|
||||
self.tableView.beginUpdates()
|
||||
},
|
||||
onChange: { [unowned self] (controller, record, change) in
|
||||
switch change {
|
||||
case .insertion(let indexPath):
|
||||
self.tableView.insertRows(at: [indexPath], with: .fade)
|
||||
|
||||
case .deletion(let indexPath):
|
||||
self.tableView.deleteRows(at: [indexPath], with: .fade)
|
||||
|
||||
case .update(let indexPath, _):
|
||||
if let cell = self.tableView.cellForRow(at: indexPath) {
|
||||
self.configure(cell, at: indexPath)
|
||||
}
|
||||
|
||||
case .move(let indexPath, let newIndexPath, _):
|
||||
// Actually move cells around for more demo effect :-)
|
||||
let cell = self.tableView.cellForRow(at: indexPath)
|
||||
self.tableView.moveRow(at: indexPath, to: newIndexPath)
|
||||
if let cell = cell {
|
||||
self.configure(cell, at: newIndexPath)
|
||||
}
|
||||
|
||||
// A quieter animation:
|
||||
// self.tableView.deleteRows(at: [indexPath], with: .fade)
|
||||
// self.tableView.insertRows(at: [newIndexPath], with: .fade)
|
||||
}
|
||||
},
|
||||
didChange: { [unowned self] _ in
|
||||
self.tableView.endUpdates()
|
||||
})
|
||||
|
||||
// Initial fetch
|
||||
try! playersController.performFetch()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Navigation
|
||||
|
||||
extension PlayersViewController {
|
||||
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if segue.identifier == "Edit" {
|
||||
let player = playersController.record(at: tableView.indexPathForSelectedRow!)
|
||||
let controller = segue.destination as! PlayerEditionViewController
|
||||
controller.title = player.name
|
||||
controller.player = player
|
||||
controller.presentation = .push
|
||||
}
|
||||
else if segue.identifier == "New" {
|
||||
setEditing(false, animated: true)
|
||||
let navigationController = segue.destination as! UINavigationController
|
||||
let controller = navigationController.viewControllers.first as! PlayerEditionViewController
|
||||
controller.title = "New Player"
|
||||
controller.player = Player(id: nil, name: "", score: 0)
|
||||
controller.presentation = .modal
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func cancelPlayerEdition(_ segue: UIStoryboardSegue) {
|
||||
// Player creation cancelled
|
||||
}
|
||||
|
||||
@IBAction func commitPlayerEdition(_ segue: UIStoryboardSegue) {
|
||||
// Player creation committed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - UITableViewDataSource
|
||||
|
||||
extension PlayersViewController {
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return playersController.sections.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return playersController.sections[section].numberOfRecords
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "Player", for: indexPath)
|
||||
configure(cell, at: indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
|
||||
// Delete the player
|
||||
let player = playersController.record(at: indexPath)
|
||||
try! dbQueue.write { db in
|
||||
_ = try player.delete(db)
|
||||
}
|
||||
}
|
||||
|
||||
private func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
|
||||
let player = playersController.record(at: indexPath)
|
||||
if player.name.isEmpty {
|
||||
cell.textLabel?.text = "-"
|
||||
} else {
|
||||
cell.textLabel?.text = player.name
|
||||
}
|
||||
cell.detailTextLabel?.text = abs(player.score) > 1 ? "\(player.score) points" : "0 point"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
extension PlayersViewController {
|
||||
@IBAction func sortByName() {
|
||||
setEditing(false, animated: true)
|
||||
playerOrdering = .byName
|
||||
}
|
||||
|
||||
@IBAction func sortByScore() {
|
||||
setEditing(false, animated: true)
|
||||
playerOrdering = .byScore
|
||||
}
|
||||
|
||||
@IBAction func deletePlayers() {
|
||||
setEditing(false, animated: true)
|
||||
try! dbQueue.write { db in
|
||||
_ = try Player.deleteAll(db)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func refresh() {
|
||||
setEditing(false, animated: true)
|
||||
refreshPlayers()
|
||||
}
|
||||
|
||||
@IBAction func stressTest() {
|
||||
setEditing(false, animated: true)
|
||||
for _ in 0..<50 {
|
||||
DispatchQueue.global().async {
|
||||
self.refreshPlayers()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func refreshPlayers() {
|
||||
try! dbQueue.write { db in
|
||||
if try Player.fetchCount(db) == 0 {
|
||||
// Insert new random players
|
||||
for _ in 0..<8 {
|
||||
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
|
||||
try player.insert(db)
|
||||
}
|
||||
} else {
|
||||
// Insert a player
|
||||
if Bool.random() {
|
||||
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
|
||||
try player.insert(db)
|
||||
}
|
||||
// Delete a random player
|
||||
if Bool.random() {
|
||||
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
|
||||
}
|
||||
// Update some players
|
||||
for var player in try Player.fetchAll(db) where Bool.random() {
|
||||
player.score = Player.randomScore()
|
||||
try player.update(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
Demo Application
|
||||
================
|
||||
|
||||
<img align="right" src="https://github.com/groue/GRDB.swift/raw/master/Documentation/Images/GRDBDemoScreenshot.png" width="50%">
|
||||
|
||||
**This demo application shows you:**
|
||||
|
||||
- how to setup a database in an iOS app
|
||||
- how to define a simple [Codable Record](../../README.md#codable-records)
|
||||
- how to track database changes and animate a table view with [FetchedRecordsController](../../README.md#fetchedrecordscontroller).
|
||||
|
||||
**Files of interest:**
|
||||
|
||||
- [AppDelegate.swift](GRDBDemoiOS/AppDelegate.swift)
|
||||
|
||||
`AppDelegate` creates, on application startup, a unique instance of [DatabaseQueue](../../README.md#database-queues) available for the whole application.
|
||||
|
||||
- [AppDatabase.swift](GRDBDemoiOS/AppDatabase.swift)
|
||||
|
||||
`AppDatabase` defines the database for the whole application. It uses [DatabaseMigrator](../../README.md#migrations) in order to setup the database schema.
|
||||
|
||||
- [Player.swift](GRDBDemoiOS/Player.swift)
|
||||
|
||||
`Player` is a [Record](../../README.md#records) type, able to read and write in the database. It conforms to the standard Codable protocol in order to gain all advantages of [Codable Records](../../README.md#codable-records).
|
||||
|
||||
- [PlayersViewController.swift](GRDBDemoiOS/PlayersViewController.swift)
|
||||
|
||||
`PlayersViewController` displays a list of players. It keeps its title up-to-date with [ValueObservation](../../README.md#valueobservation), and animates its table view according to database changes with [FetchedRecordsController](../../README.md#fetchedrecordscontroller).
|
||||
|
||||
- [PlayerEditionViewController.swift](GRDBDemoiOS/PlayerEditionViewController.swift)
|
||||
|
||||
`PlayerEditionViewController` can create or edit a player, and save it in the database.
|
||||
@@ -0,0 +1,4 @@
|
||||
Sharing a Database in an App Group Container
|
||||
============================================
|
||||
|
||||
This guide [has moved](SharingADatabase.md).
|
||||
@@ -11,6 +11,7 @@ GRDB Associations
|
||||
- [HasOneThrough]
|
||||
- [Choosing Between BelongsTo and HasOne]
|
||||
- [Self Joins]
|
||||
- [Associations to Common Table Expressions]
|
||||
- [Associations and the Database Schema]
|
||||
- [Convention for Database Table Names]
|
||||
- [Convention for the BelongsTo Association]
|
||||
@@ -23,6 +24,7 @@ GRDB Associations
|
||||
- [Combining Associations]
|
||||
- [Filtering Associations]
|
||||
- [Sorting Associations]
|
||||
- [Ordered Associations]
|
||||
- [Columns Selected by an Association]
|
||||
- [Table Aliases]
|
||||
- [Refining Association Requests]
|
||||
@@ -38,7 +40,14 @@ GRDB Associations
|
||||
- [Aggregate Operations]
|
||||
- [Isolation of Multiple Aggregates]
|
||||
- [DerivableRequest Protocol]
|
||||
- [Known Issues]
|
||||
|
||||
**[FAQ]**
|
||||
|
||||
- [How do I filter records and only keep those that are associated to another record?](../README.md#how-do-i-filter-records-and-only-keep-those-that-are-associated-to-another-record)
|
||||
- [How do I filter records and only keep those that are NOT associated to another record?](../README.md#how-do-i-filter-records-and-only-keep-those-that-are-not-associated-to-another-record)
|
||||
- [How do I select only one column of an associated record?](../README.md#how-do-i-select-only-one-column-of-an-associated-record)
|
||||
|
||||
**[Known Issues]**
|
||||
|
||||
|
||||
## Associations Benefits
|
||||
@@ -90,14 +99,14 @@ With GRDB associations, we can streamline these operations (and others), by decl
|
||||
extension Author {
|
||||
static let books = hasMany(Book.self)
|
||||
var books: QueryInterfaceRequest<Book> {
|
||||
return request(for: Author.books)
|
||||
request(for: Author.books)
|
||||
}
|
||||
}
|
||||
|
||||
extension Book {
|
||||
static let author = belongsTo(Author.self)
|
||||
var author: QueryInterfaceRequest<Author> {
|
||||
return request(for: Book.author)
|
||||
request(for: Book.author)
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -108,7 +117,7 @@ Loading all books from an existing author is now easier:
|
||||
let books = try author.books.fetchAll(db)
|
||||
```
|
||||
|
||||
As for loading all pairs of books and authors, it is not only easier, but also *far much efficient*:
|
||||
As for loading all pairs of books and authors, it is not only easier, but also *much more efficient*:
|
||||
|
||||
```swift
|
||||
struct BookInfo: FetchableRecord, Decodable {
|
||||
@@ -164,7 +173,7 @@ Generally speaking, associations use the [TableRecord], [FetchableRecord], and [
|
||||
extension Book: EncodableRecord {
|
||||
// The request for the author of a book.
|
||||
var author: QueryInterfaceRequest<Author> {
|
||||
return request(for: Book.author)
|
||||
request(for: Book.author)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,17 +192,20 @@ Generally speaking, associations use the [TableRecord], [FetchableRecord], and [
|
||||
The Types of Associations
|
||||
=========================
|
||||
|
||||
GRDB handles five types of associations:
|
||||
GRDB handles several types of associations:
|
||||
|
||||
- **BelongsTo**
|
||||
- **HasMany**
|
||||
- **HasOne**
|
||||
- **HasManyThrough**
|
||||
- **HasOneThrough**
|
||||
- **Associations to common table expressions**
|
||||
|
||||
An association declares a link from a record type to another, as in "one book **belongs to** its author". It instructs GRDB to use the foreign keys declared in the database as support for Swift methods.
|
||||
An association generally declares a link from a record type to another, as in "one book **belongs to** its author". It instructs GRDB to use the foreign keys declared in the database as support for Swift methods.
|
||||
|
||||
Each one of the three types of associations is appropriate for a particular database situation.
|
||||
Each one of these associations is appropriate for a particular database situation.
|
||||
|
||||
Associations to [common table expressions] are specific enough and are documented in [Associations to Common Table Expressions].
|
||||
|
||||
- [BelongsTo]
|
||||
- [HasMany]
|
||||
@@ -282,7 +294,7 @@ See [Convention for the HasOne Association] for some sample code that defines th
|
||||
The **HasManyThrough** association is often used to set up a many-to-many connection with another record. This association indicates that the declaring record can be matched with zero or more instances of another record by proceeding through a third record. For example, consider the practice of passport delivery. The relevant association declarations could look like this:
|
||||
|
||||
```swift
|
||||
struct Country: TableRecord, EncodableRecord {
|
||||
struct Country: TableRecord {
|
||||
static let passports = hasMany(Passport.self)
|
||||
static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
|
||||
...
|
||||
@@ -293,7 +305,7 @@ struct Passport: TableRecord {
|
||||
static let citizen = belongsTo(Citizen.self)
|
||||
}
|
||||
|
||||
struct Citizen: TableRecord, EncodableRecord {
|
||||
struct Citizen: TableRecord {
|
||||
static let passports = hasMany(Passport.self)
|
||||
static let countries = hasMany(Country.self, through: passports, using: Passport.country)
|
||||
...
|
||||
@@ -326,7 +338,7 @@ As in the examples above, **HasManyThrough** association is always built from tw
|
||||
```swift
|
||||
struct Document: TableRecord {
|
||||
static let paragraphs = hasMany(
|
||||
Paragraph.self,
|
||||
Paragraph.self,
|
||||
through: Document.hasMany(Section.self),
|
||||
using: Section.hasMany(Paragraph.self))
|
||||
...
|
||||
@@ -341,9 +353,9 @@ See [Building Requests from Associations] in order to learn how to use the HasMa
|
||||
A **HasOneThrough** association sets up a one-to-one connection with another record. This association indicates that the declaring record can be matched with one instance of another record by proceeding through a third record. For example, if each book belongs to a library, and each library has one address, then one knows where the book should be returned to:
|
||||
|
||||
```swift
|
||||
struct Book: TableRecord, EncodableRecord {
|
||||
struct Book: TableRecord {
|
||||
static let library = belongsTo(Library.self)
|
||||
static let returnAddress = hasOne(Address.self, through: library, using: library.address)
|
||||
static let returnAddress = hasOne(Address.self, through: library, using: Library.address)
|
||||
...
|
||||
}
|
||||
|
||||
@@ -685,7 +697,7 @@ See [Foreign Keys] for more information.
|
||||
|
||||
**Associations can automatically infer the foreign keys that define how two database tables are linked together.**
|
||||
|
||||
In the example below, the `book.authorId` column is automatically used to link a book to its author:
|
||||
In the example below, the `book.authorId` column is automatically used to link a book to its author, because the database schema defines a foreign key between the book and author database tables (see [Convention for the BelongsTo Association]).
|
||||
|
||||

|
||||
|
||||
@@ -699,7 +711,9 @@ struct Author: TableRecord {
|
||||
}
|
||||
```
|
||||
|
||||
But this requires the database schema to define a foreign key between the book and author database tables (see [Convention for the BelongsTo Association]).
|
||||
> :point_up: **Note**: Generally speaking, all foreign keys are supported, including composite keys that span several columns.
|
||||
>
|
||||
> :warning: **Warning**: SQLite voids foreign key constraints when one or more of a foreign key column is NULL (see [SQLite Foreign Key Support](https://www.sqlite.org/foreignkeys.html)). GRDB does not match foreign keys that involve a NULL value either.
|
||||
|
||||
Sometimes the database schema does not define any foreign key. And sometimes, there are *several* foreign keys from a table to another.
|
||||
|
||||
@@ -765,6 +779,7 @@ Fetch requests do not visit the database until you fetch values from them. This
|
||||
- [Combining Associations]
|
||||
- [Filtering Associations]
|
||||
- [Sorting Associations]
|
||||
- [Ordered Associations]
|
||||
- [Columns Selected by an Association]
|
||||
- [Table Aliases]
|
||||
- [Refining Association Requests]
|
||||
@@ -783,7 +798,7 @@ struct Book: TableRecord, EncodableRecord {
|
||||
|
||||
/// The request for the author of a book
|
||||
var author: QueryInterfaceRequest<Author> {
|
||||
return request(for: Book.author)
|
||||
request(for: Book.author)
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -804,7 +819,7 @@ struct Author: TableRecord, EncodableRecord {
|
||||
|
||||
/// The request for the books of an author
|
||||
var books: QueryInterfaceRequest<Book> {
|
||||
return request(for: Author.books)
|
||||
request(for: Author.books)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1109,6 +1124,104 @@ let request = Book
|
||||
Those extra sorting options require **[Table Aliases]**, introduced below.
|
||||
|
||||
|
||||
## Ordered Associations
|
||||
|
||||
By default, **[HasMany]** or **[HasManyThrough]** associations are unordered: the order of associated records is undefined unless [explicitly specified](#sorting-associations) on each request.
|
||||
|
||||
But you can build an ordering right into the definition of an association, so that it becomes the default ordering for this association. For example, let's model soccer teams and players, ordered by the number printed on their shirt.
|
||||
|
||||
Let's start with a **HasMany** association. Each player knows its position in its team:
|
||||
|
||||
```swift
|
||||
struct Team: FetchableRecord, TableRecord {
|
||||
var id: Int64
|
||||
var name: String
|
||||
}
|
||||
|
||||
struct Player: FetchableRecord, TableRecord {
|
||||
var id: Int64
|
||||
var teamId: Int64
|
||||
var name: String
|
||||
var position: Int
|
||||
}
|
||||
```
|
||||
|
||||
The `Team.players` association is ordered by position, so that all team players are loaded well-sorted by default:
|
||||
|
||||
```swift
|
||||
extension Team {
|
||||
static let players = hasMany(Player.self).order(Column("position"))
|
||||
|
||||
var players: QueryInterfaceRequest<Player> {
|
||||
request(for: Team.players)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Things are very similar for **HasManyThrough** associations. Now each player knows its position in the teams it belongs to:
|
||||
|
||||
```swift
|
||||
struct Team: FetchableRecord, TableRecord {
|
||||
var id: Int64
|
||||
var name: String
|
||||
}
|
||||
|
||||
struct PlayerRole: FetchableRecord, TableRecord {
|
||||
var teamId: Int64
|
||||
var playerId: Int64
|
||||
var position: Int
|
||||
}
|
||||
|
||||
struct Player: FetchableRecord, TableRecord {
|
||||
var id: Int64
|
||||
var name: String
|
||||
}
|
||||
```
|
||||
|
||||
Again, the `Team.players` association is ordered by position, so that all team players are loaded well-sorted by default:
|
||||
|
||||
```swift
|
||||
extension Team {
|
||||
static let playerRoles = hasMany(PlayerRole.self).order(Column("position"))
|
||||
|
||||
static let players = hasMany(Player.self, through: playerRoles, using: PlayerRole.player)
|
||||
|
||||
var players: QueryInterfaceRequest<Player> {
|
||||
request(for: Team.players)
|
||||
}
|
||||
}
|
||||
|
||||
extension PlayerRole {
|
||||
static let player = belongsTo(Player.self)
|
||||
}
|
||||
```
|
||||
|
||||
In both cases, you can escape the default ordering when you need it:
|
||||
|
||||
```swift
|
||||
struct TeamInfo: Decodable, FetchableRecord {
|
||||
var team: Team
|
||||
var players: [Player]
|
||||
}
|
||||
|
||||
// Default ordering by position
|
||||
let team: Team = ...
|
||||
let players = try team.players.fetchAll(db)
|
||||
let teamInfos = try Team
|
||||
.including(all: Team.players)
|
||||
.asRequest(of: TeamInfo.self)
|
||||
.fetchAll(db)
|
||||
|
||||
// Custom ordering
|
||||
let team: Team = ...
|
||||
let players = try team.players.order(Column("name")).fetchAll(db)
|
||||
let teamInfos = try Team
|
||||
.including(all: Team.players.order(Column("name")))
|
||||
.asRequest(of: TeamInfo.self)
|
||||
.fetchAll(db)
|
||||
```
|
||||
|
||||
|
||||
## Columns Selected by an Association
|
||||
|
||||
By default, associated records include all their columns:
|
||||
@@ -1227,63 +1340,6 @@ let request = Book.aliased(bookAlias)
|
||||
|
||||
## Refining Association Requests
|
||||
|
||||
You can join and include an association several times in a single request. This can help you craft complex requests in a modular way.
|
||||
|
||||
Let's say, for example, that your application needs all books, along with their Spanish authors, sorted by author name and then by title. That's already pretty complex.
|
||||
|
||||
This request can be built in a single shot:
|
||||
|
||||
```swift
|
||||
let authorAlias = TableAlias()
|
||||
let request = Book
|
||||
.including(required: Book.author
|
||||
.filter(Column("countryCode") == "ES")
|
||||
.aliased(authorAlias))
|
||||
.order(authorAlias[Column("name")], Column("title"))
|
||||
```
|
||||
|
||||
The same request can also be built in three distinct steps, as below:
|
||||
|
||||
```swift
|
||||
// 1. include author
|
||||
var request = Book.including(required: Book.author)
|
||||
|
||||
// 2. filter by author country
|
||||
request = request.joining(required: Book.author.filter(Column("countryCode") == "ES"))
|
||||
|
||||
// 3. sort by author name and then title
|
||||
let authorAlias = TableAlias()
|
||||
request = request
|
||||
.joining(optional: Book.author.aliased(authorAlias))
|
||||
.order(authorAlias[Column("name")], Column("title"))
|
||||
```
|
||||
|
||||
See how the `Book.author` has been joined or included, on each step, independently, for a different purpose. We can wrap those steps in an extension to the `QueryInterfaceRequest<Book>` type:
|
||||
|
||||
```swift
|
||||
extension QueryInterfaceRequest where T == Book {
|
||||
func filter(authorCountryCode: String) -> QueryInterfaceRequest<Book> {
|
||||
let filteredAuthor = Book.author.filter(Column("countryCode") == countryCode)
|
||||
return joining(required: filteredAuthor)
|
||||
}
|
||||
|
||||
func orderedByAuthorNameAndTitle() -> QueryInterfaceRequest<Book> {
|
||||
let authorAlias = TableAlias()
|
||||
return joining(optional: Book.author.aliased(authorAlias))
|
||||
.order(authorAlias[Column("name")], Column("title"))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And now our complex request looks much simpler:
|
||||
|
||||
```swift
|
||||
let request = Book
|
||||
.including(required: Book.author)
|
||||
.filter(authorCountryCode: "ES")
|
||||
.orderedByAuthorNameAndTitle()
|
||||
```
|
||||
|
||||
When you join or include an association several times, with the same **[association key](#the-structure-of-a-joined-request)**, GRDB will apply the following rules:
|
||||
|
||||
- `including` wins over `joining`:
|
||||
@@ -1331,6 +1387,60 @@ When you join or include an association several times, with the same **[associat
|
||||
.including(optional: association.select(selection2))
|
||||
```
|
||||
|
||||
**Those rules exist so that you can design fluent interfaces that build complex requests out of simple building blocks.**
|
||||
|
||||
For example, we can start by defining base requests as extensions to the [DerivableRequest Protocol]:
|
||||
|
||||
```swift
|
||||
// Author requests
|
||||
extension DerivableRequest where RowDecoder == Author {
|
||||
/// Filters authors by country
|
||||
func filter(country: String) -> Self {
|
||||
filter(Column("country") == country)
|
||||
}
|
||||
}
|
||||
|
||||
// Book requests
|
||||
extension DerivableRequest where RowDecoder == Book {
|
||||
/// Filters books by author country
|
||||
func filter(authorCountry: String) -> Self {
|
||||
joining(required: Book.author.filter(country: country))
|
||||
}
|
||||
|
||||
/// Order books by author name and then book title
|
||||
func orderedByAuthorNameAndYear() -> Self {
|
||||
let authorAlias = TableAlias()
|
||||
return self
|
||||
.joining(optional: Book.author.aliased(authorAlias))
|
||||
.order(
|
||||
authorAlias[Column("name")].collating(.localizedCaseInsensitiveCompare),
|
||||
Column("year"))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And then compose those in a fluent style:
|
||||
|
||||
```swift
|
||||
struct BookInfo: FetchableRecord, Decodable {
|
||||
var book: Book
|
||||
var author: Author
|
||||
}
|
||||
|
||||
// SELECT book.*, author.*
|
||||
// FROM book
|
||||
// JOIN author ON author.id = book.authorId AND author.country = 'FR'
|
||||
// ORDER BY author.name COLLATE ..., book.year
|
||||
let bookInfos = try Book.all()
|
||||
.filter(authorCountry: "FR")
|
||||
.orderedByAuthorNameAndYear()
|
||||
.including(required: Book.author)
|
||||
.asRequest(of: BookInfo.self)
|
||||
.fetchAll(db)
|
||||
```
|
||||
|
||||
Remember that those refinement rules only apply when an association is joined or included several times, with the same **[association key](#the-structure-of-a-joined-request)**. Changing this key stops merging associations together. See [Isolation of Multiple Aggregates] for a longer discussion.
|
||||
|
||||
|
||||
Fetching Values from Associations
|
||||
=================================
|
||||
@@ -1343,31 +1453,14 @@ Often, you'll also make it adopt the standard Decodable protocol, because the co
|
||||
|
||||
Each association included in the request can feed a property of the decoded record:
|
||||
|
||||
- `including(all:)` feeds an Array or Set property:
|
||||
|
||||
```swift
|
||||
// All authors with their books
|
||||
let request = Author.including(all: Author.books)
|
||||
|
||||
struct AuthorInfo: FetchableRecord, Decodable {
|
||||
var author: Author
|
||||
var books: [Book] // all associated books
|
||||
}
|
||||
let authorInfos: [AuthorInfo] = try AuthorInfo.fetchAll(db, request)
|
||||
```
|
||||
|
||||
- `including(optional:)` feeds an optional property:
|
||||
|
||||
```swift
|
||||
// All employees with their manager and subordinate
|
||||
let request = Employee
|
||||
.including(optional: Employee.manager)
|
||||
.including(all: Employee.subordinates)
|
||||
let request = Employee.including(optional: Employee.manager)
|
||||
|
||||
struct EmployeeInfo: FetchableRecord, Decodable {
|
||||
var employee: Employee
|
||||
var manager: Employee? // the optional manager
|
||||
var subordinates: Set<Employee>
|
||||
var manager: Employee? // the optional associated manager
|
||||
}
|
||||
let employeeInfos: [EmployeeInfo] = try EmployeeInfo.fetchAll(db, request)
|
||||
```
|
||||
@@ -1375,22 +1468,28 @@ Each association included in the request can feed a property of the decoded reco
|
||||
- `including(required:)` feeds an non-optional property:
|
||||
|
||||
```swift
|
||||
// All books with information about their author, country, and cover image:
|
||||
let request = Book
|
||||
.including(required: Book.author
|
||||
.including(optional: Author.country))
|
||||
.including(optional: Book.coverImage)
|
||||
let request = Book.including(required: Book.author)
|
||||
|
||||
struct BookInfo: FetchableRecord, Decodable {
|
||||
var book: Book
|
||||
var author: Author // the required author
|
||||
var country: Country?
|
||||
var coverImage: CoverImage?
|
||||
var author: Author // the required associated author
|
||||
}
|
||||
|
||||
let bookInfos: [BookInfo] = try BookInfo.fetchAll(db, request)
|
||||
```
|
||||
|
||||
- `including(all:)` feeds an Array or Set property:
|
||||
|
||||
```swift
|
||||
let request = Author.including(all: Author.books)
|
||||
|
||||
struct AuthorInfo: FetchableRecord, Decodable {
|
||||
var author: Author
|
||||
var books: [Book] // all associated books
|
||||
}
|
||||
let authorInfos: [AuthorInfo] = try AuthorInfo.fetchAll(db, request)
|
||||
```
|
||||
|
||||
- [The Structure of a Joined Request]
|
||||
- [Decoding a Joined Request with a Decodable Record]
|
||||
- [Decoding a Joined Request with FetchableRecord]
|
||||
@@ -1524,8 +1623,7 @@ And who is the most able to know those coding keys? BookInfo itself, thanks to i
|
||||
```swift
|
||||
extension BookInfo {
|
||||
static func all() -> QueryInterfaceRequest<BookInfo> {
|
||||
return Book
|
||||
.including(optional: Book.coverImage)
|
||||
Book.including(optional: Book.coverImage)
|
||||
.including(required: Book.author
|
||||
.forKey(CodingKeys.authorInfo) // (1)
|
||||
.including(optional: Person.country))
|
||||
@@ -1545,7 +1643,7 @@ let bookInfos = try BookInfo.all().fetchAll(db, request) // [BookInfo]
|
||||
|
||||
## Decoding a Joined Request with FetchableRecord
|
||||
|
||||
When [Dedocable](#decoding-a-joined-request-with-a-decodable-record) records provides convenient decoding of joined rows, you may want a little more control over row decoding.
|
||||
When [Decodable](#decoding-a-joined-request-with-a-decodable-record) records provides convenient decoding of joined rows, you may want a little more control over row decoding.
|
||||
|
||||
The `init(row:)` initializer of the [FetchableRecord] protocol is what you look after:
|
||||
|
||||
@@ -1672,7 +1770,7 @@ When you need to compute aggregates **from a single record**, you use [regular a
|
||||
struct Author: TableRecord, EncodableRecord {
|
||||
static let books = hasMany(Book.self)
|
||||
var books: QueryInterfaceRequest<Book> {
|
||||
return request(for: Author.books)
|
||||
request(for: Author.books)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1745,7 +1843,7 @@ struct AuthorInfo: Decodable, FetchableRecord {
|
||||
}
|
||||
|
||||
// SELECT author.*,
|
||||
// COUNT(DISTINCT book.rowid) AS bookCount,
|
||||
// COUNT(DISTINCT book.id) AS bookCount,
|
||||
// MAX(book.year) AS maxBookYear,
|
||||
// FROM author
|
||||
// LEFT JOIN book ON book.authorId = author.id
|
||||
@@ -1838,7 +1936,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING COUNT(DISTINCT book.rowid) = 0
|
||||
HAVING COUNT(DISTINCT book.id) = 0
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1857,7 +1955,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING COUNT(DISTINCT book.rowid) > 0
|
||||
HAVING COUNT(DISTINCT book.id) > 0
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1876,7 +1974,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING COUNT(DISTINCT book.rowid) >= 2
|
||||
HAVING COUNT(DISTINCT book.id) >= 2
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1914,7 +2012,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id AND book.kind = 'novel'
|
||||
GROUP BY author.id
|
||||
HAVING COUNT(DISTINCT book.rowid) > 0
|
||||
HAVING COUNT(DISTINCT book.id) > 0
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1935,7 +2033,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
LEFT JOIN painting ON painting.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING COUNT(DISTINCT book.rowid) > COUNT(DISTINCT painting.rowid)
|
||||
HAVING COUNT(DISTINCT book.id) > COUNT(DISTINCT painting.id)
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1955,7 +2053,7 @@ The `having(_:)` method filters a request according to an aggregated value. You
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
LEFT JOIN painting ON painting.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING ((COUNT(DISTINCT book.rowid) = 0) AND (COUNT(DISTINCT painting.rowid) > 0))
|
||||
HAVING ((COUNT(DISTINCT book.id) = 0) AND (COUNT(DISTINCT painting.id) > 0))
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -1980,7 +2078,7 @@ Aggregates can be modified and combined with Swift operators:
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
LEFT JOIN painting ON painting.authorId = author.id
|
||||
GROUP BY author.id
|
||||
HAVING ((COUNT(DISTINCT book.rowid) = 0) AND (COUNT(DISTINCT painting.rowid) = 0))
|
||||
HAVING ((COUNT(DISTINCT book.id) = 0) AND (COUNT(DISTINCT painting.id) = 0))
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -2016,8 +2114,8 @@ Aggregates can be modified and combined with Swift operators:
|
||||
|
||||
```sql
|
||||
SELECT author.*,
|
||||
(COUNT(DISTINCT book.rowid) +
|
||||
COUNT(DISTINCT painting.rowid)) AS workCount
|
||||
(COUNT(DISTINCT book.id) +
|
||||
COUNT(DISTINCT painting.id)) AS workCount
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
LEFT JOIN painting ON painting.authorId = author.id
|
||||
@@ -2098,7 +2196,7 @@ In this other example, the `Author.books` and `Author.paintings` have the distin
|
||||
|
||||
```sql
|
||||
SELECT author.*,
|
||||
(COUNT(DISTINCT book.rowid) + COUNT(DISTINCT painting.rowid)) AS workCount
|
||||
(COUNT(DISTINCT book.id) + COUNT(DISTINCT painting.id)) AS workCount
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
LEFT JOIN painting ON painting.authorId = author.id
|
||||
@@ -2133,8 +2231,8 @@ But in the following example, we use the same association `Author.books` twice,
|
||||
|
||||
```sql
|
||||
SELECT author.*,
|
||||
COUNT(DISTINCT book1.rowid) AS novelCount,
|
||||
COUNT(DISTINCT book2.rowid) AS theatrePlayCount
|
||||
COUNT(DISTINCT book1.id) AS novelCount,
|
||||
COUNT(DISTINCT book2.id) AS theatrePlayCount
|
||||
FROM author
|
||||
LEFT JOIN book book1 ON book1.authorId = author.id AND book1.kind = 'novel'
|
||||
LEFT JOIN book book2 ON book2.authorId = author.id AND book2.kind = 'theatrePlay'
|
||||
@@ -2173,8 +2271,8 @@ But in the following example, we use the same association `Author.books` twice,
|
||||
|
||||
```sql
|
||||
SELECT author.*,
|
||||
COUNT(DISTINCT book.rowid) AS novelCount,
|
||||
COUNT(DISTINCT book.rowid) AS theatrePlayCount
|
||||
COUNT(DISTINCT book.id) AS novelCount,
|
||||
COUNT(DISTINCT book.id) AS theatrePlayCount
|
||||
FROM author
|
||||
LEFT JOIN book ON book.authorId = author.id
|
||||
AND (book.kind = 'novel' AND book.kind = 'theatrePlay')
|
||||
@@ -2202,35 +2300,40 @@ But in the following example, we use the same association `Author.books` twice,
|
||||
|
||||
The `DerivableRequest` protocol is adopted by both [query interface requests] such as `Author.all()` and associations such as `Book.author`. It is intended for you to use as a customization point when you want to extend the built-in GRDB apis.
|
||||
|
||||
For example:
|
||||
For example, we may want to define `orderedByName()` and `filter(country:)` request methods that make our requests easier to read:
|
||||
|
||||
```swift
|
||||
// Authors sorted by name
|
||||
let request = Author.all().orderedByName()
|
||||
|
||||
// French authors ordered by name
|
||||
let request = Author.all().filter(country: "FR").orderedByName()
|
||||
|
||||
// Spanish books
|
||||
let request = Book.all().filter(country: "ES")
|
||||
```
|
||||
|
||||
Those methods are defined on extensions to the `DerivableRequest` protocol:
|
||||
|
||||
```swift
|
||||
extension DerivableRequest where RowDecoder == Author {
|
||||
func filter(country: String) -> Self {
|
||||
return filter(Column("country") == country)
|
||||
filter(Column("country") == country)
|
||||
}
|
||||
|
||||
func orderByFullName() -> Self {
|
||||
return order(
|
||||
Column("lastName").collating(.localizedCaseInsensitiveCompare),
|
||||
Column("firstName").collating(.localizedCaseInsensitiveCompare))
|
||||
func orderedByName() -> Self {
|
||||
order(Column("name").collating(.localizedCaseInsensitiveCompare))
|
||||
}
|
||||
}
|
||||
|
||||
extension DerivableRequest where RowDecoder == Book {
|
||||
func filter(country: String) -> Self {
|
||||
joining(required: Book.author.filter(country: country))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Thanks to DerivableRequest, both the `filter(country:)` and `orderByFullName()` methods are now available for both Author-based requests and associations:
|
||||
|
||||
```swift
|
||||
// French authors sorted by full name:
|
||||
let request = Author.all()
|
||||
.filter(country: "FR")
|
||||
.orderByFullName()
|
||||
|
||||
// French books, sorted by full name of author:
|
||||
let request = Book.joining(required: Book.author
|
||||
.filter(country: "FR")
|
||||
.orderByFullName())
|
||||
```
|
||||
See [Good Practices for Designing Record Types] for more information.
|
||||
|
||||
|
||||
## Known Issues
|
||||
@@ -2276,7 +2379,7 @@ let request = Book.joining(required: Book.author
|
||||
.including(all: Country.passports
|
||||
.including(required: Passport.citizen))
|
||||
```
|
||||
|
||||
|
||||
Come [discuss](http://twitter.com/groue) for more information, or if you wish to help turning those missing features into reality.
|
||||
|
||||
---
|
||||
@@ -2289,7 +2392,7 @@ This documentation owns a lot to the [Active Record Associations](http://guides.
|
||||
|
||||
**GRDB**
|
||||
|
||||
Copyright (C) 2019 Gwendal Roué
|
||||
Copyright (C) 2015-2020 Gwendal Roué
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
@@ -2329,9 +2432,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
[HasOneThrough]: #hasonethrough
|
||||
[Choosing Between BelongsTo and HasOne]: #choosing-between-belongsto-and-hasone
|
||||
[Self Joins]: #self-joins
|
||||
[Ordered Associations]: #ordered-associations
|
||||
[The Types of Associations]: #the-types-of-associations
|
||||
[FetchableRecord]: ../README.md#fetchablerecord-protocols
|
||||
[migration]: ../README.md#migrations
|
||||
[migration]: Migrations.md
|
||||
[Record]: ../README.md#records
|
||||
[Foreign Key Actions]: https://sqlite.org/foreignkeys.html#fk_actions
|
||||
[Associations and the Database Schema]: #associations-and-the-database-schema
|
||||
@@ -2377,3 +2481,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
[persistence methods]: ../README.md#persistence-methods
|
||||
[database observation tools]: ../README.md#database-changes-observation
|
||||
[ValueObservation]: ../README.md#valueobservation
|
||||
[FAQ]: ../README.md#faq-associations
|
||||
[common table expressions]: CommonTableExpressions.md
|
||||
[Associations to Common Table Expressions]: CommonTableExpressions.md#associations-to-common-table-expressions
|
||||
@@ -0,0 +1,328 @@
|
||||
GRDB ❤️ Combine
|
||||
===============
|
||||
|
||||
**On systems supporting the Combine framework, GRDB offers the ability to publish database values and events using Combine's publishers.**
|
||||
|
||||
- [Usage]
|
||||
- [Demo Application]
|
||||
- [Asynchronous Database Access]
|
||||
- [Database Observation]
|
||||
|
||||
## Usage
|
||||
|
||||
To connect to the database, please refer to [Database Connections].
|
||||
|
||||
<details>
|
||||
<summary><strong>Asynchronously read from the database</strong></summary>
|
||||
|
||||
This publisher reads a single value and delivers it.
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Read<[Player]>
|
||||
let players = dbQueue.readPublisher { db in
|
||||
try Player.fetchAll(db)
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Asynchronously write in the database</strong></summary>
|
||||
|
||||
This publisher updates the database and delivers a single value.
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Write<Void>
|
||||
let write = dbQueue.writePublisher { db in
|
||||
try Player(...).insert(db)
|
||||
}
|
||||
|
||||
// DatabasePublishers.Write<Int>
|
||||
let newPlayerCount = dbQueue.writePublisher { db -> Int in
|
||||
try Player(...).insert(db)
|
||||
return try Player.fetchCount(db)
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Observe changes in database values</strong></summary>
|
||||
|
||||
This publisher delivers fresh values whenever the database changes:
|
||||
|
||||
```swift
|
||||
// A publisher with output [Player] and failure Error
|
||||
let publisher = ValueObservation
|
||||
.tracking { db in try Player.fetchAll(db) }
|
||||
.publisher(in: dbQueue)
|
||||
|
||||
// A publisher with output Int? and failure Error
|
||||
let publisher = ValueObservation
|
||||
.tracking { db in try Int.fetchOne(db, sql: "SELECT MAX(score) FROM player") }
|
||||
.publisher(in: dbQueue)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Observe database transactions</strong></summary>
|
||||
|
||||
This publisher delivers database connections whenever a database transaction has impacted an observed region:
|
||||
|
||||
```swift
|
||||
// A publisher with output Database and failure Error
|
||||
let publisher = DatabaseRegionObservation
|
||||
.tracking(Player.all())
|
||||
.publisher(in: dbQueue)
|
||||
|
||||
let cancellable = publisher.sink(
|
||||
receiveCompletion: { completion in ... },
|
||||
receiveValue: { (db: Database) in
|
||||
print("Exclusive write access to the database after players have been impacted")
|
||||
})
|
||||
|
||||
// A publisher with output Database and failure Error
|
||||
let publisher = DatabaseRegionObservation
|
||||
.tracking(SQLRequest<Int>(sql: "SELECT MAX(score) FROM player"))
|
||||
.publisher(in: dbQueue)
|
||||
|
||||
let cancellable = publisher.sink(
|
||||
receiveCompletion: { completion in ... },
|
||||
receiveValue: { (db: Database) in
|
||||
print("Exclusive write access to the database after maximum score has been impacted")
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
# Asynchronous Database Access
|
||||
|
||||
GRDB provide publishers that perform asynchronous database accesses.
|
||||
|
||||
- [`readPublisher(receiveOn:value:)`]
|
||||
- [`writePublisher(receiveOn:updates:)`]
|
||||
- [`writePublisher(receiveOn:updates:thenRead:)`]
|
||||
|
||||
|
||||
#### `DatabaseReader.readPublisher(receiveOn:value:)`
|
||||
|
||||
This methods returns a publisher that completes after database values have been asynchronously fetched.
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Read<[Player]>
|
||||
let players = dbQueue.readPublisher { db in
|
||||
try Player.fetchAll(db)
|
||||
}
|
||||
```
|
||||
|
||||
Any attempt at modifying the database completes subscriptions with an error.
|
||||
|
||||
When you use a [database queue] or a [database snapshot], the read has to wait for any eventual concurrent database access performed by this queue or snapshot to complete.
|
||||
|
||||
When you use a [database pool], reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be [configured].
|
||||
|
||||
This publisher can be subscribed from any thread. A new database access starts on every subscription.
|
||||
|
||||
The fetched value is published on the main queue, unless you provide a specific scheduler to the `receiveOn` argument.
|
||||
|
||||
|
||||
#### `DatabaseWriter.writePublisher(receiveOn:updates:)`
|
||||
|
||||
This method returns a publisher that completes after database updates have been successfully executed inside a database transaction.
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Write<Void>
|
||||
let write = dbQueue.writePublisher { db in
|
||||
try Player(...).insert(db)
|
||||
}
|
||||
|
||||
// DatabasePublishers.Write<Int>
|
||||
let newPlayerCount = dbQueue.writePublisher { db -> Int in
|
||||
try Player(...).insert(db)
|
||||
return try Player.fetchCount(db)
|
||||
}
|
||||
```
|
||||
|
||||
This publisher can be subscribed from any thread. A new database access starts on every subscription.
|
||||
|
||||
It completes on the main queue, unless you provide a specific [scheduler] to the `receiveOn` argument.
|
||||
|
||||
When you use a [database pool], and your app executes some database updates followed by some slow fetches, you may profit from optimized scheduling with [`writePublisher(receiveOn:updates:thenRead:)`]. See below.
|
||||
|
||||
|
||||
#### `DatabaseWriter.writePublisher(receiveOn:updates:thenRead:)`
|
||||
|
||||
This method returns a publisher that completes after database updates have been successfully executed inside a database transaction, and values have been subsequently fetched:
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Write<Int>
|
||||
let newPlayerCount = dbQueue.writePublisher(
|
||||
updates: { db in try Player(...).insert(db) }
|
||||
thenRead: { db, _ in try Player.fetchCount(db) })
|
||||
}
|
||||
```
|
||||
|
||||
It publishes exactly the same values as [`writePublisher(receiveOn:updates:)`]:
|
||||
|
||||
```swift
|
||||
// DatabasePublishers.Write<Int>
|
||||
let newPlayerCount = dbQueue.writePublisher { db -> Int in
|
||||
try Player(...).insert(db)
|
||||
return try Player.fetchCount(db)
|
||||
}
|
||||
```
|
||||
|
||||
The difference is that the last fetches are performed in the `thenRead` function. This function accepts two arguments: a readonly database connection, and the result of the `updates` function. This allows you to pass information from a function to the other (it is ignored in the sample code above).
|
||||
|
||||
When you use a [database pool], this method applies a scheduling optimization: the `thenRead` function sees the database in the state left by the `updates` function, and yet does not block any concurrent writes. This can reduce database write contention. See [Advanced DatabasePool](../README.md#advanced-databasepool) for more information.
|
||||
|
||||
When you use a [database queue], the results are guaranteed to be identical, but no scheduling optimization is applied.
|
||||
|
||||
This publisher can be subscribed from any thread. A new database access starts on every subscription.
|
||||
|
||||
It completes on the main queue, unless you provide a specific [scheduler] to the `receiveOn` argument.
|
||||
|
||||
|
||||
# Database Observation
|
||||
|
||||
Database Observation publishers are based on [ValueObservation] and [DatabaseRegionObservation]. Please refer to their documentation for more information. If your application needs change notifications that are not built as Combine publishers, check the general [Database Changes Observation] chapter.
|
||||
|
||||
- [`ValueObservation.publisher(in:scheduling:)`]
|
||||
- [`DatabaseRegionObservation.publisher(in:)`]
|
||||
|
||||
|
||||
#### `ValueObservation.publisher(in:scheduling:)`
|
||||
|
||||
[ValueObservation] tracks changes in database values. You can turn it into a Combine publisher:
|
||||
|
||||
```swift
|
||||
let observation = ValueObservation.tracking { db in
|
||||
try Player.fetchAll(db)
|
||||
}
|
||||
|
||||
// A publisher with output [Player] and failure Error
|
||||
let publisher = observation.publisher(in: dbQueue)
|
||||
```
|
||||
|
||||
This publisher has the same behavior as ValueObservation:
|
||||
|
||||
- It notifies an initial value before the eventual changes.
|
||||
- It may coalesce subsequent changes into a single notification.
|
||||
- It may notify consecutive identical values. You can filter out the undesired duplicates with the `removeDuplicates()` Combine operator, but we suggest you have a look at the [removeDuplicates()](../README.md#valueobservationremoveduplicates) GRDB operator also.
|
||||
- It stops emitting any value after the database connection is closed. But it never completes.
|
||||
- By default, it notifies the initial value, as well as eventual changes and errors, on the main thread, asynchronously.
|
||||
|
||||
This can be configured with the `scheduling` argument. It does not accept a Combine scheduler, but a [ValueObservation scheduler](../README.md#valueobservation-scheduling).
|
||||
|
||||
For example, the `.immediate` scheduler makes sure the initial value is notified immediately when the publisher is subscribed. It can help your application update the user interface without having to wait for any asynchronous notifications:
|
||||
|
||||
```swift
|
||||
// Immediate notification of the initial value
|
||||
let cancellable = observation
|
||||
.publisher(
|
||||
in: dbQueue,
|
||||
scheduling: .immediate) // <-
|
||||
.sink(
|
||||
receiveCompletion: { completion in ... },
|
||||
receiveValue: { (players: [Player]) in print("Fresh players: \(players)") })
|
||||
// <- here "fresh players" is already printed.
|
||||
```
|
||||
|
||||
Note that the `.immediate` scheduler requires that the publisher is subscribed from the main thread. It raises a fatal error otherwise.
|
||||
|
||||
See [ValueObservation Scheduling](../README.md#valueobservation-scheduling) for more information.
|
||||
|
||||
:warning: **ValueObservation and Data Consistency**
|
||||
|
||||
When you compose ValueObservation publishers together with the [combineLatest](https://developer.apple.com/documentation/combine/publisher/3333677-combinelatest) operator, you lose all guarantees of [data consistency](https://en.wikipedia.org/wiki/Consistency_(database_systems)).
|
||||
|
||||
Instead, compose requests together into **one single** ValueObservation, as below:
|
||||
|
||||
```swift
|
||||
struct HallOfFame {
|
||||
var totalPlayerCount: Int
|
||||
var bestPlayers: [Player]
|
||||
}
|
||||
|
||||
// DATA CONSISTENCY GUARANTEED
|
||||
let hallOfFamePublisher = ValueObservation
|
||||
.tracking { db -> HallOfFame in
|
||||
let totalPlayerCount = try Player.fetchCount(db)
|
||||
|
||||
let bestPlayers = try Player
|
||||
.order(Column("score").desc)
|
||||
.limit(10)
|
||||
.fetchAll(db)
|
||||
|
||||
return HallOfFame(
|
||||
totalPlayerCount: totalPlayerCount,
|
||||
bestPlayers: bestPlayers)
|
||||
}
|
||||
.publisher(in: dbQueue)
|
||||
```
|
||||
|
||||
See [ValueObservation] for more information.
|
||||
|
||||
|
||||
#### `DatabaseRegionObservation.publisher(in:)`
|
||||
|
||||
[DatabaseRegionObservation] notifies all transactions that impact a tracked database region. You can turn it into a Combine publisher:
|
||||
|
||||
```swift
|
||||
let request = Player.all()
|
||||
let observation = DatabaseRegionObservation.tracking(request)
|
||||
|
||||
// A publisher with output Database and failure Error
|
||||
let publisher = observation.publisher(in: dbQueue)
|
||||
```
|
||||
|
||||
This publisher can be created and subscribed from any thread. It delivers database connections in a "protected dispatch queue", serialized with all database updates. It only completes when a database error happens.
|
||||
|
||||
```swift
|
||||
let request = Player.all()
|
||||
let cancellable = DatabaseRegionObservation
|
||||
.tracking(request)
|
||||
.publisher(in: dbQueue)
|
||||
.sink(
|
||||
receiveCompletion: { completion in ... },
|
||||
receiveValue: { (db: Database) in
|
||||
print("Players have changed.")
|
||||
})
|
||||
|
||||
try dbQueue.write { db in
|
||||
try Player(name: "Arthur").insert(db)
|
||||
try Player(name: "Barbara").insert(db)
|
||||
}
|
||||
// Prints "Players have changed."
|
||||
|
||||
try dbQueue.write { db in
|
||||
try Player.deleteAll(db)
|
||||
}
|
||||
// Prints "Players have changed."
|
||||
```
|
||||
|
||||
See [DatabaseRegionObservation] for more information.
|
||||
|
||||
|
||||
[Database Connections]: ../README.md#database-connections
|
||||
[Usage]: #usage
|
||||
[Asynchronous Database Access]: #asynchronous-database-access
|
||||
[Combine]: https://developer.apple.com/documentation/combine
|
||||
[Database Changes Observation]: ../README.md#database-changes-observation
|
||||
[Database Observation]: #database-observation
|
||||
[DatabaseRegionObservation]: ../README.md#databaseregionobservation
|
||||
[Demo Application]: DemoApps/GRDBCombineDemo/README.md
|
||||
[SQLite]: http://sqlite.org
|
||||
[ValueObservation]: ../README.md#valueobservation
|
||||
[`DatabaseRegionObservation.publisher(in:)`]: #databaseregionobservationpublisherin
|
||||
[`ValueObservation.publisher(in:scheduling:)`]: #valueobservationpublisherinscheduling
|
||||
[`readPublisher(receiveOn:value:)`]: #databasereaderreadpublisherreceiveonvalue
|
||||
[`writePublisher(receiveOn:updates:)`]: #databasewriterwritepublisherreceiveonupdates
|
||||
[`writePublisher(receiveOn:updates:thenRead:)`]: #databasewriterwritepublisherreceiveonupdatesthenread
|
||||
[configured]: ../README.md#databasepool-configuration
|
||||
[database pool]: ../README.md#database-pools
|
||||
[database queue]: ../README.md#database-queues
|
||||
[database snapshot]: ../README.md#database-snapshots
|
||||
[scheduler]: https://developer.apple.com/documentation/combine/scheduler
|
||||
@@ -0,0 +1,423 @@
|
||||
Common Table Expressions
|
||||
========================
|
||||
|
||||
[**:fire: EXPERIMENTAL**](../README.md#what-are-experimental-features)
|
||||
|
||||
---
|
||||
|
||||
**Common table expressions** (CTEs) can generally be seen as *SQL views that you define on the fly*.
|
||||
|
||||
A certain level of familiarity with SQL databases is helpful before you dive into this guide. The starting point is obviously the [SQLite documentation](https://sqlite.org/lang_with.html). Many CTE tutorials exist online as well, including [this good one](https://blog.expensify.com/2015/09/25/the-simplest-sqlite-common-table-expression-tutorial/).
|
||||
|
||||
In this guide, you will learn how to:
|
||||
|
||||
- [Define Common Table Expressions]
|
||||
- [Embed Common Table Expressions in Requests]
|
||||
- [Fetch Values From Common Table Expressions]
|
||||
- Join CTEs with [Associations to Common Table Expressions]
|
||||
|
||||
> :point_up: **Note**: most code examples will be trivial, and not very "useful". This is because the goal of this guide is to stay focused on the GRDB support for CTEs. Rich setup would just be distracting. So bring your own good ideas with you!
|
||||
|
||||
|
||||
## Define Common Table Expressions
|
||||
|
||||
You will create a `CommonTableExpression` definition first. Choose a **name**, and a **request** that provides the content of the common table expression.
|
||||
|
||||
The CTE name is like a regular table name: pick one that does not conflict with the names of existing tables.
|
||||
|
||||
The CTE request can be provided as a [query interface request]:
|
||||
|
||||
```swift
|
||||
// WITH playerName AS (SELECT name FROM player) ...
|
||||
let playerNameCTE = CommonTableExpression<Void>(
|
||||
named: "playerName",
|
||||
request: Player.select(Column("name")))
|
||||
```
|
||||
|
||||
You can feed a CTE with raw SQL as well (second and third examples use [SQL Interpolation]):
|
||||
|
||||
```swift
|
||||
let name = "O'Brien"
|
||||
|
||||
// WITH playerName AS (SELECT 'O''Brien') ...
|
||||
let playerNameCTE = CommonTableExpression<Void>(
|
||||
named: "playerName",
|
||||
sql: "SELECT ?", arguments: [name])
|
||||
|
||||
// WITH playerName AS (SELECT 'O''Brien') ...
|
||||
let playerNameCTE = CommonTableExpression<Void>(
|
||||
named: "playerName",
|
||||
literal: "SELECT \(name)")
|
||||
|
||||
// WITH playerName AS (SELECT 'O''Brien') ...
|
||||
let request: SQLRequest<String> = "SELECT \(name)"
|
||||
let playerNameCTE = CommonTableExpression<Void>(
|
||||
named: "playerName",
|
||||
request: requests)
|
||||
```
|
||||
|
||||
All CTEs can be provided with explicit column names:
|
||||
|
||||
```swift
|
||||
// WITH pair(a, b) AS (SELECT 1, 2) ...
|
||||
let pairCTE = CommonTableExpression<Void>(
|
||||
named: "pair",
|
||||
columns: ["a", "b"],
|
||||
sql: "SELECT 1, 2")
|
||||
```
|
||||
|
||||
Recursive CTEs need the `recursive` flag. The example below selects all integers between 1 and 1000:
|
||||
|
||||
```swift
|
||||
// WITH RECURSIVE counter(x) AS
|
||||
// (VALUES(1) UNION ALL SELECT x+1 FROM counter WHERE x<1000)
|
||||
let counterCTE = CommonTableExpression<Int>(
|
||||
recursive: true,
|
||||
named: "counter",
|
||||
columns: ["x"],
|
||||
sql: """
|
||||
VALUES(1)
|
||||
UNION ALL
|
||||
SELECT x+1 FROM counter WHERE x<1000
|
||||
""")
|
||||
```
|
||||
|
||||
> :point_up: **Note**: many recursive CTEs use the `UNION ALL` SQL operator. The query interface does not provide any Swift support for it, so you'll generally have to write SQL in your definitions of recursive CTEs.
|
||||
|
||||
As you can see in all above examples, `CommonTableExpression` is a generic type: `CommonTableExpression<Void>`, `CommonTableExpression<Int>`. The generic argument (`Void`, `Int`) turns useful when you [join common table expressions](#associations-to-common-table-expressions), or when you [fetch values directly from a common table expression](#fetch-values-from-common-table-expressions). Otherwise, you can just use `Void`.
|
||||
|
||||
|
||||
## Embed Common Table Expressions in Requests
|
||||
|
||||
A typical SQLite query that uses a common table expression first *defines* the CTE and then *uses* the CTE by mentioning its table name. We'll see below Swift apis that match those two steps.
|
||||
|
||||
We will use the (simple) query below as a target. It is the query we'll want to generate in this chapter. It defines a CTE, and uses it in a subquery:
|
||||
|
||||
```sql
|
||||
WITH playerName AS (SELECT 'O''Brien')
|
||||
SELECT * FROM player
|
||||
WHERE name = (SELECT * FROM playerName)
|
||||
```
|
||||
|
||||
We first build a `CommonTableExpression`:
|
||||
|
||||
```swift
|
||||
let name = "O'Brien"
|
||||
let playerNameCTE = CommonTableExpression<Void>(
|
||||
named: "playerName",
|
||||
literal: "SELECT \(name)")
|
||||
```
|
||||
|
||||
We can then embed the definition of the CTE in a [query interface request] by calling the `with(_:)` method:
|
||||
|
||||
```swift
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// SELECT * FROM player ...
|
||||
let request = Player
|
||||
.with(playerNameCTE)...
|
||||
```
|
||||
|
||||
And we can then filter the `player` table with a subquery:
|
||||
|
||||
```swift
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// SELECT * FROM player
|
||||
// WHERE name = (SELECT * FROM playerName)
|
||||
let request = Player
|
||||
.with(playerNameCTE)
|
||||
.filter(Column("name") == playerNameCTE.all())
|
||||
```
|
||||
|
||||
> :point_up: **Note**: the `with(_:)` method can be called as many times as a there are common table expressions in your request.
|
||||
>
|
||||
> :point_up: **Note**: the `with(_:)` method can be called at any time, as all request methods: `Player.with(...).filter(...).with(...)`.
|
||||
>
|
||||
> :point_up: **Note**: the `with(_:)` method replaces any previously embedded CTE that has the same table name. This allows you to embed the same CTE several times if you feel like it.
|
||||
>
|
||||
> :point_up: **Note**: the `CommonTableExpression.all()` method builds a regular [query interface request] for the content of the CTE (like `SELECT * FROM <cte name>`, not to be mismatched with the request that was used to define the CTE). You can filter this request, sort it, etc, like all query interface requests:
|
||||
>
|
||||
> ```swift
|
||||
> cte.all().select(...).filter(...).group(...).order(...)
|
||||
> ```
|
||||
|
||||
Common table expressions can also be embedded in [SQLRequest] with [SQL Interpolation]:
|
||||
|
||||
```swift
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// SELECT * FROM player
|
||||
// WHERE name = (SELECT * FROM playerName)
|
||||
let request: SQLRequest<Player> = """
|
||||
WITH \(definitionFor: playerNameCTE)
|
||||
SELECT * FROM player
|
||||
WHERE name = (SELECT * FROM \(playerNameCTE))
|
||||
"""
|
||||
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// SELECT * FROM player
|
||||
// WHERE name = (SELECT * FROM playerName)
|
||||
let request: SQLRequest<Player> = """
|
||||
WITH \(definitionFor: playerNameCTE)
|
||||
SELECT * FROM player
|
||||
WHERE name = (\(playerNameCTE.all()))
|
||||
"""
|
||||
```
|
||||
|
||||
Common table expressions can also be used as subqueries, when you update or delete rows in the database:
|
||||
|
||||
```swift
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// UPDATE player SET name = (SELECT * FROM playerName)
|
||||
try Player
|
||||
.with(playerNameCTE)
|
||||
.updateAll(db, Column("name").set(to: playerNameCTE.all()))
|
||||
|
||||
// WITH playerName AS (SELECT 'O''Brien')
|
||||
// DELETE FROM player WHERE name = (SELECT * FROM playerName)
|
||||
try Player
|
||||
.with(playerNameCTE)
|
||||
.filter(Column("name") == playerNameCTE.all())
|
||||
.deleteAll(db)
|
||||
```
|
||||
|
||||
|
||||
## Fetch Values From Common Table Expressions
|
||||
|
||||
In the previous chapter, a common table expression was embedded as a subquery, with the `CommonTableExpression.all()` method.
|
||||
|
||||
`all()` builds a regular [query interface request] that you can filter, sort, etc, like all query interface requests. You can also fetch from it, but only as long as it is provided with the definition of the CTE.
|
||||
|
||||
This will generally give requests of the form `cte.all().with(cte)`. In SQL, this would give: `WITH cte AS (...) SELECT * FROM cte`.
|
||||
|
||||
The generic type of `CommonTableExpression<...>` now turns out useful, so that you can fetch the desired outcome (database [rows](../README.md#row-queries), simple [values](../README.md#value-queries), or custom [records](../README.md#records)).
|
||||
|
||||
For example, let's fetch a range of integer:
|
||||
|
||||
```swift
|
||||
func counterRequest(range: ClosedRange<Int>) -> QueryInterfaceRequest<Int> {
|
||||
// WITH RECURSIVE counter(x) AS
|
||||
// (VALUES(...) UNION ALL SELECT x+1 FROM counter WHERE x<...)
|
||||
// SELECT * FROM counter
|
||||
let counter = CommonTableExpression<Int>(
|
||||
recursive: true,
|
||||
named: "counter",
|
||||
columns: ["x"],
|
||||
literal: """
|
||||
VALUES(\(range.lowerBound)) \
|
||||
UNION ALL \
|
||||
SELECT x+1 FROM counter WHERE x < \(range.upperBound)
|
||||
""")
|
||||
return counter.all().with(counter)
|
||||
}
|
||||
|
||||
let values = try dbQueue.read { db in
|
||||
try counterRequest(range: 3...7).fetchAll(db)
|
||||
}
|
||||
print(values) // prints "[3, 4, 5, 6, 7]"
|
||||
```
|
||||
|
||||
When you have to fetch from a `CommonTableExpression` which does not have the desired generic type, you can still use the `asRequest(of:)` method:
|
||||
|
||||
```swift
|
||||
let cte: CommonTableExpression<Void> = ...
|
||||
let rows: [Row] = try dbQueue.read { db in
|
||||
try cte.all().with(cte)
|
||||
.asRequest(of: Row.self)
|
||||
.fetchAll(db)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Associations to Common Table Expressions
|
||||
|
||||
GRDB [associations] define "to-one" and "to-many" relationships between two database tables. Here we will define associations between regular tables and common table expressions.
|
||||
|
||||
We recommend familiarity with the "joining methods", described in [Joining And Prefetching Associated Records]:
|
||||
|
||||
```swift
|
||||
// SELECT parent.* FROM parent LEFT JOIN child ON ...
|
||||
Parent.joining(optional: childAssociation)
|
||||
|
||||
// SELECT parent.* FROM parent JOIN child ON ...
|
||||
Parent.joining(required: childAssociation)
|
||||
|
||||
// SELECT parent.*, child.* FROM parent LEFT JOIN child ON ...
|
||||
Parent.including(optional: childAssociation)
|
||||
|
||||
// SELECT parent.*, child.* FROM parent JOIN child ON ...
|
||||
Parent.including(required: childAssociation)
|
||||
```
|
||||
|
||||
> :point_up: **Note**: common table expressions currently only define "to-one" associations, so the `including(all:)` joining method is unavailable.
|
||||
|
||||
CTE associations are generally built with the `association(to:on:)` method, which needs:
|
||||
|
||||
- The two sides of the association: a `CommonTableExpression` instance, and another CTE or a type that conforms to the [TableRecord] protocol.
|
||||
- A function that returns the condition that joins the two sides of the association.
|
||||
|
||||
The condition function plays the same role as the **foreign key** that defines regular table [associations] such as **BelongsTo** or **HasMany**. It accepts two [TableAlias], from which you can build a joining expression:
|
||||
|
||||
For example:
|
||||
|
||||
```swift
|
||||
// An association from LeftRecord to rightCTE
|
||||
let rightCTE = ...
|
||||
let association = LeftRecord.association(
|
||||
to: rightCTE,
|
||||
on: { left, right in
|
||||
left[Column("x")] = right[Column("y")]
|
||||
})
|
||||
```
|
||||
|
||||
Now this association can be used with a joining method:
|
||||
|
||||
```swift
|
||||
// WITH rightCTE AS (...)
|
||||
// SELECT leftRecord.*, rightCTE.*
|
||||
// FROM leftRecord
|
||||
// JOIN rightCTE ON leftRecord.x = rightCTE.y
|
||||
LeftRecord
|
||||
.with(rightCTE)
|
||||
.including(required: association)
|
||||
```
|
||||
|
||||
|
||||
### CTE Association Example: a Chat App
|
||||
|
||||
As an example, let's build the classical main screen of a chat application: a list of all latest messages from all conversations.
|
||||
|
||||
The database schema of the chat app contains a `chat` and a `message` table. The application defines the following records:
|
||||
|
||||
```swift
|
||||
struct Chat: Codable, FetchableRecord, PersistableRecord {
|
||||
var id: Int64
|
||||
...
|
||||
}
|
||||
|
||||
struct Message: Codable, FetchableRecord, PersistableRecord {
|
||||
var chatID: Int64
|
||||
var date: Date
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
To feed the main app screen, we want to fetch a list of `ChatInfo` records:
|
||||
|
||||
```swift
|
||||
struct ChatInfo: Decodable, FetchableRecord {
|
||||
/// The chat
|
||||
var chat: Chat
|
||||
|
||||
/// The latest chat message, if any
|
||||
var latestMessage: Message?
|
||||
}
|
||||
```
|
||||
|
||||
The SQL request that we want to run is below. It uses an SQLite-specific [special processing](https://sqlite.org/lang_select.html) of `MAX()` that helps the selection of latest messages from all chats:
|
||||
|
||||
```sql
|
||||
WITH latestMessage AS
|
||||
(SELECT *, MAX(date) FROM message GROUP BY chatID)
|
||||
SELECT chat.*, latestMessage.*
|
||||
FROM chat
|
||||
LEFT JOIN latestMessage ON chat.id = latestMessage.chatID
|
||||
ORDER BY latestMessage.date DESC
|
||||
```
|
||||
|
||||
We start by defining the CTE request, which loads the latest messages of all chats:
|
||||
|
||||
```swift
|
||||
// SELECT *, MAX(date) FROM message GROUP BY chatID
|
||||
let latestMessageRequest = Message
|
||||
.annotated(with: max(Column("date")))
|
||||
.group(Column("chatID"))
|
||||
```
|
||||
|
||||
We can now define the CTE for the latest messages:
|
||||
|
||||
```swift
|
||||
// WITH latestMessage AS
|
||||
// (SELECT *, MAX(date) FROM message GROUP BY chatID)
|
||||
let latestMessageCTE = CommonTableExpression<Void>(
|
||||
named: "latestMessage",
|
||||
request: latestMessageRequest)
|
||||
```
|
||||
|
||||
The association from a chat to its latest message follows:
|
||||
|
||||
```swift
|
||||
|
||||
// ... JOIN latestMessage ON chat.id = latestMessage.chatID
|
||||
let latestMessage = Chat.association(
|
||||
to: latestMessageCTE,
|
||||
on: { chat, latestMessage in
|
||||
chat[Column("id")] == latestMessage[Column("chatID")]
|
||||
})
|
||||
.order(Column("date").desc)
|
||||
```
|
||||
|
||||
The final request can now be defined:
|
||||
|
||||
```swift
|
||||
|
||||
// WITH latestMessage AS
|
||||
// (SELECT *, MAX(date) FROM message GROUP BY chatID)
|
||||
// SELECT chat.*, latestMessage.*
|
||||
// FROM chat
|
||||
// LEFT JOIN latestMessage ON chat.id = latestMessage.chatID
|
||||
// ORDER BY latestMessage.date DESC
|
||||
let request = Chat
|
||||
.with(latestMessageCTE)
|
||||
.including(optional: latestMessage)
|
||||
.asRequest(of: ChatInfo.self)
|
||||
```
|
||||
|
||||
And we can fetch the data that feeds our application screen:
|
||||
|
||||
```swift
|
||||
|
||||
let chatInfos: [ChatInfos] = try dbQueue.read(request.fetchAll)
|
||||
```
|
||||
|
||||
> :bulb: **Tip**: the joining methods are generally type-safe: they won't allow you to join apples to oranges. This works when associations have a *precise* type. In this context, our go-to `CommonTableExpression<Void>` CTEs can work against type safety. So when you want to define associations between several CTEs, and make sure the compiler will notice wrong uses of those associations, tag your `CommonTableExpression` with a type instead of `Void`.
|
||||
>
|
||||
> You can use an existing record type, or an ad-hoc enum. For example:
|
||||
>
|
||||
> ```swift
|
||||
> enum CTE1 { }
|
||||
> let cte1 = CommonTableExpression<CTE1>(...)
|
||||
>
|
||||
> enum CTE2 { }
|
||||
> let cte2 = CommonTableExpression<CTE2>(...)
|
||||
>
|
||||
> let assoc1 = BaseRecord.association(to: cte1, on: ...)
|
||||
> let assoc2 = cte1.association(to: cte2, on: ...)
|
||||
> let assoc3 = cte2.association(to: FarRecord.self, on: ...)
|
||||
>
|
||||
> // WITH ...
|
||||
> // SELECT base.* FROM base
|
||||
> // JOIN cte1 ON ...
|
||||
> // JOIN cte2 ON ...
|
||||
> // JOIN far ON ...
|
||||
> let request = BaseRecord
|
||||
> .with(cte1).with(cte2)
|
||||
> .joining(required: assoc1
|
||||
> .joining(required: assoc2
|
||||
> .joining(required: assoc3)))
|
||||
>
|
||||
> // Compiler error
|
||||
> let request = BaseRecord.joining(required: assoc2)
|
||||
> ```
|
||||
|
||||
[query interface request]: ../README.md#requests
|
||||
[query interface requests]: ../README.md#requests
|
||||
[SQLRequest]: ../README.md#custom-requests
|
||||
[SQLiteral]: SQLInterpolation.md
|
||||
[SQL Interpolation]: SQLInterpolation.md
|
||||
[associations]: AssociationsBasics.md
|
||||
[Joining And Prefetching Associated Records]: AssociationsBasics.md#joining-and-prefetching-associated-records
|
||||
[Define Common Table Expressions]: #define-common-table-expressions
|
||||
[Embed Common Table Expressions in Requests]: #embed-common-table-expressions-in-requests
|
||||
[Fetch Values From Common Table Expressions]: #fetch-values-from-common-table-expressions
|
||||
[Associations to Common Table Expressions]: #associations-to-common-table-expressions
|
||||
[TableRecord]: ../README.md#tablerecord-protocol
|
||||
[TableAlias]: AssociationsBasics.md#table-aliases
|
||||
@@ -3,7 +3,7 @@ Custom SQLite Builds
|
||||
|
||||
By default, GRDB uses the version of SQLite that ships with the target operating system.
|
||||
|
||||
**You can build GRDB with a custom build of [SQLite 3.28.0](https://www.sqlite.org/changes.html).**
|
||||
**You can build GRDB with a custom build of [SQLite 3.33.0](https://www.sqlite.org/changes.html).**
|
||||
|
||||
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](../../../#full-text-search), and [SQLite Pre-Update Hooks](../../../#support-for-sqlite-pre-update-hooks).
|
||||
|
||||
@@ -11,15 +11,17 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
|
||||
|
||||
**To install GRDB with a custom SQLite build:**
|
||||
|
||||
1. Clone the GRDB git repository, checkout the latest tagged version, and download SQLite sources:
|
||||
1. Clone the GRDB git repository, checkout the latest tagged version:
|
||||
|
||||
```sh
|
||||
cd [GRDB directory]
|
||||
git checkout v4.4.0
|
||||
git checkout [latest tag]
|
||||
git submodule update --init SQLiteCustom/src
|
||||
````
|
||||
```
|
||||
|
||||
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5` and `SQLITE_ENABLE_PREUPDATE_HOOK`.
|
||||
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5`, `SQLITE_ENABLE_PREUPDATE_HOOK`.
|
||||
|
||||
It is recommended that you enable the `SQLITE_ENABLE_SNAPSHOT` option. It allows GRDB to optimize [ValueObservation](../README.md#valueobservation) when you use a [Database Pool](../README.md#database-pools).
|
||||
|
||||
3. Create a folder named `GRDBCustomSQLite` somewhere in your project directory.
|
||||
|
||||
@@ -30,7 +32,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
|
||||
```xcconfig
|
||||
// As many -D options as there are custom SQLite compilation options
|
||||
// Note: there is no space between -D and the option name.
|
||||
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK
|
||||
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_FTS5
|
||||
```
|
||||
|
||||
- `GRDBCustomSQLite-USER.xcconfig`: this file lets GRDB know about extra compilation flags, and enables extra GRDB APIs.
|
||||
@@ -38,15 +40,15 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
|
||||
```xcconfig
|
||||
// As many -D options as there are custom SQLite compilation options
|
||||
// Note: there is one space between -D and the option name.
|
||||
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_FTS5 -D SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_SNAPSHOT -D SQLITE_ENABLE_FTS5
|
||||
```
|
||||
|
||||
- `GRDBCustomSQLite-USER.h`: this file lets your application know about extra compilation flags.
|
||||
|
||||
```c
|
||||
// As many #define as there are custom SQLite compilation options
|
||||
#define SQLITE_ENABLE_SNAPSHOT
|
||||
#define SQLITE_ENABLE_FTS5
|
||||
#define SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
```
|
||||
|
||||
- `GRDBCustomSQLite-INSTALL.sh`: this file installs the three other files.
|
||||
@@ -111,7 +113,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
|
||||
|
||||
6. Add the `GRDBCustomSQLiteOSX` or `GRDBCustomSQLiteiOS` target in the **Target Dependencies** section of the **Build Phases** tab of your **application target**.
|
||||
|
||||
7. Add the `GRDBCustomSQLite.framework` from the targetted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
|
||||
7. Add the `GRDBCustomSQLite.framework` from the targeted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
|
||||
|
||||
8. Add a Run Script phase for your target in the **Pre-actions** section of the **Build** tab of your **application scheme**:
|
||||
|
||||
@@ -120,13 +122,15 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
|
||||
```
|
||||
|
||||
The path should be the path to your `GRDBCustomSQLite-INSTALL.sh` file.
|
||||
|
||||
Select your application target in the "Provide build settings from" menu.
|
||||
|
||||
9. Check the "Shared" checkbox of your application scheme (this lets you commit the pre-action in your Version Control System).
|
||||
|
||||
Now you can use GRDB with your custom SQLite build:
|
||||
|
||||
```swift
|
||||
import GRDBCustomSQLite
|
||||
import GRDB
|
||||
|
||||
let dbQueue = try DatabaseQueue(...)
|
||||
```
|
||||
@@ -0,0 +1,732 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */; };
|
||||
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */; };
|
||||
567C3E1A2520B6DE0011F6E9 /* GRDBCombineDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */; };
|
||||
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */; };
|
||||
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */; };
|
||||
567C3E4E2520B70E0011F6E9 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 567C3E3B2520B7000011F6E9 /* GRDB.framework */; };
|
||||
567C3E4F2520B70E0011F6E9 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 567C3E3B2520B7000011F6E9 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E532520B75C0011F6E9 /* Player.swift */; };
|
||||
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E542520B75C0011F6E9 /* Persistence.swift */; };
|
||||
567C3E5F2520B75C0011F6E9 /* PlayerListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */; };
|
||||
567C3E602520B75C0011F6E9 /* PlayerFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */; };
|
||||
567C3E612520B75D0011F6E9 /* PlayerForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E592520B75C0011F6E9 /* PlayerForm.swift */; };
|
||||
567C3E622520B75D0011F6E9 /* PlayerList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5A2520B75C0011F6E9 /* PlayerList.swift */; };
|
||||
567C3E632520B75D0011F6E9 /* PlayerCreationSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.swift */; };
|
||||
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */; };
|
||||
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E652520B7880011F6E9 /* AppDatabase.swift */; };
|
||||
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E752520BB650011F6E9 /* Localizable.stringsdict */; };
|
||||
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E0E2520B6DE0011F6E9 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 567C3E152520B6DE0011F6E9;
|
||||
remoteInfo = GRDBCombineDemo;
|
||||
};
|
||||
567C3E342520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
|
||||
remoteInfo = GRDBOSX;
|
||||
};
|
||||
567C3E362520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
|
||||
remoteInfo = GRDBOSXTests;
|
||||
};
|
||||
567C3E382520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56553C181C3E906C00522B5C;
|
||||
remoteInfo = GRDBOSXCrashTests;
|
||||
};
|
||||
567C3E3A2520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
567C3E3C2520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
|
||||
remoteInfo = GRDBiOSTests;
|
||||
};
|
||||
567C3E3E2520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 565490A01D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
567C3E402520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = AAA4DCFE230F1E0600C74B15;
|
||||
remoteInfo = GRDBtvOS;
|
||||
};
|
||||
567C3E422520B7000011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = AAA4DDD4230F262000C74B15;
|
||||
remoteInfo = GRDBtvOSTests;
|
||||
};
|
||||
567C3E512520B71C0011F6E9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
567C3E502520B70E0011F6E9 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
567C3E4F2520B70E0011F6E9 /* GRDB.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBCombineDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
56026C9C25B8A7D000D1DF3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerTests.swift; sourceTree = "<group>"; };
|
||||
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabaseTests.swift; sourceTree = "<group>"; };
|
||||
567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBCombineDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRDBCombineDemoApp.swift; sourceTree = "<group>"; };
|
||||
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
567C3E222520B6DF0011F6E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
567C3E292520B7000011F6E9 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
|
||||
567C3E532520B75C0011F6E9 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
|
||||
567C3E542520B75C0011F6E9 /* Persistence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
|
||||
567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerListViewModel.swift; sourceTree = "<group>"; };
|
||||
567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerFormViewModel.swift; sourceTree = "<group>"; };
|
||||
567C3E592520B75C0011F6E9 /* PlayerForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerForm.swift; sourceTree = "<group>"; };
|
||||
567C3E5A2520B75C0011F6E9 /* PlayerList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerList.swift; sourceTree = "<group>"; };
|
||||
567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerCreationSheet.swift; sourceTree = "<group>"; };
|
||||
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerEditionView.swift; sourceTree = "<group>"; };
|
||||
567C3E652520B7880011F6E9 /* AppDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
|
||||
567C3E762520BB650011F6E9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
|
||||
567C3E782520BB650011F6E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
56026C9525B8A7D000D1DF3F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
567C3E132520B6DE0011F6E9 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
567C3E4E2520B70E0011F6E9 /* GRDB.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56026C9C25B8A7D000D1DF3F /* Info.plist */,
|
||||
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */,
|
||||
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */,
|
||||
);
|
||||
path = GRDBCombineDemoTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56185BC125B8047D00B9C30F /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */,
|
||||
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */,
|
||||
567C3E752520BB650011F6E9 /* Localizable.stringsdict */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56185BC225B8048B00B9C30F /* Support */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E222520B6DF0011F6E9 /* Info.plist */,
|
||||
);
|
||||
name = Support;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E0D2520B6DE0011F6E9 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E292520B7000011F6E9 /* GRDB.xcodeproj */,
|
||||
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */,
|
||||
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */,
|
||||
567C3E172520B6DE0011F6E9 /* Products */,
|
||||
567C3E4D2520B70E0011F6E9 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E172520B6DE0011F6E9 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */,
|
||||
56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E652520B7880011F6E9 /* AppDatabase.swift */,
|
||||
567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */,
|
||||
567C3E542520B75C0011F6E9 /* Persistence.swift */,
|
||||
567C3E532520B75C0011F6E9 /* Player.swift */,
|
||||
567C3E1F2520B6DF0011F6E9 /* Preview Content */,
|
||||
56185BC125B8047D00B9C30F /* Resources */,
|
||||
56185BC225B8048B00B9C30F /* Support */,
|
||||
567C3E552520B75C0011F6E9 /* ViewModels */,
|
||||
567C3E582520B75C0011F6E9 /* Views */,
|
||||
);
|
||||
path = GRDBCombineDemo;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E1F2520B6DF0011F6E9 /* Preview Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */,
|
||||
);
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E2A2520B7000011F6E9 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E352520B7000011F6E9 /* GRDB.framework */,
|
||||
567C3E372520B7000011F6E9 /* GRDBOSXTests.xctest */,
|
||||
567C3E392520B7000011F6E9 /* GRDBOSXCrashTests.xctest */,
|
||||
567C3E3B2520B7000011F6E9 /* GRDB.framework */,
|
||||
567C3E3D2520B7000011F6E9 /* GRDBiOSTests.xctest */,
|
||||
567C3E3F2520B7000011F6E9 /* GRDB.framework */,
|
||||
567C3E412520B7000011F6E9 /* GRDB.framework */,
|
||||
567C3E432520B7000011F6E9 /* GRDBtvOSTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E4D2520B70E0011F6E9 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E552520B75C0011F6E9 /* ViewModels */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */,
|
||||
567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */,
|
||||
);
|
||||
path = ViewModels;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E582520B75C0011F6E9 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567C3E592520B75C0011F6E9 /* PlayerForm.swift */,
|
||||
567C3E5A2520B75C0011F6E9 /* PlayerList.swift */,
|
||||
567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.swift */,
|
||||
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
56026C9725B8A7D000D1DF3F /* GRDBCombineDemoTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBCombineDemoTests" */;
|
||||
buildPhases = (
|
||||
56026C9425B8A7D000D1DF3F /* Sources */,
|
||||
56026C9525B8A7D000D1DF3F /* Frameworks */,
|
||||
56026C9625B8A7D000D1DF3F /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */,
|
||||
);
|
||||
name = GRDBCombineDemoTests;
|
||||
productName = GRDBCombineDemoTests;
|
||||
productReference = 56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBCombineDemo" */;
|
||||
buildPhases = (
|
||||
567C3E122520B6DE0011F6E9 /* Sources */,
|
||||
567C3E132520B6DE0011F6E9 /* Frameworks */,
|
||||
567C3E142520B6DE0011F6E9 /* Resources */,
|
||||
567C3E502520B70E0011F6E9 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
567C3E522520B71C0011F6E9 /* PBXTargetDependency */,
|
||||
);
|
||||
name = GRDBCombineDemo;
|
||||
productName = GRBCombineDemo;
|
||||
productReference = 567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
567C3E0E2520B6DE0011F6E9 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1230;
|
||||
LastUpgradeCheck = 1200;
|
||||
TargetAttributes = {
|
||||
56026C9725B8A7D000D1DF3F = {
|
||||
CreatedOnToolsVersion = 12.3;
|
||||
TestTargetID = 567C3E152520B6DE0011F6E9;
|
||||
};
|
||||
567C3E152520B6DE0011F6E9 = {
|
||||
CreatedOnToolsVersion = 12.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBCombineDemo" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 567C3E0D2520B6DE0011F6E9;
|
||||
productRefGroup = 567C3E172520B6DE0011F6E9 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 567C3E2A2520B7000011F6E9 /* Products */;
|
||||
ProjectRef = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */,
|
||||
56026C9725B8A7D000D1DF3F /* GRDBCombineDemoTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
567C3E352520B7000011F6E9 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 567C3E342520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E372520B7000011F6E9 /* GRDBOSXTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXTests.xctest;
|
||||
remoteRef = 567C3E362520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E392520B7000011F6E9 /* GRDBOSXCrashTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXCrashTests.xctest;
|
||||
remoteRef = 567C3E382520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E3B2520B7000011F6E9 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 567C3E3A2520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E3D2520B7000011F6E9 /* GRDBiOSTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBiOSTests.xctest;
|
||||
remoteRef = 567C3E3C2520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E3F2520B7000011F6E9 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 567C3E3E2520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E412520B7000011F6E9 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 567C3E402520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
567C3E432520B7000011F6E9 /* GRDBtvOSTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBtvOSTests.xctest;
|
||||
remoteRef = 567C3E422520B7000011F6E9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
56026C9625B8A7D000D1DF3F /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
567C3E142520B6DE0011F6E9 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */,
|
||||
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */,
|
||||
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */,
|
||||
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
56026C9425B8A7D000D1DF3F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */,
|
||||
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
567C3E122520B6DE0011F6E9 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */,
|
||||
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */,
|
||||
567C3E612520B75D0011F6E9 /* PlayerForm.swift in Sources */,
|
||||
567C3E632520B75D0011F6E9 /* PlayerCreationSheet.swift in Sources */,
|
||||
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */,
|
||||
567C3E622520B75D0011F6E9 /* PlayerList.swift in Sources */,
|
||||
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */,
|
||||
567C3E1A2520B6DE0011F6E9 /* GRDBCombineDemoApp.swift in Sources */,
|
||||
567C3E5F2520B75C0011F6E9 /* PlayerListViewModel.swift in Sources */,
|
||||
567C3E602520B75C0011F6E9 /* PlayerFormViewModel.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */;
|
||||
targetProxy = 56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */;
|
||||
};
|
||||
567C3E522520B71C0011F6E9 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBiOS;
|
||||
targetProxy = 567C3E512520B71C0011F6E9 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
567C3E752520BB650011F6E9 /* Localizable.stringsdict */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
567C3E762520BB650011F6E9 /* en */,
|
||||
);
|
||||
name = Localizable.stringsdict;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
567C3E782520BB650011F6E9 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
56026C9F25B8A7D000D1DF3F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemoTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBCombineDemo.app/GRDBCombineDemo";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
56026CA025B8A7D000D1DF3F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemoTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBCombineDemo.app/GRDBCombineDemo";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
567C3E232520B6DF0011F6E9 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
567C3E242520B6DF0011F6E9 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
567C3E262520B6DF0011F6E9 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"GRDBCombineDemo/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
567C3E272520B6DF0011F6E9 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"GRDBCombineDemo/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBCombineDemoTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
56026C9F25B8A7D000D1DF3F /* Debug */,
|
||||
56026CA025B8A7D000D1DF3F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBCombineDemo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
567C3E232520B6DF0011F6E9 /* Debug */,
|
||||
567C3E242520B6DF0011F6E9 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBCombineDemo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
567C3E262520B6DF0011F6E9 /* Debug */,
|
||||
567C3E272520B6DF0011F6E9 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 567C3E0E2520B6DE0011F6E9 /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/groue/Documents/git/groue/GRDB.swift/Documentation/DemoApps/GRBCombineDemo/GRDBCombineDemo.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1230"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
|
||||
BuildableName = "GRDBCombineDemo.app"
|
||||
BlueprintName = "GRDBCombineDemo"
|
||||
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "56026C9725B8A7D000D1DF3F"
|
||||
BuildableName = "GRDBCombineDemoTests.xctest"
|
||||
BlueprintName = "GRDBCombineDemoTests"
|
||||
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
|
||||
BuildableName = "GRDBCombineDemo.app"
|
||||
BlueprintName = "GRDBCombineDemo"
|
||||
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
|
||||
BuildableName = "GRDBCombineDemo.app"
|
||||
BlueprintName = "GRDBCombineDemo"
|
||||
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,143 @@
|
||||
import Combine
|
||||
import GRDB
|
||||
|
||||
/// AppDatabase lets the application access the database.
|
||||
///
|
||||
/// It applies the pratices recommended at
|
||||
/// https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
|
||||
struct AppDatabase {
|
||||
/// Creates an `AppDatabase`, and make sure the database schema is ready.
|
||||
init(_ dbWriter: DatabaseWriter) throws {
|
||||
self.dbWriter = dbWriter
|
||||
try migrator.migrate(dbWriter)
|
||||
}
|
||||
|
||||
/// Provides access to the database.
|
||||
///
|
||||
/// Application can use a `DatabasePool`, while SwiftUI previews and tests
|
||||
/// can use a fast in-memory `DatabaseQueue`.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
private let dbWriter: DatabaseWriter
|
||||
|
||||
/// The DatabaseMigrator that defines the database schema.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md
|
||||
private var migrator: DatabaseMigrator {
|
||||
var migrator = DatabaseMigrator()
|
||||
|
||||
#if DEBUG
|
||||
// Speed up development by nuking the database when migrations change
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md#the-erasedatabaseonschemachange-option
|
||||
migrator.eraseDatabaseOnSchemaChange = true
|
||||
#endif
|
||||
|
||||
migrator.registerMigration("createPlayer") { db in
|
||||
// Create a table
|
||||
// See https://github.com/groue/GRDB.swift#create-tables
|
||||
try db.create(table: "player") { t in
|
||||
t.autoIncrementedPrimaryKey("id")
|
||||
t.column("name", .text).notNull()
|
||||
t.column("score", .integer).notNull()
|
||||
}
|
||||
}
|
||||
|
||||
// Migrations for future application versions will be inserted here:
|
||||
// migrator.registerMigration(...) { db in
|
||||
// ...
|
||||
// }
|
||||
|
||||
return migrator
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Database Access: Writes
|
||||
|
||||
extension AppDatabase {
|
||||
/// Saves (inserts or updates) a player. When the method returns, the
|
||||
/// player is present in the database, and its id is not nil.
|
||||
func savePlayer(_ player: inout Player) throws {
|
||||
try dbWriter.write { db in
|
||||
try player.save(db)
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the specified players
|
||||
func deletePlayers(ids: [Int64]) throws {
|
||||
try dbWriter.write { db in
|
||||
_ = try Player.deleteAll(db, keys: ids)
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete all players
|
||||
func deleteAllPlayers() throws {
|
||||
try dbWriter.write { db in
|
||||
_ = try Player.deleteAll(db)
|
||||
}
|
||||
}
|
||||
|
||||
/// Refresh all players (by performing some random changes, for demo purpose).
|
||||
func refreshPlayers() throws {
|
||||
try dbWriter.write { db in
|
||||
if try Player.fetchCount(db) == 0 {
|
||||
// When database is empty, insert new random players
|
||||
try createRandomPlayers(db)
|
||||
} else {
|
||||
// Insert a player
|
||||
if Bool.random() {
|
||||
var player = Player.newRandom()
|
||||
try player.insert(db)
|
||||
}
|
||||
|
||||
// Delete a random player
|
||||
if Bool.random() {
|
||||
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
|
||||
}
|
||||
|
||||
// Update some players
|
||||
for var player in try Player.fetchAll(db) where Bool.random() {
|
||||
try player.updateChanges(db) {
|
||||
$0.score = Player.randomScore()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Create random players if the database is empty.
|
||||
func createRandomPlayersIfEmpty() throws {
|
||||
try dbWriter.write { db in
|
||||
if try Player.fetchCount(db) == 0 {
|
||||
try createRandomPlayers(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
|
||||
private func createRandomPlayers(_ db: Database) throws {
|
||||
for _ in 0..<8 {
|
||||
var player = Player.newRandom()
|
||||
try player.insert(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Database Access: Reads
|
||||
|
||||
extension AppDatabase {
|
||||
/// Returns a publisher that tracks changes in players ordered by name
|
||||
func playersOrderedByNamePublisher() -> AnyPublisher<[Player], Error> {
|
||||
ValueObservation
|
||||
.tracking(Player.all().orderedByName().fetchAll)
|
||||
.publisher(in: dbWriter, scheduling: .immediate)
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
/// Returns a publisher that tracks changes in players ordered by score
|
||||
func playersOrderedByScorePublisher() -> AnyPublisher<[Player], Error> {
|
||||
ValueObservation
|
||||
.tracking(Player.all().orderedByScore().fetchAll)
|
||||
.publisher(in: dbWriter, scheduling: .immediate)
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct GRDBCombineDemoApp: App {
|
||||
let appDatabase = AppDatabase.shared
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
PlayerList(viewModel: PlayerListViewModel(database: appDatabase))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UILaunchScreen</key>
|
||||
<dict/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,58 @@
|
||||
import GRDB
|
||||
|
||||
extension AppDatabase {
|
||||
/// The database for the application
|
||||
static let shared = makeShared()
|
||||
|
||||
private static func makeShared() -> AppDatabase {
|
||||
do {
|
||||
// Create a folder for storing the SQLite database, as well as
|
||||
// the various temporary files created during normal database
|
||||
// operations (https://sqlite.org/tempfiles.html).
|
||||
let fileManager = FileManager()
|
||||
let folderURL = try fileManager
|
||||
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
||||
.appendingPathComponent("database", isDirectory: true)
|
||||
try fileManager.createDirectory(at: folderURL, withIntermediateDirectories: true)
|
||||
|
||||
// Connect to a database on disk
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
let dbURL = folderURL.appendingPathComponent("db.sqlite")
|
||||
let dbPool = try DatabasePool(path: dbURL.path)
|
||||
|
||||
// Create the AppDatabase
|
||||
let appDatabase = try AppDatabase(dbPool)
|
||||
|
||||
// Populate the database if it is empty, for better demo purpose.
|
||||
try appDatabase.createRandomPlayersIfEmpty()
|
||||
|
||||
return appDatabase
|
||||
} catch {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate.
|
||||
//
|
||||
// Typical reasons for an error here include:
|
||||
// * The parent directory cannot be created, or disallows writing.
|
||||
// * The database is not accessible, due to permissions or data protection when the device is locked.
|
||||
// * The device is out of space.
|
||||
// * The database could not be migrated to its latest schema version.
|
||||
// Check the error message to determine what the actual problem was.
|
||||
fatalError("Unresolved error \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates an empty database for SwiftUI previews
|
||||
static func empty() -> AppDatabase {
|
||||
// Connect to an in-memory database
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
let dbQueue = DatabaseQueue()
|
||||
return try! AppDatabase(dbQueue)
|
||||
}
|
||||
|
||||
/// Creates a database full of random players for SwiftUI previews
|
||||
static func random() -> AppDatabase {
|
||||
let appDatabase = empty()
|
||||
try! appDatabase.createRandomPlayersIfEmpty()
|
||||
return appDatabase
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import GRDB
|
||||
|
||||
/// The Player struct.
|
||||
///
|
||||
/// Identifiable conformance supports SwiftUI list animations.
|
||||
/// Equatable conformance supports tests.
|
||||
struct Player: Identifiable, Equatable {
|
||||
/// The player id.
|
||||
///
|
||||
/// Int64 is the recommended type for auto-incremented database ids.
|
||||
/// Use nil for players that are not inserted yet in the database.
|
||||
var id: Int64?
|
||||
var name: String
|
||||
var score: Int
|
||||
}
|
||||
|
||||
extension Player {
|
||||
private static let names = [
|
||||
"Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David",
|
||||
"Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette",
|
||||
"Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl",
|
||||
"Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole",
|
||||
"Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul",
|
||||
"Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain",
|
||||
"Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann",
|
||||
"Zazie", "Zoé"]
|
||||
|
||||
/// Creates a new player with empty name and zero score
|
||||
static func new() -> Player {
|
||||
Player(id: nil, name: "", score: 0)
|
||||
}
|
||||
|
||||
/// Creates a new player with random name and random score
|
||||
static func newRandom() -> Player {
|
||||
Player(id: nil, name: randomName(), score: randomScore())
|
||||
}
|
||||
|
||||
/// Returns a random name
|
||||
static func randomName() -> String {
|
||||
names.randomElement()!
|
||||
}
|
||||
|
||||
/// Returns a random score
|
||||
static func randomScore() -> Int {
|
||||
10 * Int.random(in: 0...100)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Persistence
|
||||
|
||||
/// Make Player a Codable Record.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#records
|
||||
extension Player: Codable, FetchableRecord, MutablePersistableRecord {
|
||||
// Define database columns from CodingKeys
|
||||
fileprivate enum Columns {
|
||||
static let name = Column(CodingKeys.name)
|
||||
static let score = Column(CodingKeys.score)
|
||||
}
|
||||
|
||||
/// Updates a player id after it has been inserted in the database.
|
||||
mutating func didInsert(with rowID: Int64, for column: String?) {
|
||||
id = rowID
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Player Database Requests
|
||||
|
||||
/// Define some player requests used by the application.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#requests
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
|
||||
extension DerivableRequest where RowDecoder == Player {
|
||||
/// A request of players ordered by name.
|
||||
///
|
||||
/// For example:
|
||||
///
|
||||
/// let players: [Player] = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByName().fetchAll(db)
|
||||
/// }
|
||||
func orderedByName() -> Self {
|
||||
// Sort by name in a localized case insensitive fashion
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
|
||||
order(Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
|
||||
}
|
||||
|
||||
/// A request of players ordered by score.
|
||||
///
|
||||
/// For example:
|
||||
///
|
||||
/// let players: [Player] = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByScore().fetchAll(db)
|
||||
/// }
|
||||
/// let bestPlayer: Player? = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByScore().fetchOne(db)
|
||||
/// }
|
||||
func orderedByScore() -> Self {
|
||||
// Sort by descending score, and then by name, in a
|
||||
// localized case insensitive fashion
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
|
||||
order(
|
||||
Player.Columns.score.desc,
|
||||
Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -1,71 +1,112 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"filename" : "icon_20pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"filename" : "icon_20pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"filename" : "icon_29pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_29pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_40pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_40pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"filename" : "icon_60pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"filename" : "icon_60pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_20pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_20pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_29pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_29pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_40pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_40pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_76pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_76pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
After Width: | Height: | Size: 329 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "LaunchIcon.pdf",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchIcon" translatesAutoresizingMaskIntoConstraints="NO" id="Sgi-te-PKu">
|
||||
<rect key="frame" x="123.5" y="334.5" width="167" height="237"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Sgi-te-PKu" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="KT7-xd-gV4"/>
|
||||
<constraint firstItem="Sgi-te-PKu" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="feL-Vs-SeN"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchIcon" width="167" height="237"/>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>%lld Players</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
<string>%#@VARIABLE@</string>
|
||||
<key>VARIABLE</key>
|
||||
<dict>
|
||||
<key>NSStringFormatSpecTypeKey</key>
|
||||
<string>NSStringPluralRuleType</string>
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>lld</string>
|
||||
<key>zero</key>
|
||||
<string>No Player</string>
|
||||
<key>one</key>
|
||||
<string>1 Player</string>
|
||||
<key>other</key>
|
||||
<string>%lld Players</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>%lld points</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
<string>%#@VARIABLE@</string>
|
||||
<key>VARIABLE</key>
|
||||
<dict>
|
||||
<key>NSStringFormatSpecTypeKey</key>
|
||||
<string>NSStringPluralRuleType</string>
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>lld</string>
|
||||
<key>zero</key>
|
||||
<string>0 point</string>
|
||||
<key>one</key>
|
||||
<string>1 point</string>
|
||||
<key>other</key>
|
||||
<string>%lld points</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,67 @@
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
/// The view model that validates and saves an edited player into the database.
|
||||
///
|
||||
/// It feeds `PlayerForm`, `PlayerCreationSheet` and `PlayerEditionView`.
|
||||
final class PlayerFormViewModel: ObservableObject {
|
||||
/// A validation error that prevents the player from being saved into
|
||||
/// the database.
|
||||
enum ValidationError: LocalizedError {
|
||||
case missingName
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .missingName:
|
||||
return "Please give a name to this player."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Published var name: String = ""
|
||||
@Published var score: String = ""
|
||||
|
||||
private let database: AppDatabase
|
||||
private var player: Player
|
||||
|
||||
init(database: AppDatabase, player: Player) {
|
||||
self.database = database
|
||||
self.player = player
|
||||
updateViewFromPlayer()
|
||||
}
|
||||
|
||||
// MARK: - Manage the Player Form
|
||||
|
||||
/// Validates and saves the player into the database.
|
||||
func savePlayer() throws {
|
||||
if name.isEmpty {
|
||||
throw ValidationError.missingName
|
||||
}
|
||||
player.name = name
|
||||
player.score = Int(score) ?? 0
|
||||
try database.savePlayer(&player)
|
||||
}
|
||||
|
||||
/// Resets form values to the original player values.
|
||||
func reset() {
|
||||
updateViewFromPlayer()
|
||||
}
|
||||
|
||||
/// Edits a new player
|
||||
func editNewPlayer() {
|
||||
player = .new()
|
||||
updateViewFromPlayer()
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateViewFromPlayer() {
|
||||
self.name = player.name
|
||||
if player.score == 0 && player.id == nil {
|
||||
// Avoid displaying "0" for a new player: it does not look good.
|
||||
self.score = ""
|
||||
} else {
|
||||
self.score = "\(player.score)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
/// The view model that feeds `PlayerList`, and performs list modifications
|
||||
/// in the database.
|
||||
final class PlayerListViewModel: ObservableObject {
|
||||
enum Ordering {
|
||||
case byScore
|
||||
case byName
|
||||
}
|
||||
|
||||
struct PlayerList {
|
||||
var players: [Player]
|
||||
var animatedChanges: Bool
|
||||
}
|
||||
|
||||
/// The list ordering
|
||||
@Published var ordering: Ordering = .byScore
|
||||
|
||||
/// The players in the list
|
||||
@Published var playerList = PlayerList(players: [], animatedChanges: false)
|
||||
|
||||
/// The view model that edits a new player
|
||||
let newPlayerViewModel: PlayerFormViewModel
|
||||
|
||||
private let database: AppDatabase
|
||||
private var playersCancellable: AnyCancellable?
|
||||
|
||||
init(database: AppDatabase) {
|
||||
self.database = database
|
||||
newPlayerViewModel = PlayerFormViewModel(database: database, player: .new())
|
||||
playersCancellable = playersPublisher(in: database)
|
||||
.scan(nil) { (previousList: PlayerList?, players: [Player]) in
|
||||
if previousList == nil {
|
||||
// Do not animate first view update
|
||||
return PlayerList(players: players, animatedChanges: false)
|
||||
} else {
|
||||
return PlayerList(players: players, animatedChanges: true)
|
||||
}
|
||||
}
|
||||
.compactMap { $0 }
|
||||
.sink { [weak self] playerList in
|
||||
self?.playerList = playerList
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Players List Management
|
||||
|
||||
/// Deletes all players
|
||||
func deleteAllPlayers() {
|
||||
// Eventual error presentation is left as an exercise for the reader.
|
||||
try! database.deleteAllPlayers()
|
||||
}
|
||||
|
||||
func deletePlayers(atOffsets offsets: IndexSet) {
|
||||
// Eventual error presentation is left as an exercise for the reader.
|
||||
let playerIDs = offsets.compactMap { playerList.players[$0].id }
|
||||
try! database.deletePlayers(ids: playerIDs)
|
||||
}
|
||||
|
||||
/// Refreshes the list of players
|
||||
func refreshPlayers() {
|
||||
// Eventual error presentation is left as an exercise for the reader.
|
||||
try! database.refreshPlayers()
|
||||
}
|
||||
|
||||
/// Spawns many concurrent database updates, for demo purpose
|
||||
func stressTest() {
|
||||
for _ in 0..<50 {
|
||||
DispatchQueue.global().async {
|
||||
self.refreshPlayers()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Change Player Ordering
|
||||
|
||||
/// Toggles between the available orderings
|
||||
func toggleOrdering() {
|
||||
switch ordering {
|
||||
case .byName:
|
||||
ordering = .byScore
|
||||
case .byScore:
|
||||
ordering = .byName
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Player Edition
|
||||
|
||||
/// Returns a view model suitable for editing a player.
|
||||
func formViewModel(for player: Player) -> PlayerFormViewModel {
|
||||
PlayerFormViewModel(database: database, player: player)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// Returns a publisher of the players in the list
|
||||
private func playersPublisher(in database: AppDatabase) -> AnyPublisher<[Player], Never> {
|
||||
// Players depend on the current ordering
|
||||
$ordering.map { ordering -> AnyPublisher<[Player], Error> in
|
||||
switch ordering {
|
||||
case .byScore:
|
||||
return database.playersOrderedByScorePublisher()
|
||||
case .byName:
|
||||
return database.playersOrderedByNamePublisher()
|
||||
}
|
||||
}
|
||||
.map { playersPublisher in
|
||||
// Turn database errors into an empty players list.
|
||||
// Eventual error presentation is left as an exercise for the reader.
|
||||
playersPublisher.catch { error in
|
||||
Just<[Player]>([])
|
||||
}
|
||||
}
|
||||
.switchToLatest()
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The Player creation sheet
|
||||
struct PlayerCreationSheet: View {
|
||||
/// Manages the player form
|
||||
let viewModel: PlayerFormViewModel
|
||||
|
||||
/// Executed when user cancels or saves the new user.
|
||||
let dismissAction: () -> Void
|
||||
|
||||
@State private var errorAlertIsPresented = false
|
||||
@State private var errorAlertTitle = ""
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
PlayerForm(viewModel: viewModel)
|
||||
.alert(
|
||||
isPresented: $errorAlertIsPresented,
|
||||
content: { Alert(title: Text(errorAlertTitle)) })
|
||||
.navigationBarTitle("New Player")
|
||||
.navigationBarItems(
|
||||
leading: Button(
|
||||
action: self.dismissAction,
|
||||
label: { Text("Cancel") }),
|
||||
trailing: Button(
|
||||
action: self.save,
|
||||
label: { Text("Save") }))
|
||||
}
|
||||
}
|
||||
|
||||
private func save() {
|
||||
do {
|
||||
try viewModel.savePlayer()
|
||||
dismissAction()
|
||||
} catch {
|
||||
errorAlertTitle = (error as? LocalizedError)?.errorDescription ?? "An error occurred"
|
||||
errorAlertIsPresented = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerCreationSheet_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let viewModel = PlayerFormViewModel(
|
||||
database: .empty(),
|
||||
player: .new())
|
||||
|
||||
return PlayerCreationSheet(
|
||||
viewModel: viewModel,
|
||||
dismissAction: { })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The Player edition view, designed to be the destination of
|
||||
/// a NavigationLink.
|
||||
struct PlayerEditionView: View {
|
||||
/// Manages the player form
|
||||
let viewModel: PlayerFormViewModel
|
||||
|
||||
var body: some View {
|
||||
PlayerForm(viewModel: viewModel)
|
||||
.onDisappear(perform: {
|
||||
// Ignore validation errors
|
||||
try? self.viewModel.savePlayer()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerEditionView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let viewModel = PlayerFormViewModel(
|
||||
database: .empty(),
|
||||
player: .newRandom())
|
||||
|
||||
return NavigationView {
|
||||
PlayerEditionView(viewModel: viewModel)
|
||||
.navigationBarTitle("Player Edition")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The Player editing form, embedded in both
|
||||
/// `PlayerCreationSheet` and `PlayerEditionView`.
|
||||
struct PlayerForm: View {
|
||||
/// Manages the player form
|
||||
@ObservedObject var viewModel: PlayerFormViewModel
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
TextField("Name", text: $viewModel.name)
|
||||
TextField("Score", text: $viewModel.score)
|
||||
.keyboardType(.numberPad)
|
||||
}
|
||||
.listStyle(GroupedListStyle())
|
||||
// Make sure the form is reset, in case a previous edition ended
|
||||
// with a validation error.
|
||||
//
|
||||
// The bug we want to prevent is the following:
|
||||
//
|
||||
// 1. Launch the app
|
||||
// 2. Tap a player
|
||||
// 3. Erase the name so that validation fails
|
||||
// 4. Hit the back button
|
||||
// 5. Tap the same player
|
||||
// 6. Bug: the form displays an empty name.
|
||||
.onAppear(perform: viewModel.reset)
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerFormView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let viewModel = PlayerFormViewModel(
|
||||
database: .empty(),
|
||||
player: .newRandom())
|
||||
|
||||
return PlayerForm(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The list of players
|
||||
struct PlayerList: View {
|
||||
/// Manages the list of players
|
||||
@ObservedObject var viewModel: PlayerListViewModel
|
||||
|
||||
/// Controls the presentation of the player creation sheet.
|
||||
@State private var newPlayerIsPresented = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
VStack {
|
||||
playerList
|
||||
toolbar
|
||||
}
|
||||
.navigationBarTitle(Text("\(viewModel.playerList.players.count) Players"))
|
||||
.navigationBarItems(
|
||||
leading: HStack {
|
||||
EditButton()
|
||||
newPlayerButton
|
||||
},
|
||||
trailing: toggleOrderingButton)
|
||||
}
|
||||
}
|
||||
|
||||
private var playerList: some View {
|
||||
List {
|
||||
ForEach(viewModel.playerList.players) { player in
|
||||
NavigationLink(destination: self.editionView(for: player)) {
|
||||
PlayerRow(player: player)
|
||||
.animation(nil)
|
||||
}
|
||||
}
|
||||
.onDelete(perform: { offsets in
|
||||
self.viewModel.deletePlayers(atOffsets: offsets)
|
||||
})
|
||||
}
|
||||
.listStyle(PlainListStyle())
|
||||
.animation(viewModel.playerList.animatedChanges ? .default : nil)
|
||||
}
|
||||
|
||||
private var toolbar: some View {
|
||||
HStack {
|
||||
Button(
|
||||
action: viewModel.deleteAllPlayers,
|
||||
label: { Image(systemName: "trash").imageScale(.large) })
|
||||
Spacer()
|
||||
Button(
|
||||
action: viewModel.refreshPlayers,
|
||||
label: { Image(systemName: "arrow.clockwise").imageScale(.large) })
|
||||
Spacer()
|
||||
Button(
|
||||
action: viewModel.stressTest,
|
||||
label: { Image(systemName: "tornado").imageScale(.large) })
|
||||
}
|
||||
|
||||
.padding()
|
||||
}
|
||||
|
||||
/// The button that toggles between name/score ordering.
|
||||
private var toggleOrderingButton: some View {
|
||||
switch viewModel.ordering {
|
||||
case .byName:
|
||||
return Button(action: viewModel.toggleOrdering, label: {
|
||||
HStack {
|
||||
Text("Name")
|
||||
Image(systemName: "arrowtriangle.up.fill")
|
||||
.imageScale(.small)
|
||||
}
|
||||
})
|
||||
case .byScore:
|
||||
return Button(action: viewModel.toggleOrdering, label: {
|
||||
HStack {
|
||||
Text("Score")
|
||||
Image(systemName: "arrowtriangle.down.fill")
|
||||
.imageScale(.small)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// The view that edits a player in the list.
|
||||
private func editionView(for player: Player) -> some View {
|
||||
PlayerEditionView(
|
||||
viewModel: viewModel.formViewModel(for: player))
|
||||
.navigationBarTitle(player.name)
|
||||
}
|
||||
|
||||
/// The button that presents the player creation sheet.
|
||||
private var newPlayerButton: some View {
|
||||
Button(
|
||||
action: {
|
||||
// Make sure we do not edit a previously created player.
|
||||
self.viewModel.newPlayerViewModel.editNewPlayer()
|
||||
self.newPlayerIsPresented = true
|
||||
},
|
||||
label: { Image(systemName: "plus").imageScale(.large) })
|
||||
.sheet(
|
||||
isPresented: $newPlayerIsPresented,
|
||||
content: { self.newPlayerCreationSheet })
|
||||
}
|
||||
|
||||
/// The player creation sheet.
|
||||
private var newPlayerCreationSheet: some View {
|
||||
PlayerCreationSheet(
|
||||
viewModel: self.viewModel.newPlayerViewModel,
|
||||
dismissAction: {
|
||||
self.newPlayerIsPresented = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerRow: View {
|
||||
var player: Player
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Text(player.name)
|
||||
Spacer()
|
||||
Text("\(player.score) points").foregroundColor(.gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerListView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let viewModel = PlayerListViewModel(database: .random())
|
||||
return PlayerList(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
import XCTest
|
||||
import GRDB
|
||||
@testable import GRDBCombineDemo
|
||||
|
||||
class AppDatabaseTests: XCTestCase {
|
||||
func test_database_schema() throws {
|
||||
// Given an empty database
|
||||
let dbQueue = DatabaseQueue()
|
||||
|
||||
// When we instantiate an AppDatabase
|
||||
_ = try AppDatabase(dbQueue)
|
||||
|
||||
// Then the player table exists, with id, name & score columns
|
||||
try dbQueue.read { db in
|
||||
try XCTAssert(db.tableExists("player"))
|
||||
let columns = try db.columns(in: "player")
|
||||
let columnNames = Set(columns.map { $0.name })
|
||||
XCTAssertEqual(columnNames, ["id", "name", "score"])
|
||||
}
|
||||
}
|
||||
|
||||
func test_savePlayer_inserts() throws {
|
||||
// Given an empty players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
|
||||
// When we save a new player
|
||||
var player = Player(id: nil, name: "Arthur", score: 100)
|
||||
try appDatabase.savePlayer(&player)
|
||||
|
||||
// Then the player exists in the database
|
||||
try XCTAssertTrue(dbQueue.read(player.exists))
|
||||
}
|
||||
|
||||
func test_savePlayer_updates() throws {
|
||||
// Given a players database that contains a player
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player = Player(id: nil, name: "Arthur", score: 100)
|
||||
try dbQueue.write { db in
|
||||
try player.insert(db)
|
||||
}
|
||||
|
||||
// When we modify and save the player
|
||||
player.name = "Barbara"
|
||||
player.score = 1000
|
||||
try appDatabase.savePlayer(&player)
|
||||
|
||||
// Then the player has been updated in the database
|
||||
let fetchedPlayer = try dbQueue.read { db in
|
||||
try XCTUnwrap(Player.fetchOne(db, key: player.id))
|
||||
}
|
||||
XCTAssertEqual(fetchedPlayer, player)
|
||||
}
|
||||
|
||||
func test_deletePlayers() throws {
|
||||
// Given a players database that contains four players
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: nil, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: nil, name: "Barbara", score: 200)
|
||||
var player3 = Player(id: nil, name: "Craig", score: 150)
|
||||
var player4 = Player(id: nil, name: "David", score: 120)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
try player3.insert(db)
|
||||
try player4.insert(db)
|
||||
}
|
||||
|
||||
// When we delete two players
|
||||
try appDatabase.deletePlayers(ids: [player1.id!, player3.id!])
|
||||
|
||||
// Then the deleted players no longer exist
|
||||
try dbQueue.read { db in
|
||||
try XCTAssertFalse(player1.exists(db))
|
||||
try XCTAssertFalse(player3.exists(db))
|
||||
}
|
||||
|
||||
// Then the database still contains two players
|
||||
try XCTAssertEqual(dbQueue.read(Player.fetchCount), 2)
|
||||
}
|
||||
|
||||
func test_deleteAllPlayers() throws {
|
||||
// Given a players database that contains players
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: nil, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: nil, name: "Barbara", score: 200)
|
||||
var player3 = Player(id: nil, name: "Craig", score: 150)
|
||||
var player4 = Player(id: nil, name: "David", score: 120)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
try player3.insert(db)
|
||||
try player4.insert(db)
|
||||
}
|
||||
|
||||
// When we delete all players
|
||||
try appDatabase.deleteAllPlayers()
|
||||
|
||||
// Then the database does not contain any player
|
||||
try XCTAssertEqual(dbQueue.read(Player.fetchCount), 0)
|
||||
}
|
||||
|
||||
func test_refreshPlayers_populates_an_empty_database() throws {
|
||||
// Given an empty players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
|
||||
// When we refresh players
|
||||
try appDatabase.refreshPlayers()
|
||||
|
||||
// Then the database is not empty
|
||||
try XCTAssert(dbQueue.read(Player.fetchCount) > 0)
|
||||
}
|
||||
|
||||
func test_createRandomPlayersIfEmpty_populates_an_empty_database() throws {
|
||||
// Given an empty players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
|
||||
// When we create random players
|
||||
try appDatabase.createRandomPlayersIfEmpty()
|
||||
|
||||
// Then the database is not empty
|
||||
try XCTAssert(dbQueue.read(Player.fetchCount) > 0)
|
||||
}
|
||||
|
||||
func test_createRandomPlayersIfEmpty_does_not_modify_a_non_empty_database() throws {
|
||||
// Given a players database that contains one player
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player = Player(id: nil, name: "Arthur", score: 100)
|
||||
try dbQueue.write { db in
|
||||
try player.insert(db)
|
||||
}
|
||||
|
||||
// When we create random players
|
||||
try appDatabase.createRandomPlayersIfEmpty()
|
||||
|
||||
// Then the database still only contains the original player
|
||||
let players = try dbQueue.read(Player.fetchAll)
|
||||
XCTAssertEqual(players, [player])
|
||||
}
|
||||
|
||||
func test_playersOrderedByNamePublisher_publishes_well_ordered_players() throws {
|
||||
// Given a players database that contains two players
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: nil, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: nil, name: "Barbara", score: 1000)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
}
|
||||
|
||||
// When we observe players and wait for the first value
|
||||
let exp = expectation(description: "Players")
|
||||
var players: [Player]?
|
||||
let cancellable = appDatabase.playersOrderedByNamePublisher().sink { completion in
|
||||
if case let .failure(error) = completion {
|
||||
XCTFail("Unexpected error \(error)")
|
||||
}
|
||||
} receiveValue: {
|
||||
players = $0
|
||||
exp.fulfill()
|
||||
}
|
||||
withExtendedLifetime(cancellable) {
|
||||
waitForExpectations(timeout: 1, handler: nil)
|
||||
}
|
||||
|
||||
// Then the players are the two players ordered by name
|
||||
XCTAssertEqual(players, [player1, player2])
|
||||
}
|
||||
|
||||
func test_playersOrderedByNamePublisher_publishes_right_on_subscripion() throws {
|
||||
// Our SwiftUI views have no "waiting" state, and must be fed with
|
||||
// players without any delay in order to avoid any rendering glitch.
|
||||
// This test makes sure `playersOrderedByNamePublisher` publishes right
|
||||
// on subscription.
|
||||
|
||||
// Given a players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
|
||||
// When we observe players
|
||||
var players: [Player]?
|
||||
_ = appDatabase.playersOrderedByNamePublisher().sink { completion in
|
||||
if case let .failure(error) = completion {
|
||||
XCTFail("Unexpected error \(error)")
|
||||
}
|
||||
} receiveValue: {
|
||||
players = $0
|
||||
}
|
||||
|
||||
// Then the players are published right on subscription
|
||||
XCTAssertNotNil(players)
|
||||
}
|
||||
|
||||
func test_playersOrderedByScorePublisher_publishes_well_ordered_players() throws {
|
||||
// Given a players database that contains two players
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: nil, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: nil, name: "Barbara", score: 1000)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
}
|
||||
|
||||
// When we observe players and wait for the first value
|
||||
let exp = expectation(description: "Players")
|
||||
var players: [Player]?
|
||||
let cancellable = appDatabase.playersOrderedByScorePublisher().sink { completion in
|
||||
if case let .failure(error) = completion {
|
||||
XCTFail("Unexpected error \(error)")
|
||||
}
|
||||
} receiveValue: {
|
||||
players = $0
|
||||
exp.fulfill()
|
||||
}
|
||||
withExtendedLifetime(cancellable) {
|
||||
waitForExpectations(timeout: 1, handler: nil)
|
||||
}
|
||||
|
||||
// Then the players are the two players ordered by score descending
|
||||
XCTAssertEqual(players, [player2, player1])
|
||||
}
|
||||
|
||||
func test_playersOrderedByScorePublisher_publishes_right_on_subscripion() throws {
|
||||
// Our SwiftUI views have no "waiting" state, and must be fed with
|
||||
// players without any delay in order to avoid any rendering glitch.
|
||||
// This test makes sure `playersOrderedByScorePublisher` publishes right
|
||||
// on subscription.
|
||||
|
||||
// Given a players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
let appDatabase = try AppDatabase(dbQueue)
|
||||
|
||||
// When we observe players
|
||||
var players: [Player]?
|
||||
_ = appDatabase.playersOrderedByScorePublisher().sink { completion in
|
||||
if case let .failure(error) = completion {
|
||||
XCTFail("Unexpected error \(error)")
|
||||
}
|
||||
} receiveValue: {
|
||||
players = $0
|
||||
}
|
||||
|
||||
// Then the players are published right on subscription
|
||||
XCTAssertNotNil(players)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,108 @@
|
||||
import XCTest
|
||||
import GRDB
|
||||
@testable import GRDBCombineDemo
|
||||
|
||||
class PlayerTests: XCTestCase {
|
||||
// MARK: - CRUD
|
||||
// Test that our Player type properly talks to GRDB.
|
||||
|
||||
func testInsert() throws {
|
||||
// Given an empty players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
_ = try AppDatabase(dbQueue)
|
||||
|
||||
// When we insert a player
|
||||
var player = Player(id: nil, name: "Arthur", score: 100)
|
||||
try dbQueue.write { db in
|
||||
try player.insert(db)
|
||||
}
|
||||
|
||||
// Then the player gets a non-nil id
|
||||
XCTAssertNotNil(player.id)
|
||||
}
|
||||
|
||||
func testRoundtrip() throws {
|
||||
// Given an empty players database
|
||||
let dbQueue = DatabaseQueue()
|
||||
_ = try AppDatabase(dbQueue)
|
||||
|
||||
// When we insert a player and fetch the player with the same id
|
||||
var insertedPlayer = Player(id: nil, name: "Arthur", score: 100)
|
||||
let fetchedPlayer: Player? = try dbQueue.write { db in
|
||||
try insertedPlayer.insert(db)
|
||||
return try Player.fetchOne(db, key: insertedPlayer.id)
|
||||
}
|
||||
|
||||
// Then the fetched player is equal to the inserted player
|
||||
XCTAssertEqual(insertedPlayer, fetchedPlayer)
|
||||
}
|
||||
|
||||
// MARK: - Requests
|
||||
// Test that requests defined on the Player type behave as expected.
|
||||
|
||||
func testOrderedByScore() throws {
|
||||
// Given a players database that contains players with distinct scores
|
||||
let dbQueue = DatabaseQueue()
|
||||
_ = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: 1, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: 2, name: "Barbara", score: 200)
|
||||
var player3 = Player(id: 3, name: "Craig", score: 150)
|
||||
var player4 = Player(id: 4, name: "David", score: 120)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
try player3.insert(db)
|
||||
try player4.insert(db)
|
||||
}
|
||||
|
||||
// When we fetch players ordered by score
|
||||
let players = try dbQueue.read(Player.all().orderedByScore().fetchAll)
|
||||
|
||||
// Then fetched players are ordered by score descending
|
||||
XCTAssertEqual(players, [player2, player3, player4, player1])
|
||||
}
|
||||
|
||||
func testOrderedByScoreSortsIdenticalScoresByName() throws {
|
||||
// Given a players database that contains players with common scores
|
||||
let dbQueue = DatabaseQueue()
|
||||
_ = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: 1, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: 2, name: "Barbara", score: 200)
|
||||
var player3 = Player(id: 3, name: "Craig", score: 200)
|
||||
var player4 = Player(id: 4, name: "David", score: 200)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
try player3.insert(db)
|
||||
try player4.insert(db)
|
||||
}
|
||||
|
||||
// When we fetch players ordered by score
|
||||
let players = try dbQueue.read(Player.all().orderedByScore().fetchAll)
|
||||
|
||||
// Then fetched players are ordered by score descending and by name
|
||||
XCTAssertEqual(players, [player2, player3, player4, player1])
|
||||
}
|
||||
|
||||
func testOrderedByName() throws {
|
||||
// Given a players database that contains players with distinct names
|
||||
let dbQueue = DatabaseQueue()
|
||||
_ = try AppDatabase(dbQueue)
|
||||
var player1 = Player(id: 1, name: "Arthur", score: 100)
|
||||
var player2 = Player(id: 2, name: "Barbara", score: 200)
|
||||
var player3 = Player(id: 3, name: "Craig", score: 150)
|
||||
var player4 = Player(id: 4, name: "David", score: 120)
|
||||
try dbQueue.write { db in
|
||||
try player1.insert(db)
|
||||
try player2.insert(db)
|
||||
try player3.insert(db)
|
||||
try player4.insert(db)
|
||||
}
|
||||
|
||||
// When we fetch players ordered by name
|
||||
let players = try dbQueue.read(Player.all().orderedByName().fetchAll)
|
||||
|
||||
// Then fetched players are ordered by name
|
||||
XCTAssertEqual(players, [player1, player2, player3, player4])
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
Combine + SwiftUI Demo Application
|
||||
==================================
|
||||
|
||||
<img align="right" src="https://github.com/groue/GRDB.swift/raw/master/Documentation/DemoApps/GRDBCombineDemo/Screenshot.png" width="50%">
|
||||
|
||||
**This demo application is a Combine + SwiftUI application, based on the MVVM design pattern.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md).
|
||||
|
||||
> :point_up: **Note**: This demo app is not a project template. Do not copy it as a starting point for your application. Instead, create a new project, choose a GRDB [installation method](../../../README.md#installation), and use the demo as an inspiration.
|
||||
|
||||
The topics covered in this demo are:
|
||||
|
||||
- How to setup a database in an iOS app.
|
||||
- How to define a simple [Codable Record](../../../README.md#codable-records).
|
||||
- How to track database changes and animate a SwiftUI List with [ValueObservation](../../../README.md#valueobservation) Combine publishers.
|
||||
- How to apply the recommendations of [Good Practices for Designing Record Types](../../GoodPracticesForDesigningRecordTypes.md).
|
||||
- How to feed SwiftUI previews with a transient database.
|
||||
|
||||
**Files of interest:**
|
||||
|
||||
- [GRDBCombineDemoApp.swift](GRDBCombineDemo/GRDBCombineDemoApp.swift)
|
||||
|
||||
`GRDBCombineDemoApp` feeds the app views with a database.
|
||||
|
||||
- [AppDatabase.swift](GRDBCombineDemo/AppDatabase.swift)
|
||||
|
||||
`AppDatabase` is the type that grants database access. It uses [DatabaseMigrator](../../Migrations.md) in order to setup the database schema, and [ValueObservation](../../../README.md#valueobservation) in order to let the application observe database changes.
|
||||
|
||||
- [Persistence.swift](GRDBCombineDemo/Persistence.swift)
|
||||
|
||||
This file instantiates various `AppDatabase` for the various projects needs: one database on disk for the application, and in-memory databases for SwiftUI previews.
|
||||
|
||||
- [Player.swift](GRDBCombineDemo/Player.swift)
|
||||
|
||||
`Player` is a [Record](../../../README.md#records) type, able to read and write in the database. It conforms to the standard Codable protocol in order to gain all advantages of [Codable Records](../../../README.md#codable-records). It defines the database requests used by the application.
|
||||
|
||||
- [PlayerList.swift](GRDBCombineDemo/Views/PlayerList.swift) and [PlayerListViewModel.swift](GRDBCombineDemo/ViewModels/PlayerListViewModel.swift)
|
||||
|
||||
`PlayerList` is the SwiftUI view that displays the list of players, fed by `PlayerListViewModel`.
|
||||
|
||||
- [PlayerForm.swift](GRDBCombineDemo/Views/PlayerForm.swift), [PlayerEditionView.swift](GRDBCombineDemo/Views/PlayerEditionView.swift), [PlayerCreationSheet.swift](GRDBCombineDemo/Views/PlayerCreationSheet.swift) and [PlayerFormViewModel.swift](GRDBCombineDemo/ViewModels/PlayerFormViewModel.swift).
|
||||
|
||||
`PlayerForm` is the SwiftUI view that displays a Player editing form. It is embedded in `PlayerEditionView` and `PlayerCreationSheet`, two SwiftUI views that edit or create a player. All those views are fed by `PlayerFormViewModel`.
|
||||
|
||||
- [GRDBCombineDemoTests](GRDBCombineDemoTests)
|
||||
|
||||
- Test the database schema
|
||||
- Test the `Player` record and its requests
|
||||
- Test the `AppDatabase` methods that let the app access the database.
|
||||
|
After Width: | Height: | Size: 799 KiB |
@@ -15,6 +15,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
|
||||
// Use this method to pause ongoing tasks, disable timers, etc.
|
||||
}
|
||||
|
||||
@available(watchOSApplicationExtension 3.0, *)
|
||||
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
|
||||
// Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
|
||||
for task in backgroundTasks {
|
||||
@@ -25,7 +25,7 @@
|
||||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>WKAppBundleIdentifier</key>
|
||||
<string>com.github.groue.GRDBDemoiOS2.watchkitapp</string>
|
||||
<string>com.github.groue.GRDBDemoiOS.watchkitapp</string>
|
||||
</dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.watchkit</string>
|
||||
@@ -1,7 +1,6 @@
|
||||
import WatchKit
|
||||
import Foundation
|
||||
import GRDB
|
||||
import SQLite3
|
||||
|
||||
class InterfaceController: WKInterfaceController {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
</array>
|
||||
<key>WKCompanionAppBundleIdentifier</key>
|
||||
<string>com.github.groue.GRDBDemoiOS2</string>
|
||||
<string>com.github.groue.GRDBDemoiOS</string>
|
||||
<key>WKWatchKitApp</key>
|
||||
<true/>
|
||||
</dict>
|
||||
@@ -7,6 +7,13 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
56185BBF25B8036100B9C30F /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185BBE25B8036100B9C30F /* Persistence.swift */; };
|
||||
56185BF325B80B8900B9C30F /* AppDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */; };
|
||||
56185C0725B80CEC00B9C30F /* PlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185C0625B80CEC00B9C30F /* PlayerTests.swift */; };
|
||||
56606D202355938A00185962 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D142355931F00185962 /* GRDB.framework */; };
|
||||
56606D212355938A00185962 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D142355931F00185962 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
56606D24235593AB00185962 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D182355931F00185962 /* GRDB.framework */; };
|
||||
56606D25235593AB00185962 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D182355931F00185962 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
568E5FC31E926430002582E0 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FC11E926430002582E0 /* Interface.storyboard */; };
|
||||
568E5FC51E926430002582E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FC41E926430002582E0 /* Assets.xcassets */; };
|
||||
568E5FCC1E926430002582E0 /* GRDBDemoWatchOS Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 568E5FCB1E926430002582E0 /* GRDBDemoWatchOS Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
@@ -14,8 +21,6 @@
|
||||
568E5FD31E926430002582E0 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568E5FD21E926430002582E0 /* ExtensionDelegate.swift */; };
|
||||
568E5FD51E926430002582E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FD41E926430002582E0 /* Assets.xcassets */; };
|
||||
568E5FD91E926430002582E0 /* GRDBDemoWatchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */; };
|
||||
568E5FE41E926547002582E0 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0365B1E8D9F79003B6DA4 /* GRDB.framework */; };
|
||||
568E5FE51E926547002582E0 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0365B1E8D9F79003B6DA4 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
56B036071E8D9EBE003B6DA4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */; };
|
||||
56B0360C1E8D9EBE003B6DA4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */; };
|
||||
56B0360E1E8D9EBE003B6DA4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */; };
|
||||
@@ -23,18 +28,87 @@
|
||||
56B0361B1E8D9F38003B6DA4 /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036191E8D9F38003B6DA4 /* AppDatabase.swift */; };
|
||||
56B0361C1E8D9F38003B6DA4 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B0361A1E8D9F38003B6DA4 /* Player.swift */; };
|
||||
56B036231E8D9F4C003B6DA4 /* PlayerEditionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */; };
|
||||
56B036241E8D9F4C003B6DA4 /* PlayersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */; };
|
||||
56B0365E1E8D9FB1003B6DA4 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0364D1E8D9F79003B6DA4 /* GRDB.framework */; };
|
||||
56B0365F1E8D9FB1003B6DA4 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0364D1E8D9F79003B6DA4 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
56B036241E8D9F4C003B6DA4 /* PlayerListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */; };
|
||||
56FE6F2624A90CE400711EDF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56FE6F2524A90CE400711EDF /* SceneDelegate.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
563BD2F01F8364C1006A5390 /* PBXContainerItemProxy */ = {
|
||||
56185BF525B80B8900B9C30F /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B035FB1E8D9EBE003B6DA4 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 56B036021E8D9EBE003B6DA4;
|
||||
remoteInfo = GRDBDemoiOS;
|
||||
};
|
||||
56606D092355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56439B501F4CA1DC0066043F;
|
||||
remoteInfo = GRDBOSXPerformanceComparisonTests;
|
||||
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
|
||||
remoteInfo = GRDBOSX;
|
||||
};
|
||||
56606D0B2355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
|
||||
remoteInfo = GRDBOSXTests;
|
||||
};
|
||||
56606D112355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56553C181C3E906C00522B5C;
|
||||
remoteInfo = GRDBOSXCrashTests;
|
||||
};
|
||||
56606D132355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
56606D152355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
|
||||
remoteInfo = GRDBiOSTests;
|
||||
};
|
||||
56606D172355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 565490A01D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
56606D192355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = AAA4DCFE230F1E0600C74B15;
|
||||
remoteInfo = GRDBtvOS;
|
||||
};
|
||||
56606D1B2355931F00185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = AAA4DDD4230F262000C74B15;
|
||||
remoteInfo = GRDBtvOSTests;
|
||||
};
|
||||
56606D1D2355937900185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
56606D22235593A300185962 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 5654909F1D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
568E5FCD1E926430002582E0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
@@ -50,83 +124,6 @@
|
||||
remoteGlobalIDString = 568E5FBE1E926430002582E0;
|
||||
remoteInfo = GRDBDemoWatchOS;
|
||||
};
|
||||
568E5FE21E926535002582E0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 5654909F1D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
568E5FE61E926547002582E0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 5654909F1D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
56B0363A1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
|
||||
remoteInfo = GRDBOSX;
|
||||
};
|
||||
56B0363C1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
|
||||
remoteInfo = GRDBOSXTests;
|
||||
};
|
||||
56B0363E1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 560C981A1C0E22D300BF8471;
|
||||
remoteInfo = GRDBOSXPerformanceTests;
|
||||
};
|
||||
56B036401E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56553C181C3E906C00522B5C;
|
||||
remoteInfo = GRDBOSXCrashTests;
|
||||
};
|
||||
56B0364C1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
56B0364E1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
|
||||
remoteInfo = GRDBiOSTests;
|
||||
};
|
||||
56B0365A1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 565490A01D5A4798005622CB;
|
||||
remoteInfo = GRDBWatchOS;
|
||||
};
|
||||
56B0365C1E8D9F8F003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
56B036601E8D9FB1003B6DA4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
|
||||
remoteInfo = GRDBiOS;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@@ -158,7 +155,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
568E5FE51E926547002582E0 /* GRDB.framework in Embed Frameworks */,
|
||||
56606D25235593AB00185962 /* GRDB.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -169,7 +166,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
56B0365F1E8D9FB1003B6DA4 /* GRDB.framework in Embed Frameworks */,
|
||||
56606D212355938A00185962 /* GRDB.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -177,6 +174,11 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
56185BBE25B8036100B9C30F /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
|
||||
56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBDemoiOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabaseTests.swift; sourceTree = "<group>"; };
|
||||
56185BF425B80B8900B9C30F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
56185C0625B80CEC00B9C30F /* PlayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerTests.swift; sourceTree = "<group>"; };
|
||||
568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoWatchOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
568E5FC21E926430002582E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = "<group>"; };
|
||||
568E5FC41E926430002582E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
@@ -195,16 +197,24 @@
|
||||
56B036191E8D9F38003B6DA4 /* AppDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
|
||||
56B0361A1E8D9F38003B6DA4 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
|
||||
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerEditionViewController.swift; sourceTree = "<group>"; };
|
||||
56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayersViewController.swift; sourceTree = "<group>"; };
|
||||
56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../GRDB.xcodeproj; sourceTree = "<group>"; };
|
||||
56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerListViewController.swift; sourceTree = "<group>"; };
|
||||
56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
|
||||
56FE6F2524A90CE400711EDF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
56185BED25B80B8900B9C30F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
568E5FC81E926430002582E0 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
568E5FE41E926547002582E0 /* GRDB.framework in Frameworks */,
|
||||
56606D24235593AB00185962 /* GRDB.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -212,13 +222,45 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
56B0365E1E8D9FB1003B6DA4 /* GRDB.framework in Frameworks */,
|
||||
56606D202355938A00185962 /* GRDB.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
56185BF125B80B8900B9C30F /* GRDBDemoiOSTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56185BF425B80B8900B9C30F /* Info.plist */,
|
||||
56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */,
|
||||
56185C0625B80CEC00B9C30F /* PlayerTests.swift */,
|
||||
);
|
||||
path = GRDBDemoiOSTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56606CFD2355931F00185962 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56606D0A2355931F00185962 /* GRDB.framework */,
|
||||
56606D0C2355931F00185962 /* GRDBOSXTests.xctest */,
|
||||
56606D122355931F00185962 /* GRDBOSXCrashTests.xctest */,
|
||||
56606D142355931F00185962 /* GRDB.framework */,
|
||||
56606D162355931F00185962 /* GRDBiOSTests.xctest */,
|
||||
56606D182355931F00185962 /* GRDB.framework */,
|
||||
56606D1A2355931F00185962 /* GRDB.framework */,
|
||||
56606D1C2355931F00185962 /* GRDBtvOSTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56606D1F2355938A00185962 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
568E5FC01E926430002582E0 /* GRDBDemoWatchOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -247,7 +289,9 @@
|
||||
56B036051E8D9EBE003B6DA4 /* GRDBDemoiOS */,
|
||||
568E5FC01E926430002582E0 /* GRDBDemoWatchOS */,
|
||||
568E5FCF1E926430002582E0 /* GRDBDemoWatchOS Extension */,
|
||||
56185BF125B80B8900B9C30F /* GRDBDemoiOSTests */,
|
||||
56B036041E8D9EBE003B6DA4 /* Products */,
|
||||
56606D1F2355938A00185962 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -257,6 +301,7 @@
|
||||
56B036031E8D9EBE003B6DA4 /* GRDBDemoiOS.app */,
|
||||
568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */,
|
||||
568E5FCB1E926430002582E0 /* GRDBDemoWatchOS Extension.appex */,
|
||||
56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -264,37 +309,66 @@
|
||||
56B036051E8D9EBE003B6DA4 /* GRDBDemoiOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */,
|
||||
56B036191E8D9F38003B6DA4 /* AppDatabase.swift */,
|
||||
56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */,
|
||||
56185BBE25B8036100B9C30F /* Persistence.swift */,
|
||||
56B0361A1E8D9F38003B6DA4 /* Player.swift */,
|
||||
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */,
|
||||
56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */,
|
||||
56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */,
|
||||
56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */,
|
||||
56B0360F1E8D9EBE003B6DA4 /* LaunchScreen.storyboard */,
|
||||
56B036121E8D9EBE003B6DA4 /* Info.plist */,
|
||||
56FE6F2524A90CE400711EDF /* SceneDelegate.swift */,
|
||||
56FE6F4E24A9112900711EDF /* Resources */,
|
||||
56FE6F5124A9118000711EDF /* Support */,
|
||||
56FE6F4F24A9114200711EDF /* ViewControllers */,
|
||||
);
|
||||
path = GRDBDemoiOS;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56B036271E8D9F79003B6DA4 /* Products */ = {
|
||||
56FE6F4E24A9112900711EDF /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56B0363B1E8D9F79003B6DA4 /* GRDB.framework */,
|
||||
56B0363D1E8D9F79003B6DA4 /* GRDBOSXTests.xctest */,
|
||||
56B0363F1E8D9F79003B6DA4 /* GRDBOSXPerformanceTests.xctest */,
|
||||
563BD2F11F8364C1006A5390 /* GRDBOSXPerformanceComparisonTests.xctest */,
|
||||
56B036411E8D9F79003B6DA4 /* GRDBOSXCrashTests.xctest */,
|
||||
56B0364D1E8D9F79003B6DA4 /* GRDB.framework */,
|
||||
56B0364F1E8D9F79003B6DA4 /* GRDBiOSTests.xctest */,
|
||||
56B0365B1E8D9F79003B6DA4 /* GRDB.framework */,
|
||||
56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */,
|
||||
56B0360F1E8D9EBE003B6DA4 /* LaunchScreen.storyboard */,
|
||||
56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */,
|
||||
);
|
||||
name = Products;
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56FE6F4F24A9114200711EDF /* ViewControllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */,
|
||||
56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */,
|
||||
);
|
||||
path = ViewControllers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56FE6F5124A9118000711EDF /* Support */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56B036121E8D9EBE003B6DA4 /* Info.plist */,
|
||||
);
|
||||
name = Support;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
56185BEF25B80B8900B9C30F /* GRDBDemoiOSTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 56185BFF25B80B8900B9C30F /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */;
|
||||
buildPhases = (
|
||||
56185BEC25B80B8900B9C30F /* Sources */,
|
||||
56185BED25B80B8900B9C30F /* Frameworks */,
|
||||
56185BEE25B80B8900B9C30F /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
56185BF625B80B8900B9C30F /* PBXTargetDependency */,
|
||||
);
|
||||
name = GRDBDemoiOSTests;
|
||||
productName = GRDBDemoiOSTests;
|
||||
productReference = 56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 568E5FDE1E926430002582E0 /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS" */;
|
||||
@@ -324,8 +398,7 @@
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
568E5FE31E926535002582E0 /* PBXTargetDependency */,
|
||||
568E5FE71E926547002582E0 /* PBXTargetDependency */,
|
||||
56606D23235593A300185962 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "GRDBDemoWatchOS Extension";
|
||||
productName = "GRDBDemoWatchOS Extension";
|
||||
@@ -345,8 +418,7 @@
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
56B0365D1E8D9F8F003B6DA4 /* PBXTargetDependency */,
|
||||
56B036611E8D9FB1003B6DA4 /* PBXTargetDependency */,
|
||||
56606D1E2355937900185962 /* PBXTargetDependency */,
|
||||
568E5FD81E926430002582E0 /* PBXTargetDependency */,
|
||||
);
|
||||
name = GRDBDemoiOS;
|
||||
@@ -360,10 +432,16 @@
|
||||
56B035FB1E8D9EBE003B6DA4 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0830;
|
||||
LastUpgradeCheck = 1020;
|
||||
LastSwiftUpdateCheck = 1230;
|
||||
LastUpgradeCheck = 1200;
|
||||
ORGANIZATIONNAME = "Gwendal Roué";
|
||||
TargetAttributes = {
|
||||
56185BEF25B80B8900B9C30F = {
|
||||
CreatedOnToolsVersion = 12.3;
|
||||
DevelopmentTeam = AMD8W895CT;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 56B036021E8D9EBE003B6DA4;
|
||||
};
|
||||
568E5FBE1E926430002582E0 = {
|
||||
CreatedOnToolsVersion = 8.3;
|
||||
DevelopmentTeam = AMD8W895CT;
|
||||
@@ -396,7 +474,7 @@
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 56B036271E8D9F79003B6DA4 /* Products */;
|
||||
ProductGroup = 56606CFD2355931F00185962 /* Products */;
|
||||
ProjectRef = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
|
||||
},
|
||||
);
|
||||
@@ -405,70 +483,78 @@
|
||||
56B036021E8D9EBE003B6DA4 /* GRDBDemoiOS */,
|
||||
568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */,
|
||||
568E5FCA1E926430002582E0 /* GRDBDemoWatchOS Extension */,
|
||||
56185BEF25B80B8900B9C30F /* GRDBDemoiOSTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
563BD2F11F8364C1006A5390 /* GRDBOSXPerformanceComparisonTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXPerformanceComparisonTests.xctest;
|
||||
remoteRef = 563BD2F01F8364C1006A5390 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0363B1E8D9F79003B6DA4 /* GRDB.framework */ = {
|
||||
56606D0A2355931F00185962 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 56B0363A1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D092355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0363D1E8D9F79003B6DA4 /* GRDBOSXTests.xctest */ = {
|
||||
56606D0C2355931F00185962 /* GRDBOSXTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXTests.xctest;
|
||||
remoteRef = 56B0363C1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D0B2355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0363F1E8D9F79003B6DA4 /* GRDBOSXPerformanceTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXPerformanceTests.xctest;
|
||||
remoteRef = 56B0363E1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B036411E8D9F79003B6DA4 /* GRDBOSXCrashTests.xctest */ = {
|
||||
56606D122355931F00185962 /* GRDBOSXCrashTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBOSXCrashTests.xctest;
|
||||
remoteRef = 56B036401E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D112355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0364D1E8D9F79003B6DA4 /* GRDB.framework */ = {
|
||||
56606D142355931F00185962 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 56B0364C1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D132355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0364F1E8D9F79003B6DA4 /* GRDBiOSTests.xctest */ = {
|
||||
56606D162355931F00185962 /* GRDBiOSTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBiOSTests.xctest;
|
||||
remoteRef = 56B0364E1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D152355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56B0365B1E8D9F79003B6DA4 /* GRDB.framework */ = {
|
||||
56606D182355931F00185962 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 56B0365A1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
|
||||
remoteRef = 56606D172355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56606D1A2355931F00185962 /* GRDB.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = GRDB.framework;
|
||||
remoteRef = 56606D192355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
56606D1C2355931F00185962 /* GRDBtvOSTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = GRDBtvOSTests.xctest;
|
||||
remoteRef = 56606D1B2355931F00185962 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
56185BEE25B80B8900B9C30F /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
568E5FBD1E926430002582E0 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -499,6 +585,15 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
56185BEC25B80B8900B9C30F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
56185C0725B80CEC00B9C30F /* PlayerTests.swift in Sources */,
|
||||
56185BF325B80B8900B9C30F /* AppDatabaseTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
568E5FC71E926430002582E0 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -512,10 +607,12 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
56FE6F2624A90CE400711EDF /* SceneDelegate.swift in Sources */,
|
||||
56B0361C1E8D9F38003B6DA4 /* Player.swift in Sources */,
|
||||
56B0361B1E8D9F38003B6DA4 /* AppDatabase.swift in Sources */,
|
||||
56185BBF25B8036100B9C30F /* Persistence.swift in Sources */,
|
||||
56B036071E8D9EBE003B6DA4 /* AppDelegate.swift in Sources */,
|
||||
56B036241E8D9F4C003B6DA4 /* PlayersViewController.swift in Sources */,
|
||||
56B036241E8D9F4C003B6DA4 /* PlayerListViewController.swift in Sources */,
|
||||
56B036231E8D9F4C003B6DA4 /* PlayerEditionViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -523,6 +620,21 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
56185BF625B80B8900B9C30F /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 56B036021E8D9EBE003B6DA4 /* GRDBDemoiOS */;
|
||||
targetProxy = 56185BF525B80B8900B9C30F /* PBXContainerItemProxy */;
|
||||
};
|
||||
56606D1E2355937900185962 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBiOS;
|
||||
targetProxy = 56606D1D2355937900185962 /* PBXContainerItemProxy */;
|
||||
};
|
||||
56606D23235593A300185962 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBWatchOS;
|
||||
targetProxy = 56606D22235593A300185962 /* PBXContainerItemProxy */;
|
||||
};
|
||||
568E5FCE1E926430002582E0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 568E5FCA1E926430002582E0 /* GRDBDemoWatchOS Extension */;
|
||||
@@ -533,26 +645,6 @@
|
||||
target = 568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */;
|
||||
targetProxy = 568E5FD71E926430002582E0 /* PBXContainerItemProxy */;
|
||||
};
|
||||
568E5FE31E926535002582E0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBWatchOS;
|
||||
targetProxy = 568E5FE21E926535002582E0 /* PBXContainerItemProxy */;
|
||||
};
|
||||
568E5FE71E926547002582E0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBWatchOS;
|
||||
targetProxy = 568E5FE61E926547002582E0 /* PBXContainerItemProxy */;
|
||||
};
|
||||
56B0365D1E8D9F8F003B6DA4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBiOS;
|
||||
targetProxy = 56B0365C1E8D9F8F003B6DA4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
56B036611E8D9FB1003B6DA4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = GRDBiOS;
|
||||
targetProxy = 56B036601E8D9FB1003B6DA4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
@@ -583,6 +675,51 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
56185BF725B80B8900B9C30F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
56185BF825B80B8900B9C30F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
568E5FDB1E926430002582E0 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -591,12 +728,11 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
INFOPLIST_FILE = "GRDBDemoWatchOS Extension/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2.watchkitapp.watchkitextension;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS.watchkitapp.watchkitextension;
|
||||
PRODUCT_NAME = "${TARGET_NAME}";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 3.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -608,12 +744,11 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
INFOPLIST_FILE = "GRDBDemoWatchOS Extension/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2.watchkitapp.watchkitextension;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS.watchkitapp.watchkitextension;
|
||||
PRODUCT_NAME = "${TARGET_NAME}";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 3.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -626,12 +761,11 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
IBSC_MODULE = GRDBDemoWatchOS_Extension;
|
||||
INFOPLIST_FILE = GRDBDemoWatchOS/Info.plist;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2.watchkitapp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS.watchkitapp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 3.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -644,12 +778,11 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
IBSC_MODULE = GRDBDemoWatchOS_Extension;
|
||||
INFOPLIST_FILE = GRDBDemoWatchOS/Info.plist;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2.watchkitapp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS.watchkitapp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = watchos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = 4;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 3.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -679,6 +812,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -703,12 +837,14 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 2.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -738,6 +874,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -756,11 +893,13 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
WATCHOS_DEPLOYMENT_TARGET = 2.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -773,7 +912,7 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -787,7 +926,7 @@
|
||||
DEVELOPMENT_TEAM = AMD8W895CT;
|
||||
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
@@ -795,6 +934,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
56185BFF25B80B8900B9C30F /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
56185BF725B80B8900B9C30F /* Debug */,
|
||||
56185BF825B80B8900B9C30F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
568E5FDA1E926430002582E0 /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS Extension" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1030"
|
||||
LastUpgradeVersion = "1200"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -56,18 +56,17 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "56185BEF25B80B8900B9C30F"
|
||||
BuildableName = "GRDBDemoiOSTests.xctest"
|
||||
BlueprintName = "GRDBDemoiOSTests"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
BuildableName = "GRDBDemoWatchOS.app"
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -79,10 +78,8 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<RemoteRunnable
|
||||
runnableDebuggingMode = "2"
|
||||
BundleIdentifier = "com.apple.carousel"
|
||||
RemotePath = "/GRDBDemoiOS">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
@@ -90,18 +87,7 @@
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</RemoteRunnable>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
BuildableName = "GRDBDemoWatchOS.app"
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
@@ -109,10 +95,8 @@
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<RemoteRunnable
|
||||
runnableDebuggingMode = "2"
|
||||
BundleIdentifier = "com.apple.carousel"
|
||||
RemotePath = "/GRDBDemoiOS">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
@@ -120,16 +104,7 @@
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</RemoteRunnable>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
BuildableName = "GRDBDemoWatchOS.app"
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1030"
|
||||
LastUpgradeVersion = "1230"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -28,21 +28,20 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "56185BEF25B80B8900B9C30F"
|
||||
BuildableName = "GRDBDemoiOSTests.xctest"
|
||||
BlueprintName = "GRDBDemoiOSTests"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "56B036021E8D9EBE003B6DA4"
|
||||
BuildableName = "GRDBDemoiOS.app"
|
||||
BlueprintName = "GRDBDemoiOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
@@ -61,8 +60,6 @@
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
@@ -0,0 +1,154 @@
|
||||
import GRDB
|
||||
|
||||
/// AppDatabase lets the application access the database.
|
||||
///
|
||||
/// It applies the pratices recommended at
|
||||
/// https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
|
||||
final class AppDatabase {
|
||||
/// Creates an `AppDatabase`, and make sure the database schema is ready.
|
||||
init(_ dbWriter: DatabaseWriter) throws {
|
||||
self.dbWriter = dbWriter
|
||||
try migrator.migrate(dbWriter)
|
||||
}
|
||||
|
||||
/// Provides access to the database.
|
||||
///
|
||||
/// Application can use a `DatabasePool`, and tests can use a fast
|
||||
/// in-memory `DatabaseQueue`.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
private let dbWriter: DatabaseWriter
|
||||
|
||||
/// The DatabaseMigrator that defines the database schema.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md
|
||||
private var migrator: DatabaseMigrator {
|
||||
var migrator = DatabaseMigrator()
|
||||
|
||||
#if DEBUG
|
||||
// Speed up development by nuking the database when migrations change
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md#the-erasedatabaseonschemachange-option
|
||||
migrator.eraseDatabaseOnSchemaChange = true
|
||||
#endif
|
||||
|
||||
migrator.registerMigration("createPlayer") { db in
|
||||
// Create a table
|
||||
// See https://github.com/groue/GRDB.swift#create-tables
|
||||
try db.create(table: "player") { t in
|
||||
t.autoIncrementedPrimaryKey("id")
|
||||
t.column("name", .text).notNull()
|
||||
t.column("score", .integer).notNull()
|
||||
}
|
||||
}
|
||||
|
||||
// Migrations for future application versions will be inserted here:
|
||||
// migrator.registerMigration(...) { db in
|
||||
// ...
|
||||
// }
|
||||
|
||||
return migrator
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Database Access: Writes
|
||||
|
||||
extension AppDatabase {
|
||||
/// Saves (inserts or updates) a player. When the method returns, the
|
||||
/// player is present in the database, and its id is not nil.
|
||||
func savePlayer(_ player: inout Player) throws {
|
||||
try dbWriter.write { db in
|
||||
try player.save(db)
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the specified players
|
||||
func deletePlayers(ids: [Int64]) throws {
|
||||
try dbWriter.write { db in
|
||||
_ = try Player.deleteAll(db, keys: ids)
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete all players
|
||||
func deleteAllPlayers() throws {
|
||||
try dbWriter.write { db in
|
||||
_ = try Player.deleteAll(db)
|
||||
}
|
||||
}
|
||||
|
||||
/// Refresh all players (by performing some random changes, for demo purpose).
|
||||
func refreshPlayers() throws {
|
||||
try dbWriter.write { db in
|
||||
if try Player.fetchCount(db) == 0 {
|
||||
// When database is empty, insert new random players
|
||||
try createRandomPlayers(db)
|
||||
} else {
|
||||
// Insert a player
|
||||
if Bool.random() {
|
||||
var player = Player.newRandom()
|
||||
try player.insert(db)
|
||||
}
|
||||
|
||||
// Delete a random player
|
||||
if Bool.random() {
|
||||
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
|
||||
}
|
||||
|
||||
// Update some players
|
||||
for var player in try Player.fetchAll(db) where Bool.random() {
|
||||
try player.updateChanges(db) {
|
||||
$0.score = Player.randomScore()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Create random players if the database is empty.
|
||||
func createRandomPlayersIfEmpty() throws {
|
||||
try dbWriter.write { db in
|
||||
if try Player.fetchCount(db) == 0 {
|
||||
try createRandomPlayers(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
|
||||
private func createRandomPlayers(_ db: Database) throws {
|
||||
for _ in 0..<8 {
|
||||
var player = Player.newRandom()
|
||||
try player.insert(db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Database Access: Reads
|
||||
|
||||
extension AppDatabase {
|
||||
/// Tracks changes in players ordered by name
|
||||
func observePlayersOrderedByName(
|
||||
onError: @escaping (Error) -> Void,
|
||||
onChange: @escaping ([Player]) -> Void)
|
||||
-> DatabaseCancellable
|
||||
{
|
||||
ValueObservation
|
||||
.tracking(Player.all().orderedByName().fetchAll)
|
||||
.start(
|
||||
in: dbWriter,
|
||||
onError: onError,
|
||||
onChange: onChange)
|
||||
}
|
||||
|
||||
/// Tracks changes in players ordered by score
|
||||
func observePlayersOrderedByScore(
|
||||
onError: @escaping (Error) -> Void,
|
||||
onChange: @escaping ([Player]) -> Void)
|
||||
-> DatabaseCancellable
|
||||
{
|
||||
ValueObservation
|
||||
.tracking(Player.all().orderedByScore().fetchAll)
|
||||
.start(
|
||||
in: dbWriter,
|
||||
onError: onError,
|
||||
onChange: onChange)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
<key>UISceneStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,43 @@
|
||||
import GRDB
|
||||
|
||||
extension AppDatabase {
|
||||
/// The database for the application
|
||||
static let shared = makeShared()
|
||||
|
||||
private static func makeShared() -> AppDatabase {
|
||||
do {
|
||||
// Create a folder for storing the SQLite database, as well as
|
||||
// the various temporary files created during normal database
|
||||
// operations (https://sqlite.org/tempfiles.html).
|
||||
let fileManager = FileManager()
|
||||
let folderURL = try fileManager
|
||||
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
||||
.appendingPathComponent("database", isDirectory: true)
|
||||
try fileManager.createDirectory(at: folderURL, withIntermediateDirectories: true)
|
||||
|
||||
// Connect to a database on disk
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
|
||||
let dbURL = folderURL.appendingPathComponent("db.sqlite")
|
||||
let dbPool = try DatabasePool(path: dbURL.path)
|
||||
|
||||
// Create the AppDatabase
|
||||
let appDatabase = try AppDatabase(dbPool)
|
||||
|
||||
// Populate the database if it is empty, for better demo purpose.
|
||||
try appDatabase.createRandomPlayersIfEmpty()
|
||||
|
||||
return appDatabase
|
||||
} catch {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate.
|
||||
//
|
||||
// Typical reasons for an error here include:
|
||||
// * The parent directory cannot be created, or disallows writing.
|
||||
// * The database is not accessible, due to permissions or data protection when the device is locked.
|
||||
// * The device is out of space.
|
||||
// * The database could not be migrated to its latest schema version.
|
||||
// Check the error message to determine what the actual problem was.
|
||||
fatalError("Unresolved error \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import GRDB
|
||||
|
||||
/// The Player struct.
|
||||
///
|
||||
/// Hashable conformance supports table view updates
|
||||
struct Player: Hashable {
|
||||
/// The player id.
|
||||
///
|
||||
/// Int64 is the recommended type for auto-incremented database ids.
|
||||
/// Use nil for players that are not inserted yet in the database.
|
||||
var id: Int64?
|
||||
var name: String
|
||||
var score: Int
|
||||
}
|
||||
|
||||
extension Player {
|
||||
private static let names = [
|
||||
"Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David",
|
||||
"Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette",
|
||||
"Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl",
|
||||
"Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole",
|
||||
"Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul",
|
||||
"Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain",
|
||||
"Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann",
|
||||
"Zazie", "Zoé"]
|
||||
|
||||
/// Creates a new player with empty name and zero score
|
||||
static func new() -> Player {
|
||||
Player(id: nil, name: "", score: 0)
|
||||
}
|
||||
|
||||
/// Creates a new player with random name and random score
|
||||
static func newRandom() -> Player {
|
||||
Player(id: nil, name: randomName(), score: randomScore())
|
||||
}
|
||||
|
||||
/// Returns a random name
|
||||
static func randomName() -> String {
|
||||
names.randomElement()!
|
||||
}
|
||||
|
||||
/// Returns a random score
|
||||
static func randomScore() -> Int {
|
||||
10 * Int.random(in: 0...100)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Persistence
|
||||
|
||||
/// Make Player a Codable Record.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#records
|
||||
extension Player: Codable, FetchableRecord, MutablePersistableRecord {
|
||||
// Define database columns from CodingKeys
|
||||
fileprivate enum Columns {
|
||||
static let name = Column(CodingKeys.name)
|
||||
static let score = Column(CodingKeys.score)
|
||||
}
|
||||
|
||||
/// Updates a player id after it has been inserted in the database.
|
||||
mutating func didInsert(with rowID: Int64, for column: String?) {
|
||||
id = rowID
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Player Database Requests
|
||||
|
||||
/// Define some player requests used by the application.
|
||||
///
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#requests
|
||||
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
|
||||
extension DerivableRequest where RowDecoder == Player {
|
||||
/// A request of players ordered by name.
|
||||
///
|
||||
/// For example:
|
||||
///
|
||||
/// let players: [Player] = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByName().fetchAll(db)
|
||||
/// }
|
||||
func orderedByName() -> Self {
|
||||
// Sort by name in a localized case insensitive fashion
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
|
||||
order(Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
|
||||
}
|
||||
|
||||
/// A request of players ordered by score.
|
||||
///
|
||||
/// For example:
|
||||
///
|
||||
/// let players: [Player] = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByScore().fetchAll(db)
|
||||
/// }
|
||||
/// let bestPlayer: Player? = try dbWriter.read { db in
|
||||
/// try Player.all().orderedByScore().fetchOne(db)
|
||||
/// }
|
||||
func orderedByScore() -> Self {
|
||||
// Sort by descending score, and then by name, in a
|
||||
// localized case insensitive fashion
|
||||
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
|
||||
order(
|
||||
Player.Columns.score.desc,
|
||||
Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_20pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_20pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_29pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_29pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_40pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_40pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_60pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon_60pt@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_20pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_20pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_29pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_29pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_40pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_40pt@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_76pt.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_76pt@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon_83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 329 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 6.9 KiB |