rustweb 0.6.1

Rust-based web server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
�cL�4����1���86�d2FTIZY!"#$%&'()����9$s&�(%Lqsys|�	ts�1
R !6#Q'l)"Lpsys�'
r�u� GFEDCBAK/favicon.icoimage/x-icon>��^
yxwZ�@0�.�	7/�@D�'�z3George Barwood�F�]�,Kw~�smtp.ma*�geebee2+�rxzjfer,smtp.gmail.com�george.-�dgpfqyd.
�+email.Retry������[���EXEC (%y���EXEC �z���EXEC ^)'{���EXEC �>�/favicon.ico�/Uploado^v�
|{z�ONMLKJIH�onmlkjih�WVUTSRQP���������q1+,->����������������LE dbo.Cust( La
���_^]\[ZYX��������gfedcba`(/)/*/+/,/-/./����������������� /!/"/#/$/%/&////////////////	/
///
/////////�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.x.y.z.{.|.}.~.p.q.r.s.t.u.v.A/B/C/D/E/F/G/H/I/J/K/L/k/l/m/n/o/p/q/r/s/t/u/v/w/h.i.j.k.l.m.n.`.a.b.c.d.e.f.X.Y.Z.[.\.].^.P.Q.R.S.T.U.V.H.I.J.K.L.M.N.@.A.B.C.D.E.F.8.9.:.;.<.=.>.0.1.2.3.4.5.6.(.).*.+.,.-... .!.".#.$.%.&................	.
...
.........�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�/�/�/�/�/�/�/�/�/�/�/�/�/�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-0/1/2/3/4/5/6/7/�-�-�-�-�-�-�-x-y-z-{-|-}-~-p-q-r-s-t-u-v-h-i-j-k-l-m-n-`-a-b-c-d-e-f-X-Y-Z-[-\-]-^-P-Q-R-S-T-U-V-H-I-J-K-L-M-N-@-A-B-C-D-E-F-8-9-:-;-<-=->-0-1-2-3-4-5-6-(-)-*-+-,---.- -!-"-#-$-%-&----------------	-
---
---------�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,x,y,z,{,|,},~,p,q,r,s,t,u,v,h,i,j,k,l,m,n,`,a,b,c,d,e,f,�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/X,Y,Z,[,\,],^,P,Q,R,S,T,U,V,H,I,J,K,L,M,N,@,A,B,C,D,E,F,8,9,:,;,<,=,>,0,1,2,3,4,5,6,(,),*,+,,,-,.,V/W/X/Y/Z/[/\/]/^/_/`/a/ ,!,",#,$,%,&,,,,,,,,,,,,,,,,	,
,,,
,,,,,,,,,�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+x+y+z+{+|+}+~+p+q+r+s+t+u+v+h+i+j+k+l+m+n+`+a+b+c+d+e+f+X+Y+Z+[+\+]+^+P+Q+R+S+T+U+V+H+I+J+K+L+M+N+@+A+B+C+D+E+F+8+9+:+;+<+=+>+0+1+2+3+4+5+6+(+)+*+++,+-+.+ +!+"+#+$+%+&++++++++++++++++	+
+++
+++++++++�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�2�2�2�2�2�2�2�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*x*y*z*{*|*}*~*p*q*r*s*t*u*v*h*i*j*k*l*m*n*`*a*b*c*d*e*f*X*Y*Z*[*\*]*^*P*Q*R*S*T*U*V*H*I*J*K*L*M*N*@*A*B*C*D*E*F*8*9*:*;*<*=*>*0*1*2*3*4*5*6*(*)***+*,*-*.* *!*"*#*$*%*&****************	*
***
*********�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)x)y)z){)|)})~)p)q)r)s)t)u)v)h)i)j)k)l)m)n)�2�2�2�2�2�2�2�2�2�2�2�2�2�2`)a)b)c)d)e)f)X)Y)Z)[)\)])^)P)Q)R)S)T)U)V)H)I)J)K)L)M)N)@)A)B)C)D)E)F)8)9):);)<)=)>)0)1)2)3)4)5)6)()))*)+),)-).) )!)")#)$)%)&))))))))))))))))	)
)))
)))))))))�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(x(y(z({(|(}(~(p(q(r(s(t(u(v(h(i(j(k(l(m(n(`(a(b(c(d(e(f(X(Y(Z([(\(](^(P(Q(R(S(T(U(V(H(I(J(K(L(M(N(@(A(B(C(D(E(F(8(9(:(;(<(=(>(0(1(2(3(4(5(6((()(*(+(,(-(.( (!("(#($(%(&((((((((((((((((	(
(((
((�2�2�2�2�2�2�2(((((((�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'x'y'z'{'|'}'~'p'q'r's't'u'v'h'i'j'k'l'm'n'`'a'b'c'd'e'f'X'Y'Z'['\']'^'P'Q'R'S'T'U'V'H'I'J'K'L'M'N'@'A'B'C'D'E'F'8'9':';'<'='>'0'1'2'3'4'5'6'(')'*'+','-'.' '!'"'#'$'%'&''''''''''''''''	'
'''
'''''''''�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2{2|2}2~22�2�2�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&s2t2u2v2w2x2y2k2l2m2n2o2p2q2�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&x&y&z&{&|&}&~&p&q&r&s&t&u&v&h&i&j&k&l&m&n&`&a&b&c&d&e&f&X&Y&Z&[&\&]&^&P&Q&R&S&T&U&V&H&I&J&K&L&M&N&@&A&B&C&D&E&F&8&9&:&;&<&=&>&0&1&2&3&4&5&6&(&)&*&+&,&-&.& &!&"&#&$&%&&&&&&&&&&&&&&&&&&	&
&&&
&&&&&&&&&�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%x%y%z%{%|%}%~%p%q%r%s%t%u%v%h%i%j%k%l%m%n%`%a%b%c%d%e%f%X%Y%Z%[%\%]%^%P%Q%R%S%T%U%V%H%I%J%K%L%M%N%c2d2e2f2g2h2i2@%A%B%C%D%E%F%8%9%:%;%<%=%>%0%1%2%3%4%5%6%(%)%*%+%,%-%.% %!%"%#%$%%%&%%%%%%%%%%%%%%%%	%
%%%
%%%%%%%%%�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$x$y$z${$|$}$~$p$q$r$s$t$u$v$h$i$j$k$l$m$n$`$a$b$c$d$e$f$X$Y$Z$[$\$]$^$P$Q$R$S$T$U$V$H$I$J$K$L$M$N$@$A$B$C$D$E$F$8$9$:$;$<$=$>$0$1$2$3$4$5$6$($)$*$+$,$-$.$ $!$"$#$$$%$&$[2\2]2^2_2`2a2S2T2U2V2W2X2Y2K2L2M2N2O2P2Q2C2D2E2F2G2H2I2$$$$$$$$$$$$$$$	$
$$$
$$$$$$$$$�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#;2<2=2>2?2@2A2�#�#�#�#�#�#�#32425262728292�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#x#y#z#{#|#}#~#p#q#r#s#t#u#v#h#i#j#k#l#m#n#`#a#b#c#d#e#f#X#Y#Z#[#\#]#^#P#Q#R#S#T#U#V#H#I#J#K#L#M#N#@#A#B#C#D#E#F#8#9#:#;#<#=#>#0#1#2#3#4#5#6#(#)#*#+#,#-#.# #!#"###$#%#&################	#
###
#########�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"+2,2-2.2/20212�"�"�"�"�"�"�"x"y"z"{"|"}"~"p"q"r"s"t"u"v"h"i"j"k"l"m"n"`"a"b"c"d"e"f"X"Y"Z"["\"]"^"P"Q"R"S"T"U"V"H"I"J"K"L"M"N"@"A"B"C"D"E"F"8"9":";"<"=">"0"1"2"3"4"5"6"(")"*"+","-"." "!"""#"$"%"&""""""""""""""""	"
"""
"""""""""�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!x!y!z!{!|!}!~!p!q!r!s!t!u!v!h!i!j!k!l!m!n!`!a!b!c!d!e!f!#2$2%2&2'2(2)222222 2!2222222222
22222X!Y!Z![!\!]!^!P!Q!R!S!T!U!V!H!I!J!K!L!M!N!@!A!B!C!D!E!F!8!9!:!;!<!=!>!0!1!2!3!4!5!6!(!)!*!+!,!-!.!222222	2 !!!"!#!$!%!&!�1�1�1�1�122!!!!!!!!!!!!!!!	!
!!!
!!!!!!!!!� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � x y z { | } ~ p q r s t u v h i j k l m n ` a b c d e f X Y Z [ \ ] ^ P Q R S T U V H I J K L M N @ A B C D E F 8 9 : ; < = > 0 1 2 3 4 5 6 ( ) * + , - .   ! " # $ % &                	 
   
         ��������������������������������������������������1�1�1�1�1�1�1���������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

�������������������������������������������������������������������������������������1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1��������1�1�1�1�1�1�1���������������������xyz{|}~pqrstuvhijklmn�1�1�1�1�1�1�1`abcdef�1�1�1�1�1�1�1XYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

�1�1�1�1�1�1�1����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

�����������������������������1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1��������1�1�1�1�1�1�1��������������������������������������������������1�1�1�1�1�1�1�1�1�1�1�1�1�1����������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF�1�1�1�1�1�1�189:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&{1|1}1~11�1�1s1t1u1v1w1x1y1k1l1m1n1o1p1q1c1d1e1f1g1h1i1	

����������������������������[1\1]1^1_1`1a1S1T1U1V1W1X1Y1������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������K1L1M1N1O1P1Q1xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefC1D1E1F1G1H1I1;1<1=1>1?1@1A1XYZ[\]^31415161718191+1,1-1.1/10111PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&#1$1%1&1'1(1)111111 1!1	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

��������������������������������������������������������1111111��������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

������������������������������������������������������������������������������������11
11111�������111111	1�0�0�0�0�011�0�0�0�0�0�0�0���������������������xyz{|}~pqrstuvhijklmn`abcdef�0�0�0�0�0�0�0�0�0�0�0�0�0�0XYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUVHIJKLMN@ABCDEF89:;<=>0123456()*+,-. !"#$%&	

�0�0�0�0�0�0�0����������������������������������������������������������������������������������������������������������������xyz{|}~pqrstuvhijklmn`abcdefXYZ[\]^PQRSTUV������~}0�������@ABCDEF+�������9:;<=>1�������1234562�������)*+,-.3�������!"#$%&4�������5�������6�������	

7�������8�������������9�������������:�������������;�������������<�������������=��������������0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0>�������������C�������������D�������������E�������������F�������������G�������������H��������������0�0�0�0�0�0�0�0�0�0�0�0�0�0I�������������L�������������M�������������N�������yz{|}~O�������qrstuvP�������ijklmnQ�������abcdefR�������YZ[\]^S�������QRSTUVT�������IJKLMNU�������ABCDEFV�������9:;<=>W�������123456X�������)*+,-.Y�������!"#$%&Z�������[�������\�������	

]�������^�������������_�������������`�������������a�������������b�������������c�������������d�������������e�������������f�������������g�������������h�������������i�������������j�������������k�������������l�������������m�������������n�������yz{|}~o�������qrstuvp�������ijklmnq�������abcdefr�������YZ[\]^s�������QRSTUVt�������IJKLMNu�������ABCDEFv�������9:;<=>�0�0�0�0�0�0�0w�������123456y�������)*+,-.z�������!"#$%&{�������|�������}�������	

~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456��������)*+,-.��������!"#$%&�����������������0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0��������	

�����������������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
{0|0}0~00�0�0���������
�
�
�
�
�
s0t0u0v0w0x0y0���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
���������
�
�
�
�
�
��������y
z
{
|
}
~
��������q
r
s
t
u
v
��������i
j
k
l
m
n
��������a
b
c
d
e
f
��������Y
Z
[
\
]
^
��������Q
R
S
T
U
V
��������I
J
K
L
M
N
��������A
B
C
D
E
F
��������9
:
;
<
=
>
��������1
2
3
4
5
6
��������)
*
+
,
-
.
��������!
"
#
$
%
&
��������





��������





��������	







��������





����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yz{|}~k0l0m0n0o0p0q0��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456��������)*+,-.��������!"#$%&������������������������	

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUVc0d0e0f0g0h0i0[0\0]0^0_0`0a0S0T0U0V0W0X0Y0K0L0M0N0O0P0Q0��������IJKLMN�������ABCDEF�������9:;<=>�������123456�������)*+,-.�������!"#$%&�������C0D0E0F0G0H0I0�������;0<0=0>0?0@0A0	�������	

���������������
�
�
�
�
�

��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
��������
�
�
�
�
�
�������y
z
{
|
}
~
�������q
r
s
t
u
v
�������i
j
k
l
m
n
�������a
b
c
d
e
f
 �������Y
Z
[
\
]
^
!�������Q
R
S
T
U
V
"�������I
J
K
L
M
N
#�������A
B
C
D
E
F
$�������9
:
;
<
=
>
%�������1
2
3
4
5
6
&�������)
*
+
,
-
.
'�������!
"
#
$
%
&
(�������





)�������





*�������	






+�������





,��������	�	�	�	�	�	-��������	�	�	�	�	�	.��������	�	�	�	�	�	/��������	�	�	�	�	�	0��������	�	�	�	�	�	1��������	�	�	�	�	�	2��������	�	�	�	�	�	3��������	�	�	�	�	�	4��������	�	�	�	�	�	304050607080905��������	�	�	�	�	�	7��������	�	�	�	�	�	8��������	�	�	�	�	�	9��������	�	�	�	�	�	:��������	�	�	�	�	�	;��������	�	�	�	�	�	<��������	�	�	�	�	�	=�������y	z	{	|	}	~	>�������q	r	s	t	u	v	?�������i	j	k	l	m	n	@�������a	b	c	d	e	f	A�������Y	Z	[	\	]	^	B�������Q	R	S	T	U	V	C�������I	J	K	L	M	N	D�������A	B	C	D	E	F	E�������9	:	;	<	=	>	F�������1	2	3	4	5	6	G�������)	*	+	,	-	.	H�������!	"	#	$	%	&	I�������						J�������						K�������		
			
		L�������						M�������������N�������������O�������������P�������������Q�������������R�������������S�������������T�������������U�������������V�������������W�������������X�������������Y�������������Z�������������+0,0-0.0/00010#0$0%0&0'0(0)000000 0!00000000[�������������`�������������a�������yz{|}~b�������qrstuvc�������ijklmnd�������abcdefe�������YZ[\]^00
00000f�������QRSTUV000000	0h�������IJKLMNj�������ABCDEFk�������9:;<=>l�������123456m�������)*+,-.n�������!"#$%&o�������p�������q�������	

r�������s�������������t�������������u�������������v�������������w�������������x�������������y�������������z�������������{�������������|�������������}�������������~����������������������������������������������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456��������)*+,-.��������!"#$%&������������������������	

�����������������������/�/�/�/�/00��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456��������)*+,-.��������!"#$%&������������������������	

���������������������������������������������������������������������������������������������/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/���������������/�/�/�/�/�/�/���������������������������������������������������������������������������������������������������/�/�/�/�/�/�/�/�/�/�/�/�/�/������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456��������)*+,-.��������!"#$%&������������������������	

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yz{|}~��������qrstuv��������ijklmn��������abcdef��������YZ[\]^��������QRSTUV��������IJKLMN��������ABCDEF��������9:;<=>��������123456�/�/�/�/�/�/�/��������)*+,-.��������!"#$%&������������������������	

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�������������
��������������������yz{|}~�������qrstuv
�������ijklmn�������abcdef�������YZ[\]^�������QRSTUV�������IJKLMN�������ABCDEF�������9:;<=>�������123456�������)*+,-.�������!"#$%&���������������/�/�/�/�/�/�/�/�/�/�/�/�/�/�������	

�/�/�/�/�/�/�/y/z/{/|/}/~//�������������������� �������������!�������������"�������������#�������������$�������������c/d/e/f/g/h/i/N/O/P/Q/R/S/T/%�������������(�������������)�������������*�������������+�������������,�������������-�������������.�������������/�������������0�������������1�������yz{|}~2�������qrstuv3�������ijklmn4�������abcdef5�������YZ[\]^���������6�������@ABCDE8�������89:;<=9�������012345:�������()*+,-;������� !"#$%<�������=�������>�������	

?�������@�������������A�������������B�������������C�������������D�������������E�������������F�������������G�������������H�������������I�������������J�������������K��������������������������������������������������
��������������������������������9/:/;/</=/>/?/�������J��ser.
     In addition, the salt string in login.Hash shou���������h" !"#$%��&'()����t
END��*?���������C3D3E3F3G3H3:3;3<3=3>3?3@323334353637383�+3,3-3.3/303�543210/.�=<;:9876%CREATE FN schema.name ( param1 type1, param2 type2... ) AS BEGIN statements END
<p>A stored function ( no retu"�rior batch before being used. A GO statement may be used to signify the start of a new batch.
<h2>Stored Functions</h2>
<h3>C!�result ( which should be a list of SQL statements ).
<p>Note that database objects ( tables, function ) must be created in a p0 �rminated.
<h2>Batch execution</h2><p>EXECUTE ( string-expression )
<p>Evaluates the string expression, and then executes the �label consists of a name followed by a colon (:)
<h3>BREAK</h3><p>BREAK
<p>Execution of the enclosing FOR or WHILE loop is te!#�ool-exp evaluates to true. See also BREAK.
<h3>GOTO</h3><p>GOTO label
<p>Control is transferred to the labelled statement. A �ent2 ( if specified ) is executed.
<h3>WHILE</h3><p>WHILE bool-exp Statement
<p>Statement is repeatedly executed as long as b"&�
<p>IF bool-exp THEN Statement1 [ ELSE Statement2 ]
<p>If% bool-exp evaluates to true Statement1 is executed, otherwise Statem�in order. A BEGIN..END compound statement can be used whenever a single statement is allowed.
<h3>IF .. THEN ... ELSE ...</h3>%'�
<h2>Control flow statements</h2>
<h3>BEGIN .. END</h3><p>BEGIN Statement1 Statement2 ... END
<p>The statements are executed �table which satisfies the WHERE condition, with the named local variables being assigned expressions which depend on the rows.
$,�.... FROM table [ WHERE bool-exp ] [ORDER BY expressions] Statement
<p>Statement is repeatedly executed for each row from the �n. If there is no such row, the values of the local variables remain unchanged.
<h3>FOR</h3><p>FOR name1 = exp1, name2 = exp2 )+�riables are assigned. If the FROM clause is specified, the values are taken from a table row which satisfies the WHERE conditio�ered if there is a loop ).
<h3>SET</h3>
<p>SET name1 = exp1, name2 = exp2 .... [ FROM table ] [ WHER%E bool-exp ]
<p>Local va*.�with the specified types. The variables are initialised to default values ( but only once, not each time the DECLARE is encount�tion and assignment statements</h2>
<h3>DECLARE</h3><p>DECLARE name1 type1, name2 type2 ....
<p>Local variables are declared -/�chema.tablename WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are removed.
<h2>Local variable declara� Exp2 .... WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are updated.
<h3>DELETE</h3><p>DELETE FROM s(4�client for further processing and eventual display. 
<h3>UPDATE</h3><p>UPDATE schema.tablename SET Colname1 = Exp1, Colname2 =� stand-alone statement, the results are passed to the code that invoked the batch, and may be displayed to a user or sent to a 13�ression, the order is reversed ( descending order ).
<p>The SELECT expressions can be given names using AS.
<p>When used as a
�d, bas%ed on the list of expressions and the WHERE and ORDER BY clauses.
<p>If the keyword DESC is placed after an ORDER BY exp28� ).
<h3>SELECT</h3><p>SELECT expressions FROM source-table [WHERE bool-exp ] [ORDER BY expressions]
<p>A new table is compute�ed values are inserted into the table. The values may be any expressions ( possibly involving local variables or function calls57
�
<p>INSERT INTO schema.tablename ( Colname1, Colname2 ... ) VALUES ( Val1, Val2... ) [,] ( Val3, Val4 ...) ...
<p>The specifi	�ed before using ALTER TABLE. They can be added again afterwards.
</ul>
<h2>Data manipulation statements</h2>
<h3>INSERT</h3>69�column is removed from the table.</li>
</ul>
<p>Note: currently, any indexes that have been added to a table need to be dropp:�en float and double, and modification of the number of bytes stored inline for binary and string.</li>
<li>DROP Colname : the A�PARSEINT( s string ) : parses an integer from s.<Z the days in a 400 year cycle ( 400 * 365 +�st |= CASE WHEN  list = '' THEN col ELSE ',' | col END
  RETURN '(' | list | ')'
ENDACETE FROM sys.Table WHERE Id = t
ENDble WHERE Id = t
  DELETE FROM sys.Column WHERE Table = t
  DELE�er data */
  DELETE FROM browse.Table WHERE Id = t
  DELETE FROM sys.Column WHERE Table = t
  DELEBH�s.Column WHERE Table = t
  BEGIN
    DELETE FROM browse.Column WHERE Id = id
  END
  /* Delete oth� END
  DELETE FROM sys.Index WHERE Table = t
   /* Delete the column data */
  FOR id = Id FROM syEG� id = Id FROM sys.Index WHERE Table = t
  BEGIN
    DELETE FROM sys.IndexColumn WHERE Index = id
 �sid EXECUTE( 'DROP TABLE ' | sys.Dot(schema,name) )
  DELETE FROM sys.Schema WHERE Id = sid
END = FI� sid EXECUTE( 'DROP FN ' | sys.Dot(schema,name) )
  FOR name = Name FROM sys.Table WHERE Schema = J�sys.Column WHERE Table = table
    SET result |= '|'',''|' | col
  RETURN resul[ �t}�    ext.trans_wait = true;
        }
        ee.tr.set_extension(ext);
        0
    }
}

/*
/// Compile call to BINPACK.
fn c_|� -> i64 {
        let mut ext = ee.tr.get_extension();
        if let Some(mut ext) = ext.downcast_mut::<TransExt>() {
        {�/ Compiled call to TRANSWAIT
struct TransWait {}
impl CExp<i64> for TransWait {
    fn eval(&self, ee: &mut EvalEnv, _d: &[u8])z�fn c_trans_wait(b: &Block, args: &mut [Expr]) -> CExpPtr<i64> {
    check_types(b, args, &[]);
    Box::new(TransWait {})
}

//y�            ext.tx_email = true;
        }
        ee.tr.set_extension(ext);
        0
    }
}

/// Compile call to TRANSWAIT.
x�: &[u8]) -> i64 {
        let mut ext = ee.tr.get_extension();
        if let Some(mut ext) = ext.downcast_mut::<TransExt>() {
w�ilTx {})
}

/// Compiled call to EMAILTX
struct EmailTx {}
impl CExp<i64> for EmailTx {
    fn eval(&self, ee: &mut EvalEnv, _dv� call to EMAILTX.
fn c_emaXtes = c_value(b, &mut args[0]);
    Box::new(Binunpack { bytes })
}

/// Compiled call to BINUNPACK.
struct Binunpack {
 28��BINUNPACK.
fn c_binunpack(b: &Block, args: &mut [Expr]) -> CExpPtr<Value> {
    check_types(b, args, &[DataKind::Binary]);
    ��&data);
            Value::RcBinary(Rc::new(cb))
        } else {
            panic!();
        }
    }
}

/// Compile call to 57��a) = self.bytes.eval(ee, d) {
            let mut comp = flate3::Compressor::new();
            let cb: Vec<u8> = comp.deflate(��,
}
impl CExp<Value> for Binpack {
    fn eval(&self, ee: &mut EvalEnv, d: &[u8]) -> Value {
        if let Value::RcBinary(dat69�e(b, &mut args[0]);
    Box::new(Binpack { bytes })
}

/// Compiled call to BINPACK.
struct Binpack {
    bytes: CExpPtr<Value>:~�binpack(b: &Block, args: &mut [Expr]) -> CExpPtr<Value> {
    check_types(b, args, &[DataKind::Binary]);
    let bytes = c_valuX

   /// Trace query time*.�� /// Login cookies for replication
   #[clap(short, long, value_parser, default_value = "")]
   login: String,

   /// Memory l��0.0")]
   ip: String,

   /// Server to replicate
   #[clap(short, long, value_parser, default_value = "")]
   rep: String,

  -/��ser!(u16).range(1..))]
   port: u16,

   /// Ip Address to listen on
   #[clap(short, long, value_parser, default_value = "0.0.��lap(author, version, about, long_about = None)]
struct Args {
   /// Port to listen on
   #[clap(value_parser = clap::value_par(4��e::RcBinary(Rc::new(ucb))
        } else {
            panic!();
        }
    }
}
*/

use clap::Parser;

#[derive(Parser)]
#[c��if let Value::RcBinary(data) = self.bytes.eval(ee, d) {
            let ucb: Vec<u8> = flate3::inflate(&data);
            Valu13��   bytes: CExpPtr<Value>,
}
impl CExp<Value> for Binunpack {
    fn eval(&self, ee: &mut EvalEnv, d: &[u8]) -> Value {
        ��let byX
   DECLARE cu int SET cu = login.get(0) IF cu = 0 RETURN

   EXE��ame�Alex�LastName�Barwood�x�101��hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1��欹��+�FirstN%'��web.Main()�/EditRow��b1�/ShowTable?s=dbo&n=Cust�b2�/ShowRow?s=dbo&n=Cust&k=8�k�8�n�Cust�s�dbo��$submit�Save�Age�63�City��FirstN��elete��hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���1ȹk=21�k�21�n�File�s�web��$submit�D$,��web.Main()�/EditRow��b1�/ShowSchema?s=web�b2�/ShowTable?s=web&n=File�b3�/ShowRow?s=web&n=File&k=21�k�21�n�File�s�web��$submit�D��e_parser, default_value_t = false)]
   tracemem: bool,

}
��submit���Upload���/v�(Trace memory trimming
   #[clap(long, valu)+��
   #[clap(long, value_parser, default_value_t = false)]
   tracetime: bool,

   /// Trace memory trimming
   #[clap(long, valu��imit for page cache (in MB)
   #[clap(short, long, value_parser, default_value_t = 10)]
   mem: usize,Xt>Exact</a>
<p><a href=/CheckAll>Check all functions compile ok</a> 

<h3>Schemas</h3>'
   SELECT '<a href=��riptAll?mode=1>Script entire database</a> 
  | <a target=_blank href=/ScriptAll?mode=2>Filtered</a>    
  | <a target=_blank ��ef=/ListLogins>Logins</a>
<p><a href=/ListFile>Files</a>
<p><a href=/FileUpload>File Upload</a>
<p><a target=_blank href=/Sc0��ary</a>
<p><a target=_blank href="/">Public Site Home Page</a>
<h3>System</h3>
<p><a href=/Execute>Execute SQL</a>
<p><a hr��_fastest_web_frameworks_are_written/

<p><a href="/ShowTable?s=dbo&n=Cust">Customers</a> | <a href="/OrderSummary">Order Summ!#�� displaying record. Suppress editing of some fields. File editing. https://www.reddit.com/r/rust/comments/wooiwi/3_of_the_top_5��C web.Head('System Menu')
   SELECT '
<p>Martin Dent project. Archive project. Port BMIB. Start a blog. Add extra fields when"&��web.Main()�/EditFunc��n�/Menu�s�handler��def�3() AS
BEGINXsword' )
    S�� IF pw != '' 
  BEGIN
    UPDATE login.user SET HashedPassword = login.hash(pw|k) WHERE Id = k
    EXEC web.Head( 'Password ��get(1) IF cu = 0 RETURN

  DECLARE k int SET k = PARSEINT( web.Query('k') )

  DECLARE pw string SET pw = web.Form('pw')
 ��web.Main()�/EditFunc��b1�/ShowSchema?s=handler�n�/SetPassword�s�handler��def�'() AS 
BEGIN 
  DECLARE cu int SET cu = login.��l��$submit�Save��hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���8�ɣmsg�n�Queue�p�3�s�emai��web.Main()�/AddChild��b1�/ShowSchema?s=email�b2�/ShowTable?s=email&n=Msg�b3�/ShowRow?s=email&n=Msg&k=3�f�msg�n�Queue�p�3�s�emai��39943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1������
 BY Name

   EXEC web.Trailer()
END��hpw�B0xceb28932f942��ShowSchema?s=' | Name | '>' | Name | '</a> | ' FROM sys.Schema ORDER BY Name

   EXEC web.Trailer()
END��hpw�B0xceb28932f942��href=/ScriptExacXord')
    SET result = Id FROM login.user WHERE Name = us��
     In addition, the salt string in login.Hash should be changed.
  */
  RETURN 1 -- Login disabled.

  IF username != ''��in is initially disabled. Remove or comment out the line below enable Login after Login password has been setup for some user.
��ed in user. Note: role is not yet checked */

  DECLARE username string SET username = web.Form('username')

  /*
     Log��web.Main()�/EditFunc��b1�/ShowSchema?s=login�n�get�s�login��def��( role int ) RETURNS int AS
BEGIN
  /* Get the current logg���B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���G��N>'
    EXEC web.Trailer()
  END
END��hpw��ELECT '<form method=post><p>Enter password: <input name=pw><input type=submit></form>'
    EXEC web.Trailer()
  END
END��hpw��Set')
    SELECT '<p>Password set'
    EXEC web.Trailer()
  END
  ELSE
  BEGIN
    EXEC web.Head( 'Set PasXue=Login></form>'
  EXEC web.Trailer()

  RETURN 0
END��hpw�B0xceb28932f94239943ca565f2ee11c9839b��eb.Head( 'Login' )
  SELECT '<form method=post>User Name <input name=username><br>Password <input type=password name=password>��ARE hpwt binary SET hpwt = HashedPassword FROM login.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXEC w	��RE hpwf string SET hpwf = web.Cookie('hpw')

  IF uids != ''
  BEGIN
    DECLARE uid int SET uid = PARSEINT(uids)
    DECL��okie( 'hpw', '' | hpw, '' )
      RETURN result
    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
  DECLA
��ND HashedPassword = hpw
    IF result > 0
    BEGIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCo��ername
    DECLARE hpw binary SET hpw = login.hash( password|result )
    SET result = Id FROM login.user WHERE Id = result A
��
  BEGIN
    DECLARE password string SET password = web.Form('passwX �t��sername
    DECLARE hpw binary SET hpw = login.hash( password|result )
    SET result = Id FROM login.user WHERE Id = result ��'
  BEGIN
    DECLARE password string SET password = web.Form('password')
    SET result = Id FROM login.user WHERE Name = u��
     In addition, the salt string in login.Hash should be changed.
  */
  RETURN 1 -- Login disabled.

  IF username != '��gin is initially disabled. Remove or comment out the line below enable Login after Login password has been setup for some user.��ged in user. Note: role is not yet checked */

  DECLARE username string SET username = web.Form('username')

  /*
     Lo��web.Main()�/EditFunc��b1�/ShowSchema?s=login�n�getx�s�login��def��( role int ) RETURNS int AS
BEGIN
  /* Get the current log�]27d320318f2cbdedb52fcdf95cfd93�uid�1���S�0� EXEC web.Trailer()

  RETURN 0
END��hpw�B0xceb28932f94239943ca565f2ee11c9839b��<br><input type=submit val&�,:�tring SET def = web.Form('def')
  IF def != '' 
  BEGIN
    EXECUTE( 'ALTER FN ' | sys.Dot(s,n) | def )
    SET ex = EXCEPTION(;�)
  END
  ELSE SET def = Def FROM sys.Function WHERE Schema = sid AND Name = n 
  EXEC web.Head( 'Edit ' | n )
  IF ex != '' SE=�howSchema?s=' | s | '>' | s | '</a> . ' | n 
     | CASE WHEN s = 'handler' THEN ' <a href=' | n | '>Go</a>' ELSE '' END
     |?�'
     | '<br><textarea name=sql rows=20 cols=100' | CASE WHEN sql='' THEN ' placeholder="Enter SQL here. See Manual for detai>� '<br><textarea name=def rows=40 cols=150>' | htm.Encode(def) | '</textarea>' 
     | '</form>' 
  EXEC web.Trailer()
END     |<�LECT '<p>Error: ' | htm.Encode( ex )
  SELECT 
     '<p><form method=post>'
     | '<input type=submit value="ALTER"> <a href=SA� ) -- Causes result tables to be displayed as HTML tables
    EXECUTE( sql ) 
    -- EXEC SETMODE( 0 )
    DECLARE ex stringC�LECT dbo.CustName(Id) AS N&ame, Age FROM dbo.Cust'
     | '<br>SELECT Cust, Total FROM dbo.Order'
     | '<br>SELECT EMAILTX()B� SET ex = EXCEPTION()
    IF ex != '' SELECT '<p>Error : ' | htm.Encode(ex)
  END
  SELECT '<p>Example SQL:'
     | '<br>SE@�ls."' ELSE '' END | '>' | htm.Encode(sql) | '</textarea>' 
     | '</form>' 
  IF sql != '' 
  BEGIN
    -- EXEC SETMODE( 1	E�stName string, Age int )'
     | '<br>CREATE FN handler.[/MyPage]() AS BEGIN END'
     | '<br>SELECT ''hash='' | ARGON( ''argG� rtest.OneTest()'
     | '<br>CREATE INDEX ByCust ON dbo.Order'
     | '<br>DROP INDEX ByCust ON dbo.Order'  
     | '<br>ALF�on2i!'', ''delicious salt'' )'
     | '<br>EXEC web.SetCookie(''username'',''fred'',''Max-Age=1000000000'')'
     | '<br>EXECI�code'
     | '<br>DROP TABLE dbo.Cust'
     | '<br>SELECT VERIFYDB()'
     | '<br>SELECT REPACKFILE(0,''dbo'',''Order'')'
 K�'' Len='' | BINLEN(data) FROM log.Transaction'

   EXEC web.Trailer&()
ENDERE true'
     | '<br>SELECT ''&lt;p>Id='' | Id | J�    | '<br>EXEC dbo.MakeOrders(50000)'
     | '<br>DELETE FROM dbo.Order WHERE true'
     | '<br>SELECT ''&lt;p>Id='' | Id | H�TER TABLE dbo.Cust MODIFY FirstName string(20), ADD [City] string, PostCode string'
     | '<br>ALTER TABLE dbo.Cust DROP Post
M�s/' | FILEATTR(0,2), FILEATTR(0,1), BINLEN(content), content )
  END
  SELECT '<form method=post enctype="multipart/form-data">O�ntLength | ' id=' | Id | ' <a href="/EditFile?k=' | Id | '">Edit Path</a>'
  FROM web.File
  EXEC web.Trailer()
ENDN�<p><Input name=file type=file><p><input name=submit type=submit value=Upload></form>'
  EXEC web.Trailer()
ENDipart/form-data">L� SET content =  FILECONTENT(0)
    
    INSERT INTO web.File( Path, ContentType, ContentLength, Content )
    VALUES ( '/UploadD�'
     | '<br>EXEC date.Test( 2020, 1, 1, 60 )'
     | '<br>EXEC date.TestRoundTrip()'
     | '<br>CREATE TABTlumn, which auto-increments on INSERT ( if no explicit value is supplied).<p>The data types are as follows:
<ul>
<li>in28<�ablename ( Colname1 Coltype1, Colname2 Coltype2, ... )
<p>Creates a new base table. Every base table is automatically given an;�to organise database objects into logical categories.
<h2>Table definition</h2>
<h3>CREATE TABLE</h3><p>CREATE TABLE schema.t57:�REATE SCHEMA name
<p>Creates a new schema. Every database object (Table, Function) has an associated schema. Schemas are used 9�ntax is described, optional elements are enclosed in square brackets.
<h2>Schema definition</h2>
<h3>CREATE SCHEMA</h3>
<p>C698�C web.Head('Manual')
SELECT '<h1>Manual</h1>
<p>This manual describes the various SQL statements that are available. Where sy:7�web.Main()�/EditFunc��n�/Manual�s�handler��def�4�() AS BEGIN

   DECLARE cu int SET cu = login.get(0) IF cu = 0 RETURN

EXETme action1, action2 .... *.D�d retrieve. Local float and integer variables and arithmetic operations are all 64 bits (8 bytes). The lower precision only appC�tored in a special system table if the length exceeds the reserved inline storage, meaning they are slightly slower to store an-/B�o for numbers, a zero length string for string and binary, and false for the boolean type. The variable length data types are sA� of bytes stored inline.</li>
<li>bool : boolean ( true or false ).</li>
</ul>

<p>Each data type has a default value : zer(4@�mber of bytes stored inline.</li>
<li>binary(n) : a variable length string of bytes. n (optional, default 15) specifies number?�bytes respectively.</li>
<li>string(n) : a variable length string of unicode characters. n (optional, default 15) specifies nu13>�t(n), 1 <= n <= 8. Signed n-byte integer. Default is 8 bytes.</li>
<li>float, double : floating point numbers of size 4 and 8 =� Id coT any expressions ( possibly involving local variables or function caK�h3>
<p>INSERT INTO schema.tablename ( Colname1, Colname2 ... ) VALUES ( Val1, Val2... ) [,] ( Val3, Val4 ...) ...
<p>The spec%'J�opped before using ALTER TABLE. They can be added again afterwards.
</ul>
<h2>Data manipulation statements</h2>
<h3>INSERT</I�he column is removed from the table.</li>
</ul>
<p>Note: currently, any indexes that have been added to a table need to be dr$,H�tween float and double, and modification of the number of bytes stored inline for binary and string.</li>
<li>DROP Colname : tG�ltype : the datatype of an existing column is changed. The only changes allowed are between the different sizes of integers, be)+F�<p>The actions are as follows:
<ul>
<li>ADD Colname Coltype : a new column is added to the table.</li>
<li>MODIFY Colname CoE�lies when a value is stored in column of a table.
<h3>ALTER TABLE</h3>
<p>ALTER TABLE schema.tablenaTme WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are removed.
<h2>Local variable declR�2 = Exp2 .... WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are updated.
<h3>DELETE</h3><p>DELETE FROQ� a client for further processing and eventual display. 
<h3>UPDATE</h3><p>UPDATE schema.tablename SET Colname1 = Exp1, Colname0P�s a stand-alone statement, the results are passed to the code that invoked the batch, and may be displayed to a user or sent toO�expression, the order is reversed ( descending order ).
<p>The SELECT expressions can be given names using AS.
<p>When used a!#N�uted, based on the list of expressions and the WHERE and ORDER BY clauses.
<p>If the keyword DESC is placed after an ORDER BY M�lls ).
<h3>SELECT</h3><p>SELECT expressions FROM source-table [WHERE bool-exp ] [ORDER BY expressions]
<p>A new table is comp"&L�ified values are inserted into the table. The values may beTents are executZ�he table which satisfies the WHERE condition, with the named local variables being assigned expressions which depend on the rowY�p2 .... FROM table [ WHERE bool-exp ] [ORDER BY expressions] Statement
<p>Statement is repeatedly executed for each row from tX�tion. If there is no such row, the values of the local variables remain unchanged.
<h3>FOR</h3><p>FOR name1 = exp1, name2 = exW� variables are assigned. If the FROM clause is specified, the values are taken from a table row which satisfies the WHERE condiV�untered if there is a loop ).
<h3>SET</h3>
<p>SET name1 = exp1, name2 = exp2 .... [ FROM table ] [ WHERE bool-exp ]
<p>LocalU�ed with the specified types. The variables are initialised to default values ( but only once, not each time the DECLARE is encoT�aration and assignment statements</h2>
<h3>DECLARE</h3><p>DECLARE name1 type1, name2 type2 ....
<p>Local variables are declarS�M schema.tablena$ �t9�'<p><input name="$submit" type=submit value=Save></form>'
  EXEC web.Trailer()
END( browse.FormInsertSql( t, c ) )
  SELECT 8�'
  IF ex != '' SELECT '<p>Error: ' | ex
  SELECT '<form method=post>' 
  EXECUTE( browse.FormInsertSql( t, c ) )
  SELECT 7� DECLARE title string SET title = 'Add ' | browse.TableTitle( t )
  EXEC web.Head( title )
  SELECT '<b>' | title | '</b><br>6�.tablearg(t) | '&k=' | LASTID() | ba )
      EXEC web.Redirect( browse.backurl() )       
      RETURN 
    END
  END
 
 5� IF ex = '' 
    BEGIN
      -- DECLARE ba string SET ba = browse.backargs()
      -- EXEC web.Redirect( 'ShowRow?' | browse4� string
  IF web.Form( '$submit' ) != '' 
  BEGIN
    EXECUTE( browse.InsertSql( t, c, p ) ) 
    SET ex = EXCEPTION()
   3�ser( colId, type, f )
  END
  RETURN 'UPDATE ' | sys.TableName( table ) | ' SET ' | alist | ' WHERE Id =' | k
END browse.ColPar2�uote(col) | ')'
    SET al$ist |= CASE WHEN alist = '' THEN '' ELSE ' , ' END
      | sys.QuoteName(col) | ' = ' | browse.ColPar1�r()
  END
  ELSE
  BEGIN
    EXEC web.Redirect( browse.backurl() )
  END
'
ENDe(t) | '' Table</a>''
    EXEC web.Traile0�  SELECT ''<p><a href="/ShowTable?'' | browse.tablearg(t) | ''">'' | browse.TableTitle(t) | '' Table</a>''
    EXEC web.Traile	/� '''|ba|'">Add</a>''
      FROM sys.Column WHERE Id = col
      EXECUTE( browse.ChildSql( col, k, '''|ba|''' ) )
    END
  .�ECT ''<p><b>'' | browse.TableTitle( Table ) | ''</b>''
       | '' <a href="AddChild?'' | browse.fieldarg(col) | ''&p='' | k |
-�'| ba |'">Edit</a>'''
  | '
    DECLARE col int
    FOR col = Id FROM browse.Column WHERE RefersTo = t
    BEGIN
      SEL,�FROM ' | sys.TableName(table) | ' WHERE Id = k'
  | ' SELECT ''<p><a href="/EditRow?'' | browse.tablearg(t) | ''&k='' | k | ''
+�unc | '(k)' END | '
      EXEC web.Head( title )
      SELECT ''<b>$'' | title | ''</b><br>''
  '
  | ' SELECT ' | cols | ' *�DECLARE title string SET title = browse.TableTitle( t )' 
        | CASE WHEN namefunc = '' THEN '' ELSE ' | '' '' | ' | namef)�ET k = '|k|'

    DECLARE ok int SET ok = Id FROM ' | sys.TableName(table) | ' WHERE Id = k
    IF ok = k
    BEGIN
      (�efunc = NameFunction FROM browse.Table WHERE Id = table
  RETURN '  
    DECLARE t int SET t = '|table|'
    DECLARE k int S'�col | '|''">''|' | nf | '(' | col | ')' | '|''</a>''' 
        ELSE col
        END
  END
  DECLARE namefunc string SET nam&�df != '' THEN df | '(' | col | ')'
        WHEN nf != '' THEN '''<a href="/ShowRow?' | browse.tablearg(ref) | ba | '&k=''|' | %�cols |= 
      CASE WHEN cols = '' THEN '' ELSE ' | ' END
      | '''<p>' | colname | ': '' | '
      | CASE 
        WHEN $�rowse.Column WHERE Id = colid
    IF ref > 0 SET nf = NameFunction FROM browse.Table WHERE Id = ref ELSE SET nf$ = ''
    SET #�  DECLARE ref int, nf string, df string
    SET ref = 0, nf = '', df = ''
    SET ref = RefersTo, df = DisplayFunction FROM b"�e(' | Name | ')'
    ELSE Name
    END
  FROM sys.Column WHERE Table = table 
  ORDER BY browse.ColPos(Id), Id
  BEGIN
  !�
     '<option ' | CASE WHEN sel = 0 THEN ' selected' ELSE '' END | ' value=0></option>'
     | '</select>'
END">' | options |  �n>'
  FROM sys.Schema
  ORDER BY Name
  SET options |= opt
  RETURN '<select id="' | col | '" name="' | col | '">' | options | �OR opt = '<option ' | CASE WHEN Id = sel THEN ' selected' ELSE '' END 
  | ' value=' | Id | '>' | htm.Encode( Name ) | '</optio� )
    END
  RETURN 'INSERT INTO ' | sys.TableName( table ) | browse.InsertNames( table ) | ' VALUES (' | vlist | ')'
ENDype, f�E WHEN vlist = '' THEN '' ELSE ' , ' END | 
    CASE 
    WHEN colId = pc THEN '' | p
    ELSE browse.ColParser( colId, type, f�t id="' | cn | '$" name="' | cn | '" size=' | size | ' value=' | htm.Attr(date.YearMonthDayToString(value)) | '>'
END�l | '|'''|ba|'">''|' | nf | '(' | col | ')' | '|''</a>''' 
      ELSE col
      END
  END
END.tablearg(ref) | '&k=''|' | co�!= '' THEN df | '(' | col | ')'
      WHEN nf != '' 
      THEN '''<a href="/ShowRow?' | browse.tablearg(ref) | '&k=''|' | co0�rowse.Table WHERE Id = ref
    SET result |= CASE WHEN result = '' THEN '' ELSE '|'', ''|' END | 
      CASE 
      WHEN df �
    SET ref = RefersTo, df = DisplayFunction FROM browse.Column WHERE Id = colid
    IF ref > 0 SET nf = NameFunction FROM b!#�table 
  ORDER BY browse.ColPos(Id), Id
  BEGIN
    DECLARE ref int, nf string, df string
    SET ref = 0, nf = '', df = ''�THEN 'PARSEFLOAT(' | f | ')'
    WHEN type % 8 = 5 THEN 'browse.ParseBool(' | f | ')'
    ELSE f
  END
END   WHEN type % 8 = 4 "&�  RETURN CASE 
    WHEN pf != '' THEN pf | '(' | f | ')'
  $  WHEN type % 8 = 3 THEN 'PARSEINT(' | f |')'
    WHEN type % 8 = 4 � only 28 days in a non-leap-year.
  IF m >= 3 AND NOT date.IsLeapYear( y ) SET d = d - 1
  RETURN date.YearDay( y, d )
ENDbeing%'�244 -- Sep
    WHEN m = 10 THEN 274 -- Oct
    WHEN m = 11 THEN 305 -- Nov
    ELSE 335 -- Dec
    END
  -- Allow for Feb being�EN 121 -- May
    WHEN m = 6 THEN 152 -- Jun
    WHEN m = 7 THEN 182 -- Jul
    WHEN m = 8 THEN 213 -- Aug
    WHEN m = 9 THEN $,�m = 1 THEN 0 -- Jan
    WHEN m = 2 THEN 31 -- Feb
    WHEN m = 3 THEN 60 -- Mar
    WHEN m = 4 THEN 91 -- Apr
    WHEN m = 5 TH�   ELSE 335 -- Dec
    END
  SET dim = d - fdm
  SET m = ( d - dim + 28 ) / 31
  RETURN date.YearMonthDay( y, m+1, dim+1 )
END )+�EN d < 244 THEN 213 -- Aug
    WHEN d < 274 THEN 244 -- Sep
    WHEN d < 305 THEN 274 -- Oct
    WHEN d < 335 THEN 305 -- Nov
 � < 121 THEN 91 -- Apr
    WHEN d < 152 THEN 121 -- May
    WHEN d < 182 THEN 152 -- Jun
    WHEN d < 2$13 THEN 182 -- Jul
    WH*.
� d + 1
  SET fdm = CASE 
    WHEN d < 31 THEN 0 -- Jan
    WHEN d < 60 THEN 31 -- Feb
    WHEN d < 91 THEN 60 -- Mar
    WHEN d�N t % 8 = 2 THEN 'string(' | (p-1) | ')'
       WHEN t % 8 = 3 THEN 'int(' | p | ')'
       ELSE '???'
    END
  END
END    WHE-/� THEN 'binary'
    WHEN t = 130 THEN 'string'
    ELSE 
    CASE 
       WHEN t % 8 = 1 THEN 'binary(' | (p-1) | ')'
       WHE
�Quote(ParseFunction)|')'
    FROM browse.Column WHERE Id = cid
  END
  SELECT '
GO'
ENDgleQuote(DisplayFunction)|','|sys.Single(4	�InputCols|','|sys.SingleQuote(InputFunction)
      |','|InputRows|','|Style|','|sys.SingleQuote(DisplayFunction)|','|sys.Single�sition|','|sys.SingleQuote(Label)
      |','|sys.SingleQuote(Description)
      |','|RefersTo|','|sys.SingleQuote(Default)|','|13�efersTo],[Default],[InputCols],[InputFunction],[InputRows],[Style],[DisplayFunction],[ParseFunction]) 
VALUES (cid, '
      |Po�mn WHE$RE Table = tid AND Name = ' | sys.SingleQuote(cname) | '
INSERT INTO browse.Column(Id,[Position],[Label],[Description],[R28�RE cid int, cname string
  FOR cid=Id, cname=Name FROM sys.Column WHERE Table = t
  BEGIN
    SELECT '
SET cid=Id FROM sys.Colu�| sys.SingleQuote(Title) | ',' 
    | sys.SingleQuote(Description) | ',' | Role | ')'
  FROM browse.Table WHERE Id = t

  DECLA57�id,'
    | sys.SingleQuote(NameFunction) |','|sys.SingleQuote(SelectFunction) 
    | ',' | sys.SingleQuote(DefaultOrder) | ',' �e(tname) 
SELECT '
INSERT INTO browse.Table(Id,NameFunction, SelectFunction, DefaultOrder, Title, Description, Role) 
VALUES (t69�Schema WHERE Name = ' | sys.SingleQuote(sname) | '
SET tid = Id FROM sys.Table WHERE Schema = sid AND Name = ' | sys.SingleQuot:�E Id = t
  SET sname = Name FROM sys.Schema WHERE Id = sid

  SELECT '
DECLARE tid int, sid int, cid int
SET sid = Id FROM sys.�geebee2�george. �Sunday !�Test Re"�geebee2#�mozhdar$Hi Moz!!This is a test�george.%�george.&�Thursda'�Testing(0�Invalid/��P�Ȥ��permaneS��xk����permaneT�6"v����permaneU��~����permane0��;�����permane2y�����HRS���EXEC 4T���EXEC 8U���EXEC 9V���EXEC :W���EXEC >X���EXEC BY���EXEC FZ���EXEC J[���EXEC N\���EXEC R	]���EXEC V^���EXEC Z
_���EXEC ^`���EXEC b
a���EXEC fb���EXEC j c���EXEC nd���EXEC �e���EXEC �f���EXEC �g���EXEC �h���EXEC Vi���EXEC qj���EXEC �k���EXEC �l���EXEC �m���EXEC un���EXEC vo���EXEC �p���EXEC �q���EXEC �r���EXEC �$s���EXEC ]t���EXEC x#!u���EXEC �v���EXEC �&"w���EXEC 7x�0sys.SchemaName�browse.
sys.TableName�browse.
sys.IndexName
dbo.CustNamedbo.CustSelectCustomer
email.MsgNameemail.MsgSelect�email.S�email.S]p��', '%3F' )
  --SET s = REPLACE( s, '/', '%2F' )
  --SET s = REPLACE( s, '#', '%23' )
  RETURN s
END�� ((  ����������	���3�7	�������(�*���������\�����X	���R	�U���������������	���b	�8	�8�b	������]�����Z	���1�5	���	��	�]���	����	����`�7�7�`�������������	����`�7�7�`�����ame�Alex�LastName�Barwood�x�101��hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1������FirstN��ame�Alex�LastName�Barwood�x�101��hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���
���FirstN��web.Main()�/EditRow��b1�/ShowTable?s=dbo&n=Cust�b2�/ShowRow?s=dbo&n=Cust&k=8�k�8�n�Cust�s�dbo��$submit�Save�Age�63�City��FirstN
��web.Main()�/EditRow��b1�/ShowTable?s=dbo&n=Cust�b2�/ShowRow?s=dbo&n=Cust&k=8�k�8�n�Cust�s�dbo��$submit�Save�Age�63�City��FirstN	�����(�*��	���R	�U��
� &mut *sm.st.x);
            }
            else
            {
       �,9$s&�(�\!][^�_�`	aCb	}[�X
�W2V
pT�S�RQXP�O�NM%\ �`��SELECT ''(''|' | sys.ColValues(t) | '|'')
''' | ' FROM ' | sys.TableName(t) | filter )

    SELECT 'GO
'
END    EXECUTE( '��'' END
    END    

    SELECT '
INSERT INTO ' | sys.TableName(t) | sys.ColNames(t) | ' VALUES 
'       

    EXECUTE( '��        WHEN sname = 'log' OR sname = 'email' OR sname = 'login' OR sname = 'timed'
        THEN ' WHERE 1 = 0'
        ELSE �� = Schema FROM sys.Table WHERE Id = t
      DECLARE sname string SET sname = sys.SchemaName(schema)
      SET filter = CASE
��
    ELSE IF mode = 2
    BEGIN
      DECLARE tname string SET tname = sys.TableName(t) 
      DECLARE schema int SET schema��
       WHEN t = 4 THEN ' WHERE Id > 6' -- Index
       WHEN t = 5 THEN ' WHERE Index > 6' -- IndexColumn
       ELSE '' END
��F next < now + 10 * 1000000 SET next = now + 10 * 1000000

  UPDATE timed.Job SET at = next WHERE fn = 'email.Retry'

END I��il.Delayed
  BEGIN
    I\F t < next SET next = t
  END
 
  -- Minimum time for next call to email.Retry is 10 seconds.
  I��for next call to email.Retry.
  DECLARE next int SET next = now + 24 * 3600 * 1000000
  FOR t = time + 600 * 1000000 FROM ema��
    INSERT INTO email.Queue( msg ) VALUES ( m )
    DECLARE dummy int SET dummy = EMAILTX()
  END

  -- Calculate time to 	�� != 0
  BEGIN
    DECLARE m int
    SET m = msg FROM email.Delayed WHERE Id = r
    DELETE FROM email.Delayed WHERE Id = r
��600 * 1000000 FROM email.Delayed 
  BEGIN
    IF now >= t
    BEGIN
      SET r = id
      BREAK
    END
  END

  IF r
�� * 60 + hour * 3600 + min * 60 + sec
  SET result = result * 1000000
ENDyear, month, day ) )
  SET result = result * 24 * 60��''|sec)
  

  SET result = date.YearMonthDayToDays( date.YearMonthDay( year, month, day ) )
  SET result = result * 24 * 60
��  SET sec = PARSEINT( SUBSTRING( s, six + 1, LEN(s) ) )
  IF sec > 5\9 THROW 'Secondss must be 0..59 parsing time ' | htm.Attr(��SEINT( SUBSTRING( s, mix + 1, six - mix - 1 ) )
  IF min > 59 THROW 'Minutes must be 0..59 parsing time ' | htm.Attr(''|min)
��NG( s, hix + 1, mix - hix - 1 ) )
  IF hour > 23 THROW 'Hour must be 0..23 parsing time ' | htm.Attr(''|hour)
  SET min = PAR��sing date ' | htm.Attr(''|day)
  SET year = PARSEINT( SUBSTRING( s, yix + 1, hix - yix - 1 ) )
  SET hour = PARSEINT( SUBSTRI��1
  END
 
  SET day = PARSEINT( SUBSTRING( s, dix+1, yix - dix - 1) )
  IF day < 1 OR day > 31 THROW 'Day must be 1..31 par�� six = mix+1
  WHILE true
  BEGIN
    IF six > LEN(s) BREAK
    IF SUBSTRING( s, six, 1 ) = ':' BREAK
    SET six = six + ��RING( s, mix, 1 ) = ':' BREAK
    SET mix = mix + 1
  END

  DECLARE six int -- Index of colon before seconds string
  SET��mix int -- Index of colon before hour string
  SET mix = hix+1
  WHILE true
  BEGIN
    IF mix > LEN(s) BREA\K
    IF SUBST��true
  BEGIN
    IF hix > LEN(s) BREAK
    IF SUBSTRING( s, hix, 1 ) = ' ' BREAK
    SET hix = hix + 1
  END

  DECLARE �� ' ' BREAK
    SET yix = yix + 1
  END

  DECLARE hix int -- Index of space before hour string
  SET hix = yix+1
  WHILE �� space before year string
  SET yix = dix+1
  WHILE true
  BEGIN
    IF yix > LEN(s) BREAK
    IF SUBSTRING( s, yix, 1 ) =��  IF dix > LEN(s) BREAK
    IF SUBSTRING( s, dix, 1 ) = ' ' BREAK
    SET dix = dix + 1
  END
  DECLARE yix int -- Index of��parsing date ' | htm.Attr(ms)
  DECLARE dix int -- Index of space beforee day string
  SET dix = 4
  WHILE true
  BEGIN
  ��t' THEN 10
    WHEN ms = 'Nov' THEN 11
    WHEN ms = 'Dec' THEN 12
    ELSE 0
  END  
  IF month = 0 THROW 'Unknown month ��  WHEN ms = 'Jun' THEN 6
    WHEN ms = 'Jul' THEN 7
    WHEN ms = 'Aug' THEN 8
    WHEN ms = 'Sep' THEN 9
    WHEN ms = 'Oc��Jan' THEN 1
   \ WHEN ms = 'Feb' THEN 2
    WHEN ms = 'Mar' THEN 3
    WHEN ms = 'Apr' THEN 4
    WHEN ms = 'May' THEN 5
  �� '<input id="' | cn | '" name="' | cn | '" size=' | size | ' value=' | htm.Attr(date.MicroSecToString(value)) | '>'
END��a = at FROM timed.Job
  BEGIN
    IF now >= a
      EXECUTE( 'EXEC ' | f | '()' )
  END
   
  EXEC timed.Sleep()
END(��d.Job table with time for next retry.
    EXEC timed.Sleep() -- Set sleep time based on timed.Job table.
  END
ENDpdate time��SERT INTO email.Delayed( msg, error, time )
    VALUES ( id, error, date.Ticks() )
    EXEC email.Retry() -- Will update time!#��SE 'DELETE FROM rtestdata.[' | tname | '] WHERE y = ' | ( r%15)
  END
  
  SELECT 'sql=' | sql

  EXECUTE( sql )
 
END)'
    EL�� = 1 THEN 'INSERT INTO rtestdata.[' | tname | '](x,y) VALUES ( rtest.repeat(''George'','|(r % 100)|'),' | (r % 10) | ')'
    EL"&��e | '](x string, y int(3), z string )'
      END
    WHEN r\ % 10 = 0 THEN 'DROP TABLE rtestdata.[' | tname | ']'
    WHEN r % 2��SE WHEN r % 2 =1 THEN 'CREATE TABLE rtestdata.[' | tname | '](x string, y int(5))'
      ELSE 'CREATE TABLE rtestdata.[' | tnam%'��T exists = Name FROM sys.Table WHERE Schema = rtestdata AND Name = tname

  SET sql = CASE 
    WHEN exists = '' THEN 
      CA��int
  SET a = r % 2

  DECLARE tname string
  SET tname = 't' | ( r / 100 ) % 7

  DECLARE exists string
  SET exists = ''
  SE$,��DER BY ' | orderBy ELSE '' END
  FROM sys.Table WHERE Id = t

  EXECUTE( sql )

  EXEC web.Trailer()
ENDy != '' THEN ' OR��''| ''''|' 
    | browse.ColValues(Id,ba)  
    | ' FROM ' 
    | sys.TableName(Id)
    | CASE WHEN orderBy != '' THEN ' OR)+��
  DECLARE sql string SET sql ='SELECT ''<br><a href="ShowRow?' | browse.tablearg(t)
    | '&k=''| Id | ''' | ba |'">Show</a> �� | browse.tablearg(t) | ba | '">Add</a>'

  DECLARE orderBy string SET orderBy = DefaultOrder FROM b\rowse.Table WHERE Id = t
*.��sys.QuoteName(Name) | ' ' | sys.IndexCols(Id)
  FROM sys.Index WHERE Table = t
*/
  SELECT '<p><b>Rows</b> <a href="AddRow?'��>Settings</a>'   
    | '<p><b>Columns:</b> ' | browse.ColNames( t, ba )
/*
  SELECT '<p><b>Indexes</b>'
  SELECT '<br>' | -0�� title | ' Table'
  EXEC web.Head( title )
  SELECT '<b>' | title | '</b> <a href=/BrowseInfo?' | browse.tablearg(t) | ba | '��
    EXEC sys.ScriptSchema(s,mode)
  FOR s = Id FROM sys.Schema
    EXEC sys.ScriptSchemaBrowse(s)
END/�� dates - conversions between Days ( from year 0 ), Year-Day, Year-Month-Day and string.
' 
EXEC web.Trailer()
ENDanipulating�� tables and functions for displaying, editing arbitrary tables in the database.
<h3>date</h3><p>Has functions for manipulating13��>Has handler functions, one for each web page.
<h3>htm</h3>
<p>Has functions related to encoding html.
<h3>browse</h3><p>Has��the fuT database objects ( tables, function ) must be created in a� terminated.
<h2>Batch execution</h2><p>EXECUTE ( string-expression )
<p>Evaluates the string expression, and then executes t`� A label consists of a name followed by a colon (:)
<h3>BREAK</h3><p>BREAK
<p>Execution of the enclosing FOR or WHILE loop is_�s bool-exp evaluates to true. See also BREAK.
<h3>GOTO</h3><p>GOTO label
<p>Control is transferred to the labelled statement.^�tement2 ( if specified ) is executed.
<h3>WHILE</h3><p>WHILE bool-exp Statement
<p>Statement is repeatedly executed as long a]�h3>
<p>IF bool-exp THEN Statement1 [ ELSE Statement2 ]
<p>If bool-exp evaluates to true Statement1 is executed, otherwise Sta\�ed in order. A BEGIN..END compound statement can be used whenever a single statement is allowed.
<h3>IF .. THEN ... ELSE ...</[�s.
<h2>Control flow statements</h2>
<h3>BEGIN .. END</h3><p>BEGIN Statement1 Statement2 ... END
<p>The statem`rage::new("rustweb.rustdb"));
    let upd = Box::new(SimpleFileStorage::new("rustweb.upd"));
    let ��ials = args.login;

    // Construct an AtomicFile. This ensures that updates to the database are "all or nothing".
    let fil��rsing listen address:port");
    let is_master = args.rep == "";
    let replicate_source = args.rep;
    let replicate_credent	��args.rep, args.login);

    let listen = format!("{}:{}", args.ip, args.port);
    let listen = listen.parse().expect("Error pa��ber::init();

    let args = Args::parse();
    println!("ip={} port={} mem={} rep={} login={}", args.ip, args.port, args.mem, 
��ion/octet-stream��d�#![forbid(unsafe_code)]

#[tokio::main]
/// Execution starts here.
async fn main() {
    // console_subscri��web.Main()�/FileUpload����hpw�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���file�main.rs�applicat
�? false)]
   tracemem: bool,

}
  tracetime: bool,

   /// Trace memor`p��unc::Int(c_email_tx)),
        ("SLEEP", DataKind::Int, CompileFunc::Int(c_sleep)),
        ("TRANSWAIT", DataKind::Int, Compil��
    let list = [
        ("ARGON", DataKind::Binary, CompileFunc::Value(c_argon)),
        ("EMAILTX", DataKind::Int, CompileF��MAILTX and SLEEP as well as the standard functions.
    let mut bmap = BuiltinMap::default();
    standard_builtins(&mut bmap);��emem;
    }
    // Construct map of "builtin" functions that can be called in SQL code.
    // Include extra functions ARGON, E��stg));
    {
       let mut s = spd.stash.write().unwrap();
       s.mem_limit = args.mem * 1000000;
       s.trace = args.trac��t readers never have to wait, they get a "virtual" read-only copy of the database.
    let spd = Arc::new(SharedPagedData::new(��stg = Box::new(AtomicFile::new(file, upd));

    // SharedPagedData allows for one writer and multiple readers.
    // Note tha��e = Box::new(SimpleFileSto (�Name�RootCSchemaCName�IdGenCTableCName�TypeC	RootC
TableC	Name�IndexC

ColIdCSchemaC
NameDef�Path�ContentType�
ContentLengthCContent�PositionCLabel�Description�Re(�
	


	#2 	,!	""	#	$!$	%%	&
'
).(
)
*(*
+<,';-.&-/01/12 635
0789�(Schema
TableColumnMIndex
IndexColumn	Function�FileColumnJ	Table
Cust		Order�MMsg

QueueE	Gen

userSmtpAccount	SendErrorJobDelayedTransaction�(SchemaTableColumnIndexIndexColumnFunctionFile
Column	Table

CustOrder	Msg
Queue	Gen
userSmtpAccount	SendErrorJobDelayedTransactionX
	
		X
	
		H
ByNameBySchemaNameByTable
ByTableByIndexBySchemaNameByPath
ByRefersTo		 ByCust@��-N '(' | list | ')'
ENDP= 8 THEN 'Aug'
    WHEN m = 9 THEN 'Sep'P
    WHEN m = 10 THEN 'Oct'
    WHEN m =P 11 THEN 'Nov'
    WHEN m = 12 THEN 'Dec5'
    ELSE '???'
  END
END= 12 THEN 'DecQ( days + i )
    SET i = i + 1
  END
ENDP
  SELECT 'Finished test day=' | day | 'I date=' | date.DaysToString(day)
END | '; ELSE '?weekday?'
    END
END	7owse.InputString'
  END
END	
P id="' | cn | '" name="' | cn | '" size=Q' | size | ' value="' | value | '">'
END
PET requests maybe be assumed to be read-
Conly.
  EXEC rtest.OneTest() 
ENDe read-
P7, ( 501 * (@I%11+@I%7) ) / 100, date ) =
    SET @I=@I+1 
  END
END0, date ) =ysToYearMonthDay(date.Today())#InputYearMonthDay%arMonthDayToString%ringToYearMonthDayE body is plain text, 1 means HTML.croSecToStringcroSecToStringInputTimecroSecToStringringToTimecroSecToStringSchemaSelectTableSelectmtpAccountName!mtpAccountSelect222@yahoo.com0 #barwood@gmail.com!Eventing test#!"=try <b>Some bold text</b> Test#222@yahoo.com&"$'owzabaghi@gmail.com%#barwood@gmail.com'%&'barwood@outlook.com'y 11 Aug Test,$( <b>Html</b>+w3�Pq�Z�B��������]��'d
Etvu*il.yahoo.com+222@yahoo.com.),ijpiacmnm-#barwood@gmail.com/-.mgcrwlgda/ email domain8(0Pnt error (535): 5.7.8 Username and Passw1?ord not accepted. Learn more atand Passw312Pnt error (535): 5.7.8 Username and Passw3?ord not accepted. Learn more atand Passw624Pweb.Main()�/Execute���sql�%DELETE FROM l5Pog.Transaction WHERE 1=1��hpw�B0xceb2893756P2f94239943ca565f2ee11c9839b27d320318f2cb7Cdedb52fcdf95cfd93�uid�1���riqō318f2cb<483timed.Run()�������r�q�93timed.Run()��������Iy�;9:Pweb.Main()�/Execute���sql�"SELECT REPACK;PFILE(0,'dbo','Order')��hpw�B0xceb28932f9>:<P4239943ca565f2ee11c9839b27d320318f2cbded==b52fcdf95cfd93�uid�1����l	�318f2cbded?=>Pweb.Main()�/Execute���sql�"SELECT REPACK?PFILE(0,'dbo','Order')��hpw�B0xceb28932f9` @P4239943ca565f2ee11c9839b27d320318f2cbdedA=b52fcdf95cfd93�uid�1������318f2cbdedCABPweb.Main()�/Execute���sql�"SELECT REPACKCPFILE(0,'dbo','Order')��hpw�B0xceb28932f9FBDP4239943ca565f2ee11c9839b27d320318f2cbdedE=b52fcdf95cfd93�uid�1������h318f2cbdedGEFPweb.Main()�/Execute���sql�#SELECT REPACKGPFILE(-2,'dbo','Order')��hpw�B0xceb28932fLDHP94239943ca565f2ee11c9839b27d320318f2cbdeI?db52fcdf95cfd93�uid�1����Go318f2cbdeKIJPweb.Main()�/Execute���sql�EXEC dbo.MakeOKPrders(50000)��hpw�B0xceb28932f94239943caNJLP565f2ee11c9839b27d320318f2cbdedb52fcdf95M+cfd93�uid�1���[�;�318f2cbdedb52fcdf95OMNPweb.Main()�/Execute���sql�EXEC dbo.MakeOOPrders(50000)��hpw�B0xceb28932f94239943caXHPP565f2ee11c9839b27d320318f2cbdedb52fcdf95Q+cfd93�uid�1���[�nY318f2cbdedb52fcdf95SQRPweb.Main()�/Execute���sql�"SELECT REPACKSPFILE(0,'dbo','Order')��hpw�B0xceb28932f9VRTP4239943ca565f2ee11c9839b27d320318f2cbdedU=b52fcdf95cfd93�uid�1���d\��318f2cbdedWUVPweb.Main()�/Execute���sql�"SELECT REPACKWPFILE(0,'dbo','Order')��hpw�B0xceb28932f9\TXP4239943ca565f2ee11c9839b27d320318f2cbdedY=b52fcdf95cfd93�uid�1���d�@318f2cbded[YZPweb.Main()�/Execute���sql�"SELECT REPACK[PFILE(0,'dbo','Order')��hpw�B0xceb28932f9^Z\P4239943ca565f2ee11c9839b27d320318f2cbded]=b52fcdf95cfd93�uid�1���d��M318f2cbded_]^Pweb.Main()�/Execute���sql�"SELECT REPACK_PFILE(0,'dbo','Order')��hpw�B0xceb28932f9qP`P4239943ca565f2ee11c9839b27d320318f2cbdeda=b52fcdf95cfd93�uid�1���d���318f2cbdedcabPweb.Main()�/Execute���sql�"SELECT REPACKcPFILE(0,'dbo','Order')��hpw�B0xceb28932f9fbdP4239943ca565f2ee11c9839b27d320318f2cbdede=b52fcdf95cfd93�uid�1���d��n318f2cbdedgefPweb.Main()�/Execute���sql�"SELECT REPACKgPFILE(0,'dbo','Order')��hpw�B0xceb28932f9ldhP4239943ca565f2ee11c9839b27d320318f2cbdedi=b52fcdf95cfd93�uid�1���d���318f2cbdedkijPweb.Main()�/Execute���sql�"SELECT REPACKkPFILE(0,'dbo','Order')��hpw�B0xceb28932f9njlP4239943ca565f2ee11c9839b27d320318f2cbdedm=b52fcdf95cfd93�uid�1���d�B�318f2cbdedomn3timed.Run()�������� �drPFILE(0,'dbo','Order')��hpw�B0xceb28932f9qPweb.Main()�/Execute���sql�"SELECT REPACKthsP4239943ca565f2ee11c9839b27d320318f2cbdedspt=b52fcdf95cfd93�uid�1���9ºr318f2cbdedu7email.Sent(3)�������:,�*rv3timed.Run()��������k�x@���' | sys.QuoteName( sname )

    DECLARE t int
    FOR t = Id FROM �sys.Table WHERE Schema = s ORDER BY Name
    BEGIN
      EXEC sys.S�criptTable(t)
    END
  END

  /******* Script functions *******/�

  SELECT '
CREATE FN ' | sys.Dot( sname,Name) | Def | '
GO' 
 � FROM sys.Function  WHERE Schema = s ORDER BY Name

  /******* Scri�pt Data *******/

  IF sname != 'sys' AND sname != 'browse'
  BEGI�N
    FOR t = Id FROM sys.Table WHERE Schema = s ORDER BY Name
    S  EXEC sys.ScriptData(t,mode)
  END
ENDhema = s ORDER BY Name
    � | ' ON ' | sys.TableName(t) | sys.IndexCols(ix) | '
GO'
  END
END	�sec % 60
  SET hour = min / 60
  SET min = min % 60
  RETURN date.	
}DaysToString(  day ) | ' ' | hour | ':' | min | ':' | sec
ENDN date.�C web.SetCookie('username','','Max-Age=0')
  */
  DECLARE x int
  SET
� x = HEADER( 'set-cookie', name | '=' | value | '; ' | expires )
ENDT
�>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

�<title>' | title | '</title>
<style>
   body{font-family:sans-serif;}�
</style>
</head>
<body>
<div class=menubar><div><div>
   <a href="/"�>Home</a>
   <a href="/About">About Us</a>
   <a href="/Contact">Cont=act us</a>
</div></div>

'
ENDAbout Us</a>
   <a href="/Contact">Cont�Table = table
  ORDER BY browse.ColPos(Id), Id
  BEGIN
    SET res�ult |= CASE WHEN result = '' THEN '' ELSE ', ' END | col
  END
ENDs�f string
    SET ref = 0, inf = ''
    SET ref = RefersTo, inf = Inpu�tFunction FROM browse.Column WHERE Id = colId
    IF ref > 0 AND inf �= '' SET inf = SelectFunction FROM browse.Table WHERE Id = ref
    IF� inf = '' SET inf = browse.DefaultInput( type )
    SET sql |= 
     � CASE WHEN sql = '' THEN '' ELSE ' | ' END
      | '''<p><label for="�' | col | '">' | col | '</label>: '' | ' 
      | inf | '(' | colId |� ',' | sys.QuoteName(col) | ')'
  END
  RETURN 'SELECT ' | sql | ' FRkOM ' | sys.TableName( table ) | ' WHERE Id =' | k
ENDT ' | sql | ' FR�| Id | '>' | htm.Encode( sys.TableName(Id) ) | '</option>'
  FROM sys�.Table
  ORDER BY sys.TableName(Id)
  SET options |= opt
  RETURN '<s�elect id="' | col | '" name="' | col | '">' | options | 
     '<optio�n ' | CASE WHEN sel = 0 THEN ' selected' ELSE '' END | ' value=0></op0 ;tion>'
     | '</select>'
END' selected' ELSE '' END | ' value=0></op!�ECUTE( browse.InsertSql( t, 0, 0 ) ) 
    SET ex = EXCEPTION()
    #!"�IF ex = '' 
    BEGIN
      DECLARE ba string SET ba = browse.backa#�rgs()
      EXEC web.Redirect( 'ShowRow?' | browse.tablearg(t) | '&k&"$�=' | LASTID() | ba )
      RETURN
    END
  END
  
  EXEC web.He%�ad( 'Add ' | browse.TableTitle( t ) )
  IF ex != '' SELECT '<p>Error'%&�: ' | htm.Encode( ex )
  SELECT '<form method=post>' 
  EXECUTE( br'�owse.FormInsertSql( t, 0 ) )
  SELECT '<p><input name="$submit" type,$(m=submit value=Save></form>'
  EXEC web.Trailer()
END="$submit" type)�d = c

  DECLARE ok int SET ok = 0
  SET ok = Id FROM browse.Column W+)*�HERE Id = c
  IF ok != c INSERT INTO browse.Column( Id ) VALUES ( c )+�

  IF web.Form( '$submit' ) != '' 
  BEGIN
    EXECUTE( browse.Updat.*,�eSql( tid, c ) ) 
    EXEC web.Redirect( 'ShowTable?k=' | t )
  END
 -� ELSE
  BEGIN
    EXEC web.Head( 'Column ' | colName )
    SELECT '<h/-.�1>Column ' | colName | '</h1><form method=post>' 
    EXECUTE( browse/�.FormUpdateSql( tid, c ) )
    SELECT '<p><input name="$submit" type=8(0wsubmit value=Save></form>'
    EXEC web.Trailer()
  END
ENDmit" type=1� k
    EXEC web.Redirect('ListFile')
  END
  ELSE
  BEGIN
    EXEC we312�b.Head( 'Edit File' )
    SELECT '<h1>Edit File Path</h1>'
    SELECT3� '<form method=post>Path: <input name=path size=50 value="' | Path | 624�'">'
      | '<p><input type=submit value=Save></form>'
    FROM web.5eFile WHERE Id = k
    EXEC web.Trailer()
  END
ENDorm>'
    FROM web.756�bmit' )
  IF submit != '' 
  BEGIN
    IF submit = 'Save'
    BEG7�IN
      EXECUTE( browse.UpdateSql( t, k ) ) 
      SET ex = EXCEPT<48�ION()
      IF ex = '' 
      BEGIN
        EXEC web.Redirect( bro9�wse.backurl() )
        RETURN
      END
    END
    ELSE IF subm;9:�it = 'Delete'
    BEGIN
      EXECUTE( 'DELETE FROM ' | sys.TableNa;�me( t ) | ' WHERE Id =' | k )
      EXEC web.Redirect( browse.backur>:<�l() )
      RETURN
    END      
  END
 
  EXEC web.Head( 'Edit =�' | browse.TableTitle( t ) )
  IF ex != '' SELECT '<p>Error: ' | htm?=>�.Encode(ex)

  SELECT '<form method=post>'  
  EXECUTE( browse.For?�mUpdateSql( t, k ) )
  SELECT '<p><input name="$submit" type=submit P @�value=Save></form>'

  SELECT '<form method=post><input name="$submA�it" type=submit value=Delete></form>'
  EXEC web.Trailer()
END$submA\E    EXEC web.Trailer()
  END
ENDme=pw><input type=submit></form>'
[�=post><p>Enter password: <input name=pw><input type=submit></form>'
YFZ� BEGIN
    EXEC web.Head( 'Set Password' )
    SELECT '<form methodY�   SELECT '<p>Password set'
    EXEC web.Trailer()
  END
  ELSE
 EGX� login.hash(pw|k) WHERE Id = k
    EXEC web.Head( 'Password Set')
 G�' | Id | '>' | htm.Encode( dbo.CustName(Id) ) | '</option>'
  FROM dbLBH�o.Cust
  ORDER BY LastName, FirstName
  SET options |= opt

  RETURN I�'<select id="' | col | '" name="' | col | '">' | options 
    | '<optKIJ�ion ' | CASE WHEN sel = 0 THEN ' selected' ELSE '' END | ' value=0></K=option>'
    | '</select>'
END ' selected' ELSE '' END | ' value=0></NJL� value=' | Id | '>' | htm.Encode( email.SmtpAccountName(Id) ) | '</opM�tion>'
  FROM email.SmtpAccount
  ORDER BY Id
  SET options |= optOMN�

  RETURN '<select id="' | col | '" name="' | col | '">' | optionsO� 
    | '<option ' | CASE WHEN sel = 0 THEN ' selected' ELSE '' END XHP]| ' value=0></option>'
    | '</select>'
END selected' ELSE '' END QU sid AND Name = tname

  RETURN tid
ENDSQR� | web.UrlEncode(pv)
    SET pv = v

    SET n = n + 1
  END
ENDSsnt error (554): 6.6.0 Error sending message for delivery.VRTynt error (535): 5.7.0 (#AUTH005) Too many bad auth attempts.Uynt error (535): 5.7.0 (#AUTH005) Too many bad auth attempts.WUV�web.Main()�/Execute���sql�EXEC dbo.MakeOrders(0)��hpw�B0xceb28932f942W�39943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cY ����et=_blank href=/ScriptAll?mode=1>Script entire database</a> 
  | <a target=_blank href=/ScriptAll��ins>Logins</a>
<p><a href=/ListFile>Files</a>
<p><a href=/FileUpload>File Upload</a>
<p><a targ��blic Site Home Page</a>
<h3>System</h3>
<p><a href=/Execute>Execute SQL</a>
<p><a href=/ListLog��n=Cust">Customers</a> | <a href="/OrderSummary">Order Summary</a>
<p><a target=_blank href="/">Pu��0) IF cu = 0 RETURN

   EXEC web.Head('System Menu')
   SELECT '
<p><a href="/ShowTable?s=dbo&��web.Main()�/EditFunc��n�/Menu�s�handler��def�5() AS
BEGIN
   DECLARE cu int SET cu = login.get(�� Name | '>' | Name | '</a> | ' FROM sys.Schema ORDER BY Name

   EXEC web.Trailer()
ENDma?s=' |��kAll>Check all functions compile ok</a> 

<h3>Schemas</h3>'
   SELECT '<a href=ShowSchema?s=' |
��iptAll?mode=2>Filtered</a>    
  | <a target=_blank href=/ScriptExact>Exact</a>
<p><a href=/Chec��a target=Y_blank href=/ScriptAll?mode=1>Script entire database</a> 
  | <a target=_blank href=/Scr	��istLogins>Logins</a>
<p><a href=/ListFile>Files</a>
<p><a href=/FileUpload>File Upload</a>
<p><��"/">Public Site Home Page</a>
<h3>System</h3>
<p><a href=/Execute>Execute SQL</a>
<p><a href=/L��GIN
  /* Get the current logged in user. Note: role is not yet checked */

  DECLARE username s��ment out the line below enable Login after Login password has been setup for some user.
     In a��tring SET username = web.Form('username')

  /*
     Login is initially disabled. Remove or com
��web.Main()�/EditFunc��b1�/ShowSchema?s=login�n�getx�s�login��def�h( role int ) RETURNS int AS
BEL��   DECLARE password string SET password = web.Form('password')
    SET result = Id FROM login.use��esult = Id FROM login.user WHERE Id = result AND HashedPassword = hpw
    IF result > 0
    BEGI��r WHERE Name = username
    DECLARYE hpw binary SET hpw = login.hash( password|result )
    SET r��input type=submit value=Login></form>'
  EXEC web.Trailer()

  RETURN 0
END���渘���rd><br><��m method=post>User Name <input name=username><br>Password <input type=password name=password><br><�� Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXEC web.Head( 'Login' )
  SELECT '<forO��N
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCookie( 'hpw', '' | hpw, ��ddition, the salt string in login.Hash should be changed.
  */

  IF username != ''
  BEGIN
 ��w�B0xceb28932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���K�0RN 0
END��hp��=password><br><input type=submit value=Login></form>'
  EXEC web.Trailer()

  RETURN 0
END��hp��
  SELECT '<form method=post>User Name <input name=username><br>Password <input type=password name��ogin.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
Y
  END

  EXEC web.Head( 'Login' )
��DECLARE uid int SET uid = PARSEINT(uids)
    DECLARE hpwt binary SET hpwt = HashedPassword FROM l��ookie('uid')
  DECLARE hpwf string SET hpwf = web.Cookie('hpw')

  IF uids != ''
  BEGIN
    ��pw', '' | hpw, '' )
      RETURN result
    END
  END

  DECLARE uids string SET uids = web.C��t > 0
    BEGIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCookie( 'hJ0��ame = username AND HashedPassword = hpw /* Binary comparison not yet implemented! */
    IF resul��DECLARE hpw binary SET hpw = login.hash( password )

    SET result = Id FROM login.user WHERE N!#�� IF username != ''
  BEGIN
    DECLARE password string SET password = web.Form('password')
    ��dition, the salt string in login.Hash should be changed.
  */
  RETURN 1 -- Login disabled.

 "&��ent out the line below enable Login after Login password has been setup for some user.
Y
     In ad��ring SET username = web.Form('username')

  /*
     Login is initially disabled. Remove or comm%'��IN
  /* Get the current logged in user. Note: role is not yet checked */

  DECLARE username st��web.Main()�/EditFunc��b1�/ShowSchema?s=login�n�get�s�login��def�x( role int ) RETURNS int AS
BEG$,��    SET result = result | '&b' | n | '=' | web.UrlEncode(v)
    SET n = n + 1
  END
ENDELSE
  �'b' | n )
    IF v = ''
      RETURN result | '&b' | n | '=' | web.UrlEncode(keep)
    ELSE
  )+~�

  SET keep = web.Path() | keep

  SET n = 1
  WHILE 1 = 1
  BEGIN
    SET v = web.Query( }� keep | CASE WHEN keep = '' THEN '?' ELSE '&' END | name | '=' | v
    SET n = n + 1
  END      *.|�= 5 THEN 'f'
      ELSE 's'     
    END
    SET v = web.Query(name)
    IF v != '' SET keep ={�E 
      WHEN n = 2 THEN 'n'
      WHEN n = 3 THEN 'k'
      WHEN n = 4 THEN 'p'
      WHEN n -/z�ECTY d
  ELSE
  BEGIN
    DECLARE dummy int SET dummy = TRANSWAIT()
  END
ENDy� < next SET next = t
  END

  DECLARE dummy int
  SET dummy = SLEEP( next-now )
END(@l�' | CASE WHEN sel = 0 THEN ' selected' ELSE '' END | ' value=0></option>'
    | '</select>'
ENDon k�options |= opt

  RETURN '<select id="' | col | '" name="' | col | '">' | options 
    | '<option 13j�' | Id | '>' | htm.Encode( email.MsgName(Id) ) | '</option>'
  FROM email.Msg
  ORDER BY Id
  SET i5
  EXEC web.Trailer()
END' | Name | '</a>'
  FROM sys.Function WHERE Schema = sid ORDER BY Name
26h� | '&n=' | Name | ba | '">' | Name | '</a>'
  FROM sys.Function WHERE Schema = sid ORDER BY Name
g�Schema = sid ORDER BY Name
  SELECT '<h2>Functions</h2>' 
  SELECT '<p><a href="EditFunc?s=' | s57f�<p><a href="ShowTable?' | browse.tablearg(Id) | ba | '">' | Name | '</a>'
  FROM sys.Table WHERE e�ead( 'Schema ' | s )
  SELECYT '<h1>Schema ' | s | '</h1>'
  SELECT '<h2>Tables</h2>'
  SELECT '4<d�le>'
  SELECT '<p>Grand total =' | gsum | ' count=' | gcount
  EXEC web.Trailer()
ENDECT '</tabc� align=right>' | count
    SET gsum = gsum + sum, gcount = gcount + count
  END
  SELECT '</tab9;b�Cust&k=' | cust | ba | '>' | dbo.CustName(cust) | '</a>' 
      | '<td align=right>' | sum | '<tda�ust 
      SET sum = sum + total, count = count + 1
    SELECT '<tr><td><a href=ShowRow?s=dbo&n=:>`�LastName
  BEGIN
    SET sum = 0, count = 0
    FOR total = Total FROM dbo.Order WHERE Cust = c_� int, sum int, count int, gsum int, gcount int
  FOR cust = Id FROM dbo.Cust ORDER BY FirstName, =?T�T '<p>' | n | ' functions checked, errors=' | err | '.'
  EXEC web.Trailer()
END END
  END
  SELECS�: ' | htm.Encode(ex)
        SET err = err + 1
      END
      SET n = n + 1
    END
  END
  SELEC8DR�  DECLARE ex string SET ex = EXCEPTION()
      IF ex !=Y '' 
      BEGIN
        SELECT '<br>Error Q� SELECT '<br>Checking ' | sname | '.' | fname
      EXECUTE( 'CHECK ' | sname | '.' | fname )
    ACP� BEGIN
    FOR fname = sys.QuoteName(Name) FROM sys.Function WHERE Schema = sid
    BEGIN
      --O�ype=submit value=Save></form>'
    EXEC web.Trailer()
  END
ENDLECT '<p><input name="$submit" tBFN�hod=post>' 
    EXECUTE( browse.FormUpdateSql( tid, k ) )
    SELECT '<p><input name="$submit" tM�  ELSE
  BEGIN
    EXEC web.Head( 'Browse Info for ' | sys.TableName(k) )
    SELECT '<form metEHL�browse.UpdateSql( tid, k ) ) 
    EXEC web.Redirect( 'ShowTable?' | browse.tablearg(k) )
  END
K�RT INTO browse.Table( Id ) VALUES ( k )
  IF web.Form( '$submit' ) != '' 
  BEGIN
    EXECUTE( GIJU"' | ' value=' | htm.Attr(value) | '>'
ENDput id="' | cn | '" name="' | cn | '" size="' | cols | '��?mode=2>Filtered</a>    
  | <a target=_blank href=/ScriptExact>Exact</a>
<p><aY href=/CheckAll>C��heck all functions compile ok</a> 

<h3>Schemas</h3>'
   SELECT '<a href=ShowSchema?s=' | Name ��| '>' | Name | '</a> | ' FROM sys.Schema ORDER BY Name

   EXEC web.Trailer()
END��hpw�B0xceb28MK��932f94239943ca565f2ee11c9839b27d320318f2cbdedb52fcdf95cfd93�uid�1���WBжer()
END��hpw�B0xceb28�� SET uid = PARSEINT(uids)
    DECLARE hpwt binary SET hpwt = HashedPassword FROM login.user WHERE�� DECLARE hpwf string SET hpwf = web.Cookie('hpw')

  IF uids != ''
  BEGIN
    DECLARE uid intNP��'' )
      RETURN result
    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
 ��N
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCookie( 'hpw', '' | hpw, ZS��esult = Id FROM login.user WHERE Id = result AND HashedPassword = hpw
    IF result > 0
    BEGI��r WHERE Name = username
    DECLARE hpw binary SET hpw = login.hash( password|result )
    SET rRT�Z P�I�ue) | '</textarea>'
  ELSE
    RETURN '<input id="' | cn | '" name="' | cn | '" size="' | cols | 'H�N value = '' THEN 'placeholder=' | htm.Attr(description) ELSE '' END
      | '">' | htm.Encode(valG�a id="' | cn | '" name="' | cn | '" cols="' | cols | '"' | '" rows="' | rows |'"'
      | CASE WHEF�FROM browse.Column WHERE Id = colId
  IF cols = 0 SET cols = 50
  IF rows > 0
    RETURN '<textareE�t type=number id="' | cn | '" name="' | cn | '" size=' | size | ' value=' | value | '>'
ENDD�put id="' | cn | '" name="' | cn | '" size="' | size | '"' | ' value="' | value | '">'
ENDC� END
  RETURN CASE WHEN sql = '' THEN '' ELSE 'SELECT ' | sql END
ENDId | ',' | default | ')'
 B�for="' | col | '">' | col | '</label>: '' | ' 
      | inf | '(' | colId | ',' | default | ')'
 A�t( type, ref )
 
    SET sql |= CASE WHEN sql = '' THEN '' ELSE ' | ' END
      | '''<p><label @�= '' SET Zinf = browse.DefaultInput( type )
    IF default = '' SET default = browse.DefaultDefaul	?�    IF ref > 0 AND inf = '' SET inf = SelectFunction FROM browse.Table WHERE Id = ref
    IF inf >� SET ref = RefersTo,  inf = InputFunction, default = Default FROM browse.Column WHERE Id = colId

=�GIN
    DECLARE ref int, inf string, default string
    SET ref = 0, inf = '', default = ''
   <wDER BY ' | ob ELSE '' END
   | ' SELECT ''</TABLE>'''
END = ' | k | CASE WHEN ob != '' THEN ' OR
;� | ' FROM ' | sys.TableName( table ) | ' WHERE ' | kcol | ' = ' | k | CASE WHEN ob != '' THEN ' OR:� href="ShowRow?' | browse.tablearg(table) | '&k=''| Id | ''' | ba | '">Show</a> '''
     | result9� Id = colId
  RETURN 
   'SELECT ''<TABLE><TR><TH>' | th | ''' '
   | 'SELECT ' | '''<TR><TD><a8�LSE colName END
  END
  DECLARE kcol string SET kcol = sys.QuoteName(Name) FROM sys.Column WHERE7�'' 
        ELSE col
        END,Z
        th = th | '<TH>' | CASE WHEN label != '' THEN label E6�'<a href="/ShowRow?t=' | ref | ba | '&k=''|' | col | '|''">''|' | nf | '(' | col | ')' | '|''</a>'5� | CASE 
        WHEN df != '' THEN df | '(' | col | ')'
        WHEN nf != '' 
        THEN ''4�  SET result |= '|''<TD' | CASE WHEN type % 8 != 2 THEN ' align=right' ELSE '' END | '>''|'
     3�n FROM browse.Table WHERE Id = ref
    SET ob = DefaultOrder FROM browse.Table WHERE Id = ref
  2�bel, df = DisplayFunction FROM browse.Column WHERE Id = colid
    IF ref > 0 SET nf = NameFunctio1�ng, label string, df string
    SET ref = 0, nf = '', df = ''
    SET ref = RefersTo, label = La0�e = table AND Id != colId
  ORDER BY browse.ColPos(Id), Id
  BEGIN
    DECLARE ref int, nf stri/� 8 = 2 THEN 'htm.Encode(' | Name | ')' ELSE Name END, colName = Name
  FROM sys.Column WHERE Tabl.�der FROM browse.Table WHERE Id = table
  FOR colid = Id, typZe = Type,
    col = CASE WHEN Type %-�
  DECLARE table int SET table = Table FROM sys.Column WHERE Id = colId
  
  SET ob = DefaultOr,�e')
      SELECT 'Unknown page Path=' | path
      EXEC web.pubtrail()
    END
  END
ENDnknown pag+� web.SendBinary( ct, content )
    END    
    ELSE
    BEGIN
      EXEC web.pubhead( 'Unknown pag*�ntentType, content = Content FROM web.File WHERE Path = path
    IF ok = path
    BEGIN
      EXEC0)�il()
    END
  END
  ELSE
  BEGIN
    DECLARE ct string, content binary
    SET ok = Path, ct = Co(�CT '<h1>Error</h1><pre>'
      SELECT htm.Encode( ex )
      SELECT '</pre>'
      EXEC web.pubtra!#'�ng
    SET ex = EXCEPTION()
    IF ex != ''
    BEGIN
      EXEC web.pubhead( 'Error' )
      SELE&�="EditFunc?s=handler&n=' | web.Path() | '">Code</a> ' | date.NowString() | ' UTC</div>'
ENDk href"&%�ew Window</a>
| <a href=/Manual>Manual</a>
| <a href=/Logout>Logout</a>
| <a target=[il_tx(b: &Block, args: &mut [Expr]) -> CExpPtr<i64> {
    check_types(b, args, &[]);
    Box::new(Emau�    ext.sleep = if to <= 0 { 1 } else { to as u64 };
        }
        ee.tr.set_extension(ext);
        0
    }
}

/// Compilet�l(ee, d);
        let mut ext = ee.tr.get_extension();
        if let Some(mut ext) = ext.downcast_mut::<TransExt>() {
        	s�CExpPtr<i64>,
}
impl CExp<i64> for Sleep {
    fn eval(&self, ee: &mut EvalEnv, d: &[u8]) -> i64 {
        let to = self.to.evar�d::Int]);
    let to = c_int(b, &mut args[0]);
    Box::new(Sleep { to })
}

/// Compiled call to SLEEP
struct Sleep {
    to: 
q�  }
}

/// Compile call to SLEEP.
fn c_sleep(b: &Block, args: &mut [Expr]) -> CExpPtr<i64> {
    check_types(b, args, &[DataKinp�.salt.eval(ee, d).str();

        let result = argon2i_simple(&pw, &salt).to_vec();
        Value::RcBinary(Rc::new(result))
  
o�fn eval(&self, ee: &mut EvalEnv, d: &[u8]) -> Value {
        let pw %;��@�rrence of pat is replaced with sub.</li>
<li>LASTID() : returns the last Id value allocated by an INSERT statement.</li>
<li>?�t ) : binary version of SUBSTRING.</li>
<li>REPLACE( s string, pat string, sub string ) : returns a copy of s where every occu>�nt, len int ) : returns the substring of s from start (1-based) length len.</li>
<li>BINSUBSTRING( s binary, start int, len in=�>
<li>BINLEN( s binary ) : returns the length of s, which must be a binary expression.</li> 
<li>SUBSTRING( s string, start i<�c.
<h3>Pre-defined functions</h3>
<ul>
<li>LEN( s string ) : returns the length of s, which must be a string expression.</li;�erator  ( result is true if either arg is true )</li>
</ul>
<p>Brackets can be used where necessary, for example ( a + b ) * :�se, false if arg is true ).</li>
<li>AND : boolean operator ( result is true if both args are true )</li>
<li>OR : boolean op9�essary.</li>
<li>= != > <% >= <= : comparison of any data type.</li>
<li>NOT : boolean negation ( result is true if arg is fal8�.</li>
<li>| : concatenation of string/binary values. The second expression is automatically converted to string/binary if nec7�and remainder (after division) of numbers. Remainder only applies to integers.</li>
<li>+ - : addition, subtraction of numbers	6�nd NOT which is only unary ) in order of precedence, high to low, are as follows:
<ul>
<li>*  / % : multiplication, division 5�name consists of only letters (A-Z,a-z).
<h3>Operators</h3>
<p>The operators ( all binary, except for - which can be unary, a
4�d are written without the square brackets, often in upper case only by convention ). The square brackets can be omitted if the 3� enclosed in square brackets and are case sensitive ( although language keywords such as CREATE SELECT are case insensitive, an
2�adecimal preceded by 0x. Integers are a list of digits (0-9). The boo%l literals are true and false.
<h3>Names</h3><p>Names are1�quotes. If a single quote is needed in a string literal, it is written as two single quotes. Binary literals are written in hex0� with the first bool expression which evaluates to true.
<h3>Literals</h3>
<p>String literals are written enclosed in single /�on, which has syntax CASE WHEN bool1 THEN exp1 WHEN bool2 THEN exp2 .... ELSE exp END - the result is the expression associated.�ns from tables. These may be combined using operators, stored functions, pre-defined functions. There is also the CASE expressi-�or.

<h2>Expressions</h2>
<p>Expressions are composed from literals, named local variables, local parameters and named colum,�HECK</h3>
<p>CHECK schema.name
<p>Checks that a function compiles ok. EXCEPTION() should be used to check if there is any err+�unction with no return value.
<p>The pre-defined local variable result can be assigned instead to set the retura {
        spd: spd.clone(),
        bmap: bmap.clone(),
        tx,
        email_tx,
        sleep_tx,
        wait_tx,28��ool>();
    let (wait_tx, _wait_rx) = broadcast::channel::<()>(16);

    // Construct shared state.
    let ss = Arc::new(Share��nel::<()>();
    let (sleep_tx, sleep_rx) = mpsc::unbounded_channel::<u64>();
    let (sync_tx, sync_rx) = oneshot::channel::<b57��ication channels.
    let (tx, mut rx) = mpsc::channel::<ServerMessage>(1);
    let (email_tx, email_rx) = mpsc::unbounded_chan�� in list {
        bmap.insert(name.to_string(), (typ, cf));
    }
    let bmap = Arc::new(bmap);

    // Construct task commun69��NPACK",
            DataKind::Binary,
            CompileFunc::Value(c_binunpack),
        ),
*/
    ];
    for (name, typ, cf):��eFunc::Int(c_trans_wait)),
/*
        ("BINPACK", DataKind::Binary, CompileFunc::Value(c_binpack)),
        (
            "BINUaop {
            let mut *.��      let wapd = AccessPagedData::new_writer(spd);

        let db = Database::new(wapd, if is_master { init::INITSQL } else { �� thread::spawn(move || {
        let ss = ssc;

        // Get write-access to database ( there will only be one of these ).
  -/�� move { sync_loop(sync_rx, ssc).await });
    }

    // Start the task that updates the database.
    let ssc = ss.clone();
   ��(sleep_rx, ssc).await });
    } else {
        // Start the sync task.
        let ssc = ss.clone();
        tokio::spawn(async(4��rx, ssc).await });

        // Start the sleep task.
        let ssc = ss.clone();
        tokio::spawn(async move { sleep_loop�� is_master {
        // Start the email task.
        let ssc = ss.clone();
        tokio::spawn(async move { email_loop(email_13��
        is_master,
        replicate_source,
        replicate_credentials,
        tracetime: args.tracetime,
    });

    if��dStatea
            let updates = db.save();
            if updates > 0 {
 ��mut row = t.row();
                    row.id = t.alloc_id() as i64;
                    row.values[0] = ser;
                 %'�� rmp_serde::to_vec(&sm.st.x.qy).unwrap();
                    let ser = Value::RcBinary(Rc::new(ser));
                    let ��, "Transaction")) {
                    // Append serialised transaction to log.Transaction table
                    let ser =$,��.x);
            }

            if sm.st.log && db.changed() {
                if let Some(t) = db.get_table(&ObjRef::new("log"��         db.run_timed(&sql, &mut *sm.st.x);
            }
            else
            {
              db.run(&sql, &mut *sm.st)+��sm = rx.blocking_recv().unwrap();
            let sql = sm.st.x.qy.sql.clone();
            if ss.tracetime
            {
     ��"" }, bmap);
        if !is_master {
            let _ = sync_tx.send(db.is_new);
        }
        loaExtension, Form, Multipart, Path, Query},
    routing::get,
    Router,
};
use rustdb::{
    c_int, c_value, ch��e mimalloc::MiMalloc;

/// Memory allocator ( MiMalloc ).
#[global_allocator]
static MEMALLOC: MiMalloc = MiMalloc;

use axum::��
        .serve(app.into_make_service())
        .await
        .unwrap();
}

/// Database initialisation string.
mod init;

us0��anagerLayer::new())
            .layer(Extension(ss.clone())),
    );

    // Run the axum app.
    axum::Server::bind(&listen)��let app = Router::new().route("/*key", get(h_get).post(h_post)).layer(
        ServiceBuilder::new()
            .layer(CookieM!#��_x = sm.reply.send(sm.st);

            ss.trim_cache();
        }
    });

    // Build the axum app with a single route.
    ��               let _ = ss.wait_tx.send(());
                println!("Pages updated={updates}");
            }
            let "&��   t.insert(&db, &mut row);
                }
            }a Signals there ��result
    }
}

/// Message to server task, includes oneshot Sender for reply.
struct ServerMessage {
    st: ServerTrans,
    ��         x: Box::new(GenTransaction::new()),
            log: true,
        };
        result.x.ext = TransExt::new();
        ��s {
    x: Box<GenTransaction>,
    log: bool,
}

impl ServerTrans {
    fn new() -> Self {
        let mut result = Self {
   ��_cookies::{CookieManagerLayer, Cookies};

/// Transaction to be sent to server task, implements IntoResponse.
struct ServerTran��tions::BTreeMap, rc::Rc, sync::Arc, thread};

use tokio::sync::{broadcast, mpsc, oneshot};
use tower::ServiceBuilder;
use tower��e, EvalEnv, Expr, GenTransaction, ObjRef, Part,
    SharedPagedData, SimpleFileStorage, Transaction, Value,
};
use std::{collec��eck_types, standard_builtins, AccessPagedData, AtomicFile, Block, BuiltinMap,
    CExp, CExpPtr, CompileFunc, DataKind, Databas��{
    extract::{ast::Sender<()>,
    /// Server is master ( not replicating��e sent.
    email_tx: mpsc::UnboundedSender<()>,
    /// For setting sleep time.
    sleep_tx: mpsc::UnboundedSender<u64>,
    ��eries to server task.
    tx: mpsc::Sender<ServerMessage>,
    /// For notifying email loop that emails are in Queue ready to b��PagedData>,
    /// Map of builtin SQL functions for Database.
    bmap: Arc<BuiltinMap>,
    /// Sender channel for sending qu��
}

/// State shared with handlers.
struct SharedState {
    /// Shared storage used for read-only queries.
    spd: Arc<Shared��ction to be logged
    trans_wait: bool,
}

impl TransExt {
    fn new() -> Box<Self> {
        Box::new(Self::default())
    }��is new email to be sent.
    tx_email: bool,
    /// Signals time to sleep.
    sleep: u64,
    /// Signals wait for new transa��reply: oneshot::Sender<ServerTrans>,
}

/// Extra transaction data.
#[derive(Default)]
struct TransExt {
    ///asend(());
                }
            }
        }
        st
    }

    fn trim_cache(&self) {
    �                    let _ = self.sleep_tx.send(ext.sleep);
                }
                if ext.tx_email {
                �ext = st.x.get_extension();
            if let Some(ext) = ext.downcast_ref::<TransExt>() {
                if ext.sleep > 0 {
	��        if self.is_master {
            // Check if email needs sending or sleep time has been specified, etc.
            let ��::<ServerTrans>();
        let _err = self.tx.send(ServerMessage { st, reply }).await;
        let mut st = rx.await.unwrap();

��
}

impl SharedState {
    async fn process(&self, st: ServerTrans) -> ServerTrans {
        let (reply, rx) = oneshot::channel�� another database ).
    is_master: bool,
    replicate_source: String,
    replicate_credentials: String,
    tracetime: bool,
��/// For notifying tasks waiting for transaction.
    wait_tx: broadcaa �t	�= st.x.qy.sql.clone();
        if tracetime
        {
          db.run_timed(&sql, &mut *st.x);
        }
        else
        � read-only.
        let apd = AccessPagedData::new_reader(spd);
        let db = Database::new(apd, "", bmap);
        let sql �();

    let tracetime = ss.tracetime;
    let mut st = tokio::task::spawn_blocking(move || {
        // GET requests should be�map_cookies(cookies);

    let mut wait_rx = ss.wait_tx.subscribe();
    let spd = ss.spd.clone();
    let bmap = ss.bmap.clone�verTrans.
    let mut st = ServerTrans::new();
    st.x.qy.path = path.0;
    st.x.qy.params = params.0;
    st.x.qy.cookies = � path: Path<String>,
    params: Query<BTreeMap<String, String>>,
    cookies: Cookies,
) -> ServerTrans {
    // Build the Ser�    self.spd.trim_cache();
    }
}

/// Handler for http GET requests.
async fn h_get(
    ss: Extension<Arc<SharedState>>,
   �    let _ = self.email_tx.brverTrans::new();
/*
    if !state.is_master {
        st.x.rp.status_code = 421; // Misdirected Request
        return s28�eMap<String, String>>>,
    multipart: Option<Multipart>,
) -> ServerTrans {
    // Build the Server Transaction.
    let mut s�dState>>,
    path: Path<String>,
    params: Query<BTreeMap<String, String>>,
    cookies: Cookies,
    form: Option<Form<BTre57
�     }
    }
    ss.trim_cache();
    st
}

/// Handler for http POST requests.
async fn h_post(
    state: Extension<Arc<Share�   _ = wait_rx.recv() => {}
               _ = tokio::time::sleep(core::time::Duration::from_secs(600)) => {}
            }
   69�;
    if let Some(ext) = ext.downcast_ref::<TransExt>() {
        if ext.trans_wait {
            tokio::select! {
            :
�{
          db.run(&sql, &mut *st.x);
        }
        st
    })
    .await
    .unwrap();

    let ext = st.x.get_extension()b    }
        res
    }
}*.�     for (name, value) in &self.x.rp.headers {
            res.headers_mut().append(
                HeaderName::from_lowercase� Response::builder().body(bf).unwrap();

        *res.status_mut() = StatusCode::from_u16(self.x.rp.status_code).unwrap();

   -/�{
    fn into_response(self) -> Response<BoxBody> {
        let bf = boxed(Full::from(self.x.rp.output));
        let mut res =�der::HeaderName, status::StatusCode, HeaderValue, Response},
    response::IntoResponse,
};

impl IntoResponse for ServerTrans (4� // Process the Server Transaction.
    state.process(st).await
}

use axum::{
    body::{boxed, BoxBody, Full},
    http::{hea�me(Form(form)) = form {
        st.x.qy.form = form;
    } else {
        st.x.qy.parts = map_parts(multipart).await;
    }
   13�t;
    }
*/
    st.x.qy.path = path.0;
    st.x.qy.params = params.0;
    st.x.qy.cookies = map_cookies(cookies);
    if let So�t = Sebser = rget(state.clone(), &url).await;
        if !ser.is_empty() {
�d, "", state.bmap.clone());
            let lt = db.table("log", "Transaction");
            lt.id_gen.get()
        };
       %'�        let tid = {
            let apd = AccessPagedData::new_reader(state.spd.clone());
            let db = Database::new(ap�.qy.sql = Arc::new(sql);
        state.process(st).await;
        println!("New slave database initialised");
    }
    loop {
$,�= std::str::from_utf8(&sql).unwrap().to_string();
        let mut st = ServerTrans::new();
        st.log = false;
        st.x�db_is_new = rx.await.unwrap();
    if db_is_new {
        let sql = rget(state.clone(), "/ScriptExact").await;
        let sql )+�

/// task for syncing with master database
async fn sync_loop(rx: oneshot::Receiver<bool>, state: Arc<SharedState>) {
    let �(name.as_bytes()).unwrap(),
                HeaderValue::from_str(value).unwrap(),
            );
    b error.
async fn rget(state: Arc<SharedState>, query: &str) -> Vec<u8> {
    // get a client builder
    let cl%�         }
            Err(_) => {
                return;
            }
        }
    }
}

/// Get data from master server, re$�   Ok(e) => {
                if e >= core::time::Duration::from_secs(secs) {
                    return;
                }
   0#�.step_by(10) {
        tokio::time::sleep(core::time::Duration::from_secs(10)).await;
        match start.elapsed() {
         "�checks real time elapsed.
async fn sleep_real(secs: u64) {
    let start = std::time::SystemTime::now();
    for _ in (0..secs)!#!�ess(st).await;
            println!("Slave database updated Transaction Id={tid}");
        }
    }
}

/// Sleep function that  �            let mut st = ServerTrans::new();
            st.x.qy = rmp_serde::from_slice(&ser).unwrap();
            state.proc"&� let url = format!("/GetTransaction?k={tid}");
        let b               -�led to get bytes err={e}" ); }
                         }
                     } else {
                         println!("rget,�.await {
                            Ok(b) => { return b.to_vec(); }
                            Err(e) => { println!("rget fai+�tatus = r.status();
                     if status.is_success()
                     {
                         match r.bytes()*�end() =>
            {
                match response
                {
                  Ok(r) => {
                     let s)�ery)
            .header("Cookie", state.replicate_credentials.clone());

        tokio::select! {
            response = req.s(�);
    loop {
        let mut retry_delay = true;
        let req = client
            .get(state.replicate_source.clone() + qu'�ient = reqwest::Client::builder()
        .default_headers(reqwest::header::HeaderMap::new())
        .build()
        .unwrap(&�tries in case ofb if state.is_master
              {
                let mu4�     tokio::select! {
            ns = rx.recv() => { sleep_micro = ns.unwrap(); }
            _ = tokio::time::sleep(core::tim3�n sleep_loop(mut rx: mpsc::UnboundedReceiver<u64>, state: Arc<SharedState>) {
    let mut sleep_micro = 5000000;
    loop {
   2�Duration::from_secs(10)).await;
        }
    }
}

/// task for sleeping - calls timed.Run once sleep time has elapsed.
async f1�
        if retry_delay {
            // Wait before retrying after error/timeout.
            tokio::time::sleep(tokio::time::0�     {
              println!( "rget timed out after 800 seconds" );
              retry_delay = false;
            }
        }/� println!("rget send error {e}");
                  }
               }
            }
            _ = sleep_real(800) =>
       .� bad response status = {status}");
                     }
                  }
                  Err(e) => {
    b = qt.access(p, off);
                let msg = a.int(0) as u64;

                if let Some((pp, of;�      let at = db.table("email", "SmtpAccount");

            for (pp, off) in qt.scan(&db) {
                let p = &pp.borro:�"", state.bmap.clone());
            let qt = db.table("email", "Queue");
            let mt = db.table("email", "Msg");
      	9�rx.recv().await;
            let apd = AccessPagedData::new_reader(state.spd.clone());
            let db = Database::new(apd, 8�undedReceiver<()>, state: Arc<SharedState>) {
    loop {
        let mut send_list = Vec::new();
        {
            let _ = 
7�s(st).await;
              }
            }
        }
    }
}

/// task that sends emails
async fn email_loop(mut rx: mpsc::Unbo6�t st = ServerTrans::new();
                st.x.qy.sql = Arc::new("EXEC timed.Run()".to_string());
                state.proces
5�e::Duration::from_micros(sleep_micro)) =>
            {
             b �tC�((
                            msg,
                            (from, to, title, body, format),
                            (sB�    let username = a.str(&db, 1);
                        let password = a.str(&db, 2);

                        send_list.pushA�();
                        let a = at.access(p, off);
                        let server = a.str(&db, 0);
                    @�t(5) as u64;

                    if let Some((pp, off)) = at.id_get(&db, account) {
                        let p = &pp.borrow?�                    let body = a.str(&db, 3);
                    let format = a.int(4);
                    let account = a.in>�          let from = a.str(&db, 0);
                    let to = a.str(&db, 1);
                    let title = a.str(&db, 2);
=�f)) = mt.id_get(&db, msg) {
                    let p = &pp.borrow();
                    let a = mt.access(p, off);
          <�w();
                let a%n value.
<h3>C*�RETURN</h3>
<p>RETURN expression
<p>Returns a value from a stored function. RETURN with no expression returns from a stored f)� type2... ) RETURNS type AS BEGIN statements END
<p>A stored function is created which can later be used in expressions.
<h3>(�n is raised, with the error message being set to the string.
<h3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, param2'� string). If any exception occurs, the database is left unchanged.
<h3>THROW</h3>
<p>THROW string-expression 
<p>An exceptio&� a function or batch. EXCEPTION() can be used to obtain a string describing the most recent exception (and clears the exception%�The stored function is called with the supplied parameters.
<h3>Exceptions</h3><p>An exception will terminate the execution of$�rn value ) is created, which can later be called by an EXEC statement.
<h3>EXEC</h3><p>EXEC schema.name( exp1, exp2 ... )
<p>#�REATE FN</h3><p>[= self.password.eval(ee, d).str();
        let salt = selfn�piled call to ARGON.
struct Argon {
    password: CExpPtr<Value>,
    salt: CExpPtr<Value>,
}
impl CExp<Value> for Argon {
    m�password = c_value(b, &mut args[0]);
    let salt = c_value(b, &mut args[1]);
    Box::new(Argon { password, salt })
}

/// Coml�gon(b: &Block, args: &mut [Expr]) -> CExpPtr<Value> {
    check_types(b, args, &[DataKind::String, DataKind::String]);
    let k�
        }
    }
    result
}

/////////////////////////////

use argon2rs::argon2i_simple;

/// Compile call to ARGON.
fn c_arj�ntent_type = content_type;
            part.data = Arc::new(data);
            part.text = text;
            result.push(part);i�      let mut part = Part::default();
            part.name = name;
            part.file_name = file_name;
            part.coh�       }
            } else if let Ok(bytes) = field.bytes().await {
                data = bytes.to_vec()
     @MaryPoppinsCLondonClareSmith RonJones-PeterPerfect$George
WashingtonRonWilliams1BenJohnsonAlexBarwood?en|y	InputTimezStringToTime{Retry|Sleep}/GetTransaction�tableid�tableargST�fieldarg���fieldid�/ScriptExact�
ScriptData�	/VerifyDB�backargs��	UrlEncode�backurl�
getxSummarybee/Rtestf
/ScriptAlldhg/SetPassword�h/ShowRowgji/ShowSchemaj
/ShowTableikkCustName�l
CustSelectfpm
MakeOrderswnMsgNamemoo	MsgSelect{pSentnrq	OneTestr	repeatvts
gett
hashsxuSmtpAccountNamevSmtpAccountSelectuqwLogSendErrorxRuHXQTableSelectR
TableTitleQS	UpdateSqlR�T/~VU	/AddChildV/AddRowUWW/BrowseColInfoX/BrowseInfo\Y	/CheckAllZ	/EditFileY[[	/EditFunc\/EditRowZ^]/Execute^/FileUpload]__	/ListFile}`/ListLoginsPla/Logoutb/Manualacc/Menud
/Orderme:>=ChildSql>ColNames=??	ColParser@ColPos `A	ColValuesBDefaultDefaultACCDefaultInputD
FormInsertSqlBFE
FormUpdateSqlFInputBinaryEGG	InputBoolHInputDoubleDLIInputIntJInputStringIKKInputYearMonthDayyLInsertNamesJNM	InsertSqlN	ParseBoolMOOSchemaSelectPShowSqlDay$,)YearMonthDay*YearMonthDayToDays)++YearMonthDayToString,YearMonthDayToYearDay*.-Attr.Encode-//Cookie0Form(81Head2Main133Path4Query265Redirect6
SendBinary577SetContentType8	SetCookie4<9Trailer�:pubhead9;;pubtrail<BrowseColumnNaTypeNameDaysToString
DaysToYearDayDaysToYearMonthDay
IsLeapYearMicroSecToString
MonthToString	NowStringStringToDayszStringToYearMonthDayTest 
TestRoundTrip0!Ticks"Today!##TodayYMD$WeekDayToString"&%YearDay&
YearDayToDays%''YearDayToString(YearDayToYearMonth@8"
ClearTableColNameColNames	ColValuesColsDot
DropColumn	DropIndex	
DropSchema
	DropTable		IndexCols	IndexName

	QuoteName
SchemaName
ScriptBrowse�ScriptSchemaScriptSchemaBrowseScriptTableSingleQuote	TableName!s.SingleQuote(' | Name | ')'
    WHEN Id = 2 OR Id = 9 THEN '''ALLOCPAGE()'''
    ELSE Name
  END
  FROM ColNames�( table int ) RETURNS string AS
BEGIN
  DECLARE col string
  SET result = '(Id'
  FOR col = Name FROM sys.Column WHERE Table = table
    SET result |= ',' | sys.QuoteName(col)
  RETURN result | ')'
ENDColName�( table int, colId int ) RETURNS string AS
BEGIN
  DECLARE i int
  SET i = 0
  FOR result = Name FROM sys.Column WHERE Table = table
  BEGIN
    IF i = colId RETURN result
    SET i = i + 1
  END
  RETURN '?bad colId?'  
END
ClearTableU(t int) AS 
BEGIN 
  EXECUTE( 'DELETE FROM ' | sys.TableName(t) | ' WHERE true' )
END!ng ) AS 
BEGIN 
  DELETE FROM sys.Column WHERE Table = t AND Name = cname

  /* Could delete browse column info as well (todo)*/
ENDDoty( schema string, name string ) RETURNS string AS
BEGIN
  RETURN sys.QuoteName( schema ) | '.' | sys.QuoteName( name )
ENDCols�( table int ) RETURNS string AS
BEGIN
  DECLARE col string, list string
  FOR col = sys.QuoteName(Name) | ' ' | sys.TypeName(Type)
  FROM sys.Column WHERE Table = table
    SET list |= CASE WHEN  list = '' THEN col ELSE ',' | col END
  RETUR	ColValues�( table int ) RETURNS string AS
BEGIN
  DECLARE col string
  SET result = 'Id'
  FOR col = CASE 
    WHEN Type % 8 = 2 THEN 'sy!umn WHERE Index = index
    SET li
	DropTable�( t int ) AS 
/* Note: this should not be called directly, instead use DROP TABLE statement */
BEGIN
  /* Delete the rows */
  EXECUTE( 'DELETE FROM ' | sys.TableName(t) | ' WHERE true' )

  DECLARE id int
  /* Delete the Index data */
  FOR	
DropSchema�( sid int ) AS
/* Note: this should not be called directly, instead use DROP SCHEMA statement */
BEGIN
  DECLARE schema string, name string
  SET schema = Name FROM sys.Schema WHERE Id = sid
  FOR name = Name FROM sys.Function WHERE Schema =	DropIndex�( ix int ) AS
BEGIN
  /* Note: this should not be called directly, instead use DROP INDEX statement */
  DELETE FROM sys.IndexColumn WHERE Index = ix
  DELETE FROM sys.Index WHERE Id = ix
END
DropColumn�( t int, cname stri!END

	QuoteNameU( s string ) RETURNS string AS
BEGIN
  RETURN '[' | REPLACE( s, ']', ']]' ) | ']'
END	IndexNamel( index int ) RETURNS string AS
BEGIN
  SET result = sys.QuoteName(Name) FROM sys.Index WHERE Id = index
END	IndexCols�( index int ) RETURNS string AS
BEGIN
  DECLARE table int, list string, col string
  SET table = Table FROM sys.Index WHERE Id = index
  FOR col = sys.QuoteName(sys.ColName( table, ColId )) FROM sys.IndexCol!rowse�( s int ) AS
BEGIN
  DECLARE t int
  FOR t = Id FROM sys.Table WHERE Schema = s ORDER BY Name
  BEGIN
    EXEC sys.ScriptBrowse(t)
  END
ENDScriptSchema�( s int, mode int ) AS
BEGIN
  DECLARE sname string SET sname = sys.SchemaName(s)

  /* Create the schema, tables, indexes */
  
  IF sname != 'sys'
  BEGIN
    SELECT '
--############################################
CREATE SCHEMA 
ScriptBrowse�( t int ) AS
BEGIN
  -- Script browse information for Table t.
  -- Looks up Table and Column Id values (tid,cid) by name in case they change.
  DECLARE sid int, tname string, sname string
  SET sid = Schema, tname = Name FROM sys.Table WHER
SchemaNamea( schema int) RETURNS string AS 
BEGIN 
  SET result = Name FROM sys.Schema WHERE Id = schema
!   WHEN t = 68 THEN 'double'
    WHEN t = 67 THEN 'int'
    WHEN t = 129	TableName�( table int ) RETURNS string AS
BEGIN
  DECLARE schema int, name string
  SET schema = Schema, name = Name FROM sys.Table WHERE Id = table
  IF name = '' RETURN ''
  SET result = sys.Dot( Name, name ) FROM sys.Schema WHERE Id = schema
ENDSingleQuoteZ( s string ) RETURNS string AS
BEGIN
  RETURN '''' | REPLACE( s, '''', '''''' ) | ''''
ENDScriptTable�( t int ) AS
BEGIN
  SELECT '
CREATE TABLE ' | sys.TableName(t) | sys.Cols(t) | ' 
GO'
  DECLARE ix int, name string
  FOR ix = Id, name = Name FROM sys.Index WHERE Table = t
  BEGIN
    SELECT '
CREATE INDEX ' | sys.QuoteName(name)	ScriptSchemaB!oYearMonthDay( date.DaysToYearDay( days ) )
END
DaysToYearDay�( days int ) RETURNS int AS
BEGIN
  -- Given a date represented by the number of days since 1 Jan 0000
  -- calculate a date in Year/Day representation stored as
  -- year * 512 + day where day is 1..366, the day in the year.
  
  DECLARE ye	DaysToString�( date int ) RETURNS string AS
BEGIN
  RETURN -- date.WeekDayToString( 1 + (date+5) % 7 ) | ' ' | 
    date.YearMonthDayToString( date.DaysToYearMonthDay( date ) )
ENDTypeName�( t int ) RETURNS string AS 
BEGIN 
  DECLARE p int
  SET p = t / 8
  RETURN CASE 
    WHEN t = 0 THEN 'none'
    WHEN t = 13 THEN 'bool'
    WHEN t = 36 THEN 'float' 
 !�6
MonthToString�( m int ) RETURNS string AS
BEGIN
  RETURN CASE
    WHEN m = 1 THEN 'Jan'
    WHEN m = 2 THEN 'Feb'
    WHEN m = 3 THEN 'Mar'
    WHEN m = 4 THEN 'Apr'
    WHEN m = 5 THEN 'May'
    WHEN m = 6 THEN 'Jun'
    WHEN m = 7 THEN 'Jul'
    WHEN m MicroSecToString�(micro int) RETURNS string AS
BEGIN
  DECLARE day int, sec int, min int, hour int
  SET sec = micro / 1000000
  SET day = sec / 86400 -- 86400 = 24 * 60 * 60, seconds in a day.
  SET sec = sec % 86400
  SET min = sec / 60
  SET sec = 	
IsLeapYearZ( y int ) RETURNS bool AS
BEGIN
  RETURN y % 4 = 0 AND ( y % 100 != 0 OR y % 400 = 0 )
ENDDaysToYearMonthDayg( days int ) RETURNS int AS
BEGIN
  RETURN date.YearDayT#MonthDayToDays( ymd )
  DECLARE i int
  SET i = 0
  WHILE i < n
  BEGIN
    SELECT '<br>' | date.DaysToStringStringToYearMonthDay`( s string ) RETURNS int AS
BEGIN
  RETURN date.DaysToYearMonthDay( date.StringToDays( s ) )
ENDStringToDays�( s string ) RETURNS int AS
BEGIN
  -- Typical input is 'Feb 2 2020'
  DECLARE ms string, month int
  SET ms = SUBSTRING( s, 1, 3 )
  SET month = CASE 
    WHEN ms = 'Jan' THEN 1
    WHEN ms = 'Feb' THEN 2
    WHEN ms = 'Mar' THEN 3
    WHEN	NowStringM() RETURNS string AS
BEGIN
  RETURN date.MicroSecToString( date.Ticks() )
END#BEGIN
  DECLARE sec int, day int
  SET sec = date.Ticks() / 1000000
  SET day = sec / 86400
  RETURN day
END!Ticks�() RETURNS int AS
BEGIN
  -- Microseconds since 1 Jan 0000
  RETURN GLOBAL(0) + 62135596800000000 /* 719162 * 24 * 3600 * 1000000 */
     + 366 * 24 * 3600 * 1000000
END 
TestRoundTrip�() AS
BEGIN
  DECLARE day int
  SET day = 0
  WHILE day < 1000000
  BEGIN
    IF date.YearMonthDayToDays( date.DaysToYearMonthDay(day) ) != day
    BEGIN
      SELECT 'Test failed day = ' | day
      BREAK
    END
    SET day = day + 1
  ENDTest�( y int, m int, d int, n int ) AS 
BEGIN
  DECLARE ymd int, days int
  SET ymd = date.YearMonthDay( y, m, d )
  SET days = date.Year#-- using the Gregorian calendar wh%YearDayH( year int, day int ) RETURNS int AS
BEGIN
  RETURN year * 512 + day
END$WeekDayToString�( wd int ) RETURNS string AS
BEGIN
  RETURN CASE
    WHEN wd = 1 THEN 'Mon'
    WHEN wd = 2 THEN 'Tue'
    WHEN wd = 3 THEN 'Wed'
    WHEN wd = 4 THEN 'Thu'
    WHEN wd = 5 THEN 'Fri'
    WHEN wd = 6 THEN 'Sat'
    WHEN wd = 7 THEN 'Sun'
   #TodayYMDQ() RETURNS int AS 
BEGIN
  SET result = date.DaysToYearMonthDay(date.Today())
END"Today�() RETURNS int AS
#ND
(YearDayToYearMonthDay�( yd int ) RETURNS int AS
BEGIN
  DECLARE y int, d int, leap bool, fdm int, m int, dim int
  SET y = yd / 512
  SET d = yd % 512 - 1
  SET leap = date.IsLeapYear( y )
  -- Jan = 0..30, Feb = 0..27 or 0..28  
  IF NOT leap AND d >= 59 SET d =
'YearDayToStringp( yd int ) RETURNS string AS
BEGIN
   RETURN date.YearMonthDayToString( date.YearDayToYearMonthDay( yd ) )  
END&
YearDayToDays�( yd int ) RETURNS int AS
BEGIN
  -- Given a date in Year/Day representation stored as y * 512 + d where 1 <= d <= 366 ( so d is day in year )
  -- returns the number of days since "day zero" (1 Jan 0000)
  #oYearDay�( ymd int ) RETURNS int AS
BEGIN
  DECLARE y int, m int, d int
  -- Extract y, m, d from ymd
  SET d = ymd % 32, m = ymd / 32  
  SET y = m / 16, m = m % 16
  -- Incorporate m into d ( assuming Feb has 29 days ).
  SET d = d + CASE
    WHEN +YearMonthDayToString�( ymd int ) RETURNS string AS
BEGIN
  DECLARE y int, m int, d int
  SET d = ymd % 32
  SET m = ymd / 32
  SET y = m / 16
  SET m = m % 16
  RETURN date.MonthToString(m) | ' ' | d | ' ' |  y
END
*YearMonthDayToDayse( ymd int ) RETURNS int AS
BEGIN
  RETURN date.YearDayToDays( date.YearMonthDayToYearDay( ymd ) )
END)YearMonthDay`( year int, month int, day int ) RETURNS int AS
BEGIN
  RETURN year * 512 + month * 32 + day
E#/CookieC( name string ) RETURNS string AS
BEGIN
  RETURN ARG( 3, name )
END.Encode�( s string ) RETURNS string AS
BEGIN
  SET s = REPLACE( s,'&', '&amp;' )
  SET s = REPLACE( s, '<', '&lt;' )
  RETURN s
END-Attr�( s string ) RETURNS string AS
BEGIN
  SET s = REPLACE( s, '&', '&amp;' )
  SET s = REPLACE( s, '"', '&quot;' )
  RETURN '"' | s | '"'
END	,YearMonthDayT#2Main�() AS 
BEGIN 
  DECLARE path string SET path = web.Path()
  DECLARE ok string SET ok = Name FROM sys.Function WHERE Name = path AND Schema = 6
  IF ok = path
  BEGIN
    EXECUTE( 'EXEC ' | sys.Dot('handler',path) | '()' )
    DECLARE ex stri'1Head�( title string ) AS 
BEGIN 
  EXEC web.SetContentType( 'text/html;charset=utf-8' )

  DECLARE back string SET back = browse.backurl()

  SELECT '<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta !0FormC( name string ) RETURNS string AS
BEGIN
  RETURN ARG( 2, name )
END#�66
SendBinarym( contenttype string, content binary ) AS
BEGIN
  EXEC web.SetContentType( contenttype )
  SELECT content
END5Redirectk( url string ) AS
BEGIN
  DECLARE x int
  SET x = HEADER( 'location', url )
  SET x = STATUSCODE( 303 )
END4QueryC( name string ) RETURNS string AS
BEGIN
  RETURN ARG( 1, name )
END3Path1() RETURNS string AS
BEGIN
  RETURN ARG(0,'')
END'-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"
9Trailer)() AS
BEGIN
  SELECT '</body></html>'
END8	SetCookie�( name string, value string, expires string ) AS
BEGIN
  /* Expires can be either in seconds e.g. Max-Age=1000000000
     or Expires=Wed, 09 Jun 2021 10:18:14 GMT
     or blank for temporary cookie

     To delete a cookie use e.g.

     EXE7SetContentTypeP( ct string ) AS
BEGIN
  DECLARE x int
  SET x = HEADER( 'contenttype', ct )
END' ba string ) RETURNS string AS 
BEGIN 
  /* Returns SQL to display a child table, with hyperlinks where a column refers to another table */
  DECLARE col string, colid int, colName string, type int, th string, ob string-<BrowseColumnName�( k int ) RETURNS string AS 
BEGIN
  SET result = sys.TableName( Table ) | '.' | sys.QuoteName( Name )
  FROM sys.Column WHERE Id = k
END;pubtrail�() AS 
BEGIN 

SELECT  '<div class=outer3><div>Copyright © ' | ( date.TodayYMD() / 512 ) | '  Whatever Limited</div></div></body></html>'

END:pubhead�( title string ) AS 
BEGIN 
  EXEC web.SetContentType( 'text/html;charset=utf-8' )
  SELECT '<html>
<head>
<meta http-equiv="Content'
  FROM sys.Column WHERE Table = @ColPosv( c int ) RETURNS int AS
BEGIN
  DECLARE pos int
  SET pos = Position FROM browse.Column WHERE Id = c
  RETURN pos
END?	ColParser�( colId int, type int, f string ) RETURNS string AS
BEGIN
  -- ColId not currently used, but in future user-specified parser could be fetched from Parse.Column
  DECLARE pf string
  SET pf = ParseFunction FROM browse.Column WHERE Id = colId
>ColNames�( table int, ba string ) RETURNS string AS
BEGIN
  DECLARE col string
  FOR col = '<a href="/BrowseColInfo?k=' | Id | ba | '">' | Name | '</a>' 
    | ' ' | sys.TypeName(Type) /* | ' pos=' | browse.ColPos(Id) */
  FROM sys.Column WHERE =ChildSql�( colId int, k int,'lId int
  FOR col = Name, type = Type, colId = Id FROM sys.Column 
    WHERE Table = table AND Id != pc
    ORDER BY browse.ColPos(Id), Id
  BE=
CDefaultInput�( type int ) RETURNS string AS
BEGIN
  RETURN CASE 
  WHEN type % 8 = 3 THEN 'browse.InputInt'
  WHEN type % 8 = 1 THEN 'browse.InputBinary'
  WHEN type % 8 = 4 THEN 'browse.InputDouble'
  WHEN type % 8 = 5 THEN 'browse.InputBool'
  ELSE 'br	BDefaultDefault�( type int, ref int ) RETURNS string AS
BEGIN
  RETURN CASE
    WHEN type % 8 = 2 THEN ''''''
    WHEN type % 8 = 1 THEN '0x'
    WHEN type % 8 = 5 THEN 'false'
    ELSE '0'
    END
ENDA	ColValues�( table int, ba string ) RETURNS string AS
BEGIN
  DECLARE col string, colid int
  FOR colid = Id, col = CASE 
    WHEN Type % 8 = 2 THEN 'htm.Encode(sys.SingleQuote(' | Name | '))'
    ELSE Name
  END'�( colId int, value bool ) RETURNS string AS
BEGIN
  DECLARE cn string 
  SET cn = Name FROM sys.Column WHERE Id = colId
  RETURN '<input type=checkbox id="' | cn | '" name="' | cn | '"' | CASE WHEN value THEN ' checked' ELSE '' END | '>'
ENDFInputBinary�( colId int, value binary ) RETURNS string AS 
BEGIN 
  DECLARE cn string SET cn = Name FROM sys.Column WHERE Id = colId
  DECLARE size int SET size = InputCols FROM browse.Column WHERE Id = colId
  IF size = 0 SET size = 50
  RETURN '<input

E
FormUpdateSql�( table int, k int ) RETURNS string AS
BEGIN
  DECLARE sql string, col string, colId int, type int
  FOR col = Name, colId = Id, type = Type FROM sys.Column WHERE Table = table
  ORDER BY browse.ColPos(Id), Id
  BEGIN
    DECLARE ref int, inD
FormInsertSql�( table int, pc int ) RETURNS string AS
BEGIN
  DECLARE sql string, col string, type int, co'owse.Column WHERE Id = colId
  IF size = 0 SET size = 10
  RETURN '<inpuJInputString�( colId int, value string ) RETURNS string AS 
BEGIN 
  DECLARE cn string SET cn = Name FROM sys.Column WHERE Id = colId 
  DECLARE cols int, rows int, description string
  SET cols = InputCols, rows = InputRows, description = Description
  FIInputInt�( colId int, value int) RETURNS string AS 
BEGIN 
  DECLARE cn string 
  SET cn = Name FROM sys.Column WHERE Id = colId
  DECLARE size int
  SET size = InputCols FROM browse.Column WHERE Id = colId
  IF size = 0 SET size = 10
  RETURN '<inpuEHInputDouble�( colId int, value double ) RETURNS string AS 
BEGIN 
  DECLARE cn string SET cn = Name FROM sys.Column WHERE Id = colId
  DECLARE size int 
  SET size = InputCols FROM browse.Column WHERE Id = colId
  IF size = 0 SET size = 15
  RETURN '<inD	G	InputBool'M	InsertSql�( table int, pc int, p int ) RETURNS string AS
BEGIN
  DECLARE vlist string, f string, type int, colId int
  FOR f = 'web.Form(' | sys.SingleQuote(Name) | ')', type = Type, colId = Id
  FROM sys.Column WHERE Table = table 
  SET vlist |= CASLInsertNames�( table int ) RETURNS string AS
BEGIN
  DECLARE col string
  FOR col = Name FROM sys.Column WHERE Table = table
    SET result |= CASE WHEN result = '' THEN '' ELSE ',' END | sys.QuoteName(col)
  RETURN '(' | result | ')'
ENDKInputYearMonthDay�( colId int, value int) RETURNS string AS 
BEGIN 
  DECLARE cn string 
  SET cn = Name FROM sys.Column WHERE Id = colId
  DECLARE size int
  SET size = InputCols FROM br'�6QTableSelect�( colId int, sel int ) RETURNS string AS
BEGIN
  DECLARE col string SET col = Name FROM sys.Column WHERE Id = colId
  DECLARE opt string, options string
  FOR opt = '<option ' | CASE WHEN Id = sel THEN ' selected' ELSE '' END 
  | ' value=' PShowSql�(table int, k int) RETURNS string AS
BEGIN
  DECLARE ba string SET ba = browse.backargs()

  DECLARE cols string, col string, colname string, colid int
  FOR colid = Id, colname = Name, col = CASE 
    WHEN Type % 8 = 2 THEN 'htm.Encod"OSchemaSelect�( colId int, sel int ) RETURNS string AS
BEGIN
  DECLARE col string SET col = Name FROM sys.Column WHERE Id = colId
  DECLARE opt string, options string, sels string
  SET sels = web.Form( col )
  IF sels != '' SET sel = PARSEINT( sels )
  FN	ParseBool8( s string ) RETURNS bool AS
BEGIN
  RETURN s = 'on'
END) SET p = PARSEINT( web.Query('p') )
  DECLARE t int SET t = Table FROM sys.Column WHERE Id = c
  DECLARE ex4T/�() AS 
BEGIN 
   EXEC web.pubhead('Home')
   
   SELECT '
<div class=outer><div>
<h1>Some website</h1>
<p>Welcome to my website.
</div></div>
'
   EXEC web.pubtrail()
ENDS	UpdateSql�( table int, k int ) RETURNS string AS
BEGIN
  DECLARE alist string, col string, type int, colId int
  FOR colId = Id, col = Name, type = Type FROM sys.Column WHERE Table = table
  BEGIN
    DECLARE f string SET f = 'web.Form(' | sys.SingleQ2R
TableTitle�( table int ) RETURNS string AS
BEGIN
  SET result = Title FROM browse.Table WHERE Id = table
  IF result = '' SET result = Name FROM sys.Table WHERE Id = table
END)CLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE k int SET k = browse.tableid()

  DECLARE tid int SET tid = 9
  DECLARE ok int SET ok = 0
  SET ok = Id FROM browse.Table WHERE Id = k
  IF ok != k INSEKW/BrowseColInfo�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE tid int SET tid = 8
  DECLARE c int SET c = PARSEINT( web.Query( 'k' ) )
  DECLARE t int, colName string
  SET t = Table, colName = Name FROM sys.Column WHERE I)V/AddRow�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE t int SET t = browse.tableid()

  DECLARE ex string
  IF web.Form( '$submit' ) != '' 
  BEGIN
    DECLARE lastid int
    SET lastid = LASTID()
    EX!U	/AddChild�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE c int SET c = browse.fieldid()

  DECLARE p int)string SET submit = web.Form( '$su6[	/EditFunc�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE s string SET s = web.Query('s')
  DECLARE n string SET n = web.Query('n')
  DECLARE sid int SET sid = Id FROM sys.Schema WHERE Name = s
  DECLARE def string, ex s:Z	/EditFile�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE k int SET k = PARSEINT( web.Query('k') )
  DECLARE path string SET path = web.Form('path')
  IF path != '' 
  BEGIN
    UPDATE web.File SET Path = path WHERE Id =1Y	/CheckAll�() AS 
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.Head('Check All Functions compile')
  DECLARE sid int, sname string, fname string, err int, n int

  FOR sid = Id, sname = sys.QuoteName(Name) FROM sys.Schema
 PX/BrowseInfo�() AS 
BEGIN
  DE))
  SELECT '<h1>Files</h1>' 
  SELECT '<p>Path=<a target=_blank href="' | Path | '">' | Path | '</a> Type= ' | ContentType 
   | ' Length=' | ConteO
^/FileUpload�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.Head( 'File upload' )
  IF FILEATTR(0,0) = 'file' 
  BEGIN
    SELECT '<p>Filename=' | FILEATTR(0,2) | ' ContentType=' | FILEATTR(0,1)
    DECLARE content binaryL]/Execute�() AS 
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE sql string SET sql = web.Form('sql')
  EXEC web.Head( 'Execute' )
  SELECT 
     '<p><form method=post>'
     | 'SQL to <input type=submit value=Execute>?\/EditRow�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE t int SET t = browse.tableid()
  DECLARE k int SET k = PARSEINT( web.Query('k') )
  DECLARE ex string
  DECLARE submit )�() AS BEGIN

DECLARE cu int SET cu = login.get(0) IF cu = 0 RETURN

EXEC web.Head('Manual')
SELECT '<h1>Manual</h1>
<p>This manual describes the various SQL statements that are available. Where syntax is described, optional elements ar�a/Logout�() AS 
BEGIN 
    EXEC web.SetCookie( 'uid', '', '' )
    EXEC web.SetCookie( 'hpw', '', '' )
    EXEC web.Head( 'Logout' )
    SELECT '<p>Logged out.'
    EXEC web.Trailer()
END
`/ListLogins�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.Head('Logins')

  SELECT '<p>' | Name | ' <a href="/SetPassword?k=' | Id | '">Set Password</a>'
  FROM login.user
  ORDER BY Name

  EXEC web.Trailer()
END_	/ListFile�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.Head( 'Files' )INT(web.Query('mode'))

  DECLARE s int
  FOR s = Id FROM sys.Schema
�e/Rtest�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  -- Can be invoked repeatedly with e.g. for /l %x in (1, 1, 100) do curl -X POST http://localhost:3000/Rtest
  -- Depending on the server, a POST request is needed, as Gd
/OrderSummary�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE ba string SET ba = browse.backargs()

  EXEC web.Head( 'Order Summary' )
  SELECT '<table><tr><th>Cust<th>Total<th>Count</tr>'

  DECLARE cust int, total_c/Menu�() AS
BEGIN
   DECLARE cu int SET cu = login.get(0) IF cu = 0 RETURN

   EXEC web.Head('System Menu')
   SELECT '
<p><a href="/ShowTable?s=dbo&n=Cust">Customers</a> | <a href="/OrderSummary">Order Summary</a>
<p><a target=_blank href=�	b/Manual)cu = 0 RETURN

  DECLARE ba string SET ba = browse.backargs()

  DECLARE s string SET s = web.Query('s')
  DECLARE sid int SET sid = Id FROM sys.Schema WHERE Name = s
  EXEC web.Heh/ShowRow�() AS 
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE t int SET t = browse.tableid()

  DECLARE k int SET k = PARSEINT( web.Query('k') )  

  EXECUTE( browse.ShowSql(t,k) )
ENDg/SetPassword�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE k int SET k = PARSEINT( web.Query('k') )

  DECLARE pw string SET pw = web.Form('pw')
  IF pw != '' 
  BEGIN
    UPDATE login.user SET HashedPassword =Xf
/ScriptAll�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.SetContentType( 'text/plain;charset=utf-8' )

  DECLARE mode int SET mode = PARSE)�6l
CustSelect�( colId int, sel int ) RETURNS string AS
BEGIN
  DECLARE col string SET col = Name FROM sys.Column WHERE Id = colId

  DECLARE opt string, options string

  FOR opt = '<option ' | CASE WHEN Id = sel THEN ' selected' ELSE '' END 
  | ' value=GkCustName�( cust int ) RETURNS string AS
BEGIN
  SET result = 'Cust ' | cust -- default in case Cust row does not exist
  SET result = FirstName | ' ' | LastName FROM dbo.Cust WHERE Id = cust
ENDj
/ShowTable�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE ba string SET ba = browse.backargs()

  DECLARE t int SET t = browse.tableid()

  DECLARE title string SET title = browse.TableTitle( t )
  SET title =�i/ShowSchema�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF "tring, options string

  FOR opt = '<option ' | CASE WHEN Id = sel THEN ' selected' ELSE '' END 
  | ' value=jnMsgName;(id int) RETURNS string AS
BEGIN
  SET result = '' | id
ENDm
MakeOrders�(n int) AS
BEGIN 
  DELETE FROM dbo.Order WHERE 1 = 1
  DECLARE date int SET date = date.DaysToYearMonthDay(date.Today())
  DECLARE @I int 
  SET @I=0 
  WHILE @I < n
  BEGIN 
    INSERT INTO dbo.[Order](Cust,Total,Date) VALUES(1+@I%�backurl�() RETURNS string AS
BEGIN
  DECLARE n int
  SET n = 1
  WHILE 1 = 1
  BEGIN
    DECLARE v string, pv string, bs string
    SET v = web.Query('b' | n )
    IF v = '' RETURN pv | bs

    IF pv != '' SET  bs = bs | '&b' | (n-1) | '='R" RETURNS string AS
BEGIN
  WHILE n > 0
  BEGIN
    SET result |= s
    SET n = n - 1
  END
ENDq	OneTest�() AS
BEGIN 
  DECLARE rtestdata int
  SET rtestdata = Id FROM sys.Schema WHERE Name = 'rtestdata'

  DECLARE r int
  SET r = x FROM rtest.Gen
  SET r = r * 48271 % 2147483647
  UPDATE rtest.Gen SET x = r WHERE true

  DECLARE sql string, a �pSent�(id int) AS
BEGIN
  DELETE FROM email.Queue WHERE msg = id

  -- Test retry.
  -- EXEC email.LogSendError( id, 1, 'Testing retry!' )
ENDo	MsgSelect�( colId int, sel int ) RETURNS string AS
BEGIN
  DECLARE col string SET col = Name FROM sys.Column WHERE Id = colId

  DECLARE opt s"EN ' selected' ELSE '' END 
  | 'LuSmtpAccountName>(id int) RETURNS string AS
BEGIN
  SET result = '' | id
ENDt
hashS(s string) RETURNS binary AS
BEGIN
  SET result = ARGON(s,'pomesoft saltiness')
ENDs
get�( role int ) RETURNS int AS
BEGIN
  /* Get the current logged in user. Note: role is not yet checked */

  DECLARE username string SET username = web.Form('username')

  /*
     Login is initially disabled. Remove or comment out the lvr	repeatq( s string, n int )" sys.Column WHERE Id = colId
  DECLARE size int
  SET size = InputCols FROM browse.Column WHERE Id = colId
  IF size = 0 SET size = 20
  RETURN�
xRun�() AS 
/* 
  This function is called by the Rust program.
  The time interval (in milliseconds) is set using the built-in SLEEP function.
*/
BEGIN 

  DECLARE now int SET now = date.Ticks()

  DECLARE f string, a int
  FOR f = fn, �wLogSendError�( id int, retry int, error string ) AS

BEGIN
  DELETE FROM email.Queue WHERE msg = id

  IF retry = 0
  BEGIN
    INSERT INTO email.SendError( msg, error, time )
    VALUES ( id, error, date.Ticks() )
  END
  ELSE
  BEGIN
    IN�vSmtpAccountSelect�( colId int, sel int ) RETURNS string AS
BEGIN
  DECLARE col string SET col = Name FROM sys.Column WHERE Id = colId

  DECLARE opt string, options string

  FOR opt = '<option ' | CASE WHEN Id = sel TH"�() AS 
BEGIN 
  /* Set sleep time based on timed.Job table */

  DECLARE now int, next int
  SET now = date.Ticks()

  SET next = now + 24 * 3600 * 1000000 -- 24 hours

  DECLARE t int
  FOR t = at FROM timed.Job
  BEGIN
    IF ty{Retry�() AS 
BEGIN 
  DECLARE now int SET now = date.Ticks()
 
  -- Find a Delayed email that is due to be sent.
  -- Transient failures are retried after 600 seconds = ten minutes. 
  DECLARE id int, t int, r int
  FOR id = Id, t = time + �
zStringToTime�( s string ) RETURNS int AS
BEGIN
  -- Typical input is 'Feb 2 2020 20:15:31'
  DECLARE month int, day int, year int, hour int, min int, sec int

  DECLARE ms string
  SET ms = SUBSTRING( s, 1, 3 )
  SET month = CASE 
    WHEN ms = '�y	InputTime�( colId int, value int) RETURNS string AS 
BEGIN 
  DECLARE cn string 
  SET cn = Name FROM"
END�tablearg�( t int ) RETURNS string AS
BEGIN
  DECLARE sid int, s string, n string
  SET n = Name, sid = Schema FROM sys.Table WHERE Id = t
  SET s = Name FROM sys.Schema WHERE Id = sid
  RETURN 's=' | s | '&n=' | n
END�tableid�() RETURNS int AS
BEGIN
  DECLARE sname string, tname string, sid int, tid int
  SET sname = web.Query('s')
  SET tname = web.Query('n')

  SET sid = Id FROM sys.Schema WHERE Name = sname

  SET tid = Id FROM sys.Table WHERE Schema =Q}/GetTransaction�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  DECLARE k int SET k = PARSEINT( web.Query('k') )

  DECLARE id int, d binary

  SET id = Id, d = data FROM log.Transaction WHERE Id = k

  IF id = k 
    SELz	|Sleep"

    IF t < 6 SET filter = CASE 
       WHEN t = 1 THEN ' WHERE Id != 1' -- Sys
       WHEN t = 2 THEN ' WHERE Id > 6' -- Table
       WHEN t = 3 THEN ' WHERE Table > 6' -- Field
��/ScriptExact�() AS 
BEGIN 
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.SetContentType( 'text/plain;charset=utf-8' )

  DECLARE t int
  FOR t = Id FROM sys.Table
    EXEC sys.ScriptData(t,1)
END�fieldid�() RETURNS int AS
BEGIN 
  DECLARE t int SET t = browse.tableid()
  DECLARE fname string SET fname = web.Query('f')
  DECLARE f int SET f = Id FROM sys.Column WHERE Table = t AND Name = fname
  RETURN f
END�fieldarg�(f int) RETURNS string AS
BEGIN
  DECLARE t int, fname string
  SET t = Table, fname = Name FROM sys.Column WHERE Id = f
  RETURN browse.tablearg(t) | '&f=' | fname
"�6�	UrlEncode�( s string ) RETURNS string AS
BEGIN
  /* Would probably be better to do this using builtin function */
  SET s = REPLACE( s, '%', '%25' )
  SET s = REPLACE( s, '&', '%26' )
  SET s = REPLACE( s, '=', '%3D' )
  --SET s = REPLACE( s, '?��backargs�() RETURNS string AS 
BEGIN 
  DECLARE keep string

  /* Cleaner approach would be to iterate over all query args except b[n] */
  DECLARE n int, v string
  SET n = 1
  WHILE n < 6
  BEGIN
    DECLARE name string
    SET name = CAS{�	/VerifyDB�() AS
BEGIN
  DECLARE cu int SET cu = login.get(1) IF cu = 0 RETURN

  EXEC web.Head('Verify database')

  SELECT '<p>' | VERIFYDB()

  EXEC web.Trailer()
END�
ScriptData�( t int, mode int ) AS
BEGIN
    DECLARE filter string
`sys
datehtmwebbrowsehandlerdboemail	rtest
login	timedlog`sysdatehtmwebbrowsehandlerdboemail
	rtest
login	timedlog4A:5;9><:=>+3?@A?=CDDE8CFEG@BHLto�8(1title�2body�313format5
msgC628xC9Name�75:HashedPassword�;server�@4<username�=password�;9>accountC?statusC>:@msgCAerror�?=CtimeCDfn�B<EatCFmsgCDAGerror�HtimeCECLdata�fersToCDefault�	InputColsC
InputFunction�	InputRowsCStyleCDisplayFunction�
ParseFunction� 	NameFunction�0!	SelectFunction�"	DefaultOrder�#!#	Title�$	Description�&"%	RoleC&
	FirstNameZ'%'
LastName�(
AgeC,$)
City�*
x+)+CustC,TotalC.*-DateC.InfoJ/-/from�0
H		�$
	
+
-35
6>@CEFH
C�date.MiEdate.Ticks()�browse.�date.Mi�date.StFH�date.Mi+
-�date.Da�browse.�date.Ye�date.St3�0 means	56date.Ticks()�date.Mi
>@�$sys.TypeName
 ��p��bF��cG��dHT�eIyfJ�gK$
hL�"6k$\�#]$^-#_7'g�%ip.�i[0�j\K/�k]�/�l^�.�m_�2�n`�1�oa$:�p�;�:p;�:�>&@='�EUD n���1#��2$���3%��4&A��5'K��6(���7)���3�_� ��"��#��+��,8�YT��~U�V���W���X ���Y!T��Z"���������8��]��g������M?O?N@{@OA�APBBQCJRD�KSETx
�/����� ��G�Cs�[�c8��;9	��<:���>=L�����'��������ǚ�h�����DۢE	L�F
q�G{�O�P
��}c�������%��/��а�h��*�+C�,��-ٹ.�
/��0�;��a��bh�c��e��l8�.��n�iL�h%��*�g�f%���eđd%����b��a%��^�`<�_%���^��]%��֐\��Z%����Yp�X%��N�W,�V%��
�U�T%��ƏS��R%����Q`�P%��>�O�N%����M؎L%����K��J%��r�IP�H%��.�G�F%���EȍB%�Ǧ�A��@%��b�?@�>%���=��<%��ڌ;��:%�ϖ�9t�8%��R�70�6%���5�4%��ʋ3��2%�׆�1d�0%��B�/ �.&����-܊,%�ݺ�*+.�D��%dl"����%ikޙ����%jn���x��%moV��4��%hx����%qsΘ����%rv���h��%uwF��$��%t|�����%y{������%z~z��X��%}6����%@���Ж�%��������%��j��H��%��&����%�������%�����|��%��Z�8�~%���}��|%��Ҕ{��z%����yl�x%��J�w(�v%���u�t%��“s��r%��~�q\�p%��:�o�n%����mԒl&����k��j%.�<��%*.�����%-/֡����%(8���p��%13N��,��%26
����%57Ơ����%4<���`��%9;>����%:>���؟�%=?������% `r��P��%AC.����%BF��Ȟ�%EG������%DLb��@��%IK�����%JNڝ����%MO���t��%HXR��0��%QS����%RVʜ����%UW���d��%T\B�� ��%Y[���ܛ�%Z^������%]_v��T��%Pp2����%ac��̚�%bf������%egf�.4�'���&�%��Ω$��#����"h�!��F� $�������������z�X���6��!���Ч%����%j�H�%&��%�
��%	��|�
%
Z�	8�%
���%ҥ��%��l�%J�(�%����%¤����%~��\��%:����%���ԣ�%0������%!#n��L��%"&*����%%'��Ģ�%$,������%)+^�.,�i��
�h�g��Ʊf��e����d`�c��>�b�a����`ذ_����^��]��r�\P�[��.�Z�Y���XȯW�Ǧ�V��U��b�T@�S���R��Q��ڮN��M�ϖ�Lt�K��R�J0�I���H�C��ʭB��A�׆�@d�?��B�> �=����<ܬ;�޺�:��9��v�8T�7��2�6�5���4̫3�檫2��1��f�0D�/��"�.�-��ު,��+�*x�)��V�(.��t|����y{������z~z��X��}6����@���и�����������j��H����&����������������|����Z��8�����������Ҷ���������l����J��(����������µ������~��\����:��������Դ~����|��{��n�zL�y��*�x�w���viju����t��s��^�r<�q���p��o��ֲn��m����lp�k��N�j.�:>������=?������ `r��P��AC.����BF������EG������DLb��@��IK�����JNڿ����MO���t��HXR��0��QS����RVʾ����UW���d��T\B�� ��Y[���ܽ�Z^������]_v��T��Pp2����ac��̼�bf������egf��D��dl"����ik޻����jn���x��moV��4��hx����qsκ����rv���h��uwF��$.����*��)��(��'j�&H�%&�$�#��"��!	�� |�
Z�8�
���������l�J�(��������~�\�:����
��	0����!#n�L�"&*���%'������$,������)+^��<��*.�����-/������(8���p��13N��,��26
�����57������4<���`��9;>���7����k��j%����i��h%��b�g@�f%���d��`%����_��^%����]t�\%��R�[0�Z%���Y��X%����W��V%����Ud�T%��B�S �R%����Q��P%����O��N%��v�MT�L%��2�K�J%����I��H%�ê�G��F%��f�ED�D%��"�C�B%����A��@%�˚�?x�>%��V�=4�<%���:��9%����8��7%�ӊ�6h�5%��F�4$�3%���2��1%�ھ�0��/&��z�.X�-%��6�,-7����%dl���|��%ikZ��8��%jn�����%mo������%hx���l��%qsJ��(��%rv�����%uw������%t|~��\��%y{:����%z~������%}������%@�n��L��%��*����%��������%��������%��^��<��%�������%��������%�����p��%��N�,�~%��
�}��|%����{��z%����y`�x%��>�w�v%����u��t%����s��r%��r�qP�p&��.�o�m%7����%*.���t��%-/R��0��%(8�����%13������%26���d��%57B�� ��%4<������%9;������%:>v��T��%=?2����% `������%AC������%BFf��D��%EG"����%DL������%IK���x��%JNV��4��%MO�����%HX������%QS���h��%RVF��$��%UW�����%T\������%Y[z��X��%Z^6����%]_������%Pp������%acj��H��%bf&����%eg��7��.����-l�*��J�)(�(���'��&����%��$��~�!\���:��������������!��n�L�%*��%����%����%^�<�%	�
��%
����
%
��	p�%N�,�%
���%����%��`�%>����%������%������%r��P��%0.����%!#������%"&������%%'b��@��%$,�����%)+��7��k����jd�i��B�h �g����f��e����d��c��v�bT�a��2�`�_����^��]�ê�\��[��f�ZD�X��"�W�V����U��T�˚�Sx�R��V�Q4�P���O��N����M��L�ӊ�Kh�J��F�I$�H���G��F�ܾ�E��D��z�CX�B��6�A�@����?��>���=��<��j�;H�:��&�9�8����7��6���5|�4��Z�38�2���1��0����/7��t|~��\��y{:����z~������}������@�n��L����*����������������������^��<����������������������p����N��,����
������������������`����>����������������������r��P����.���}����|��{����z��y��b�x@�w���v��u����t��s����rt�q��R�p0�o���n��m����l7�:>v�T�=?2�� `����AC����BFf�D�EG"��DL������IK���x��JNV��4��MO�����HX������QS���h��RVF��$��UW�����T\������Y[z��X��Z^6����]_������Pp������acj��H��bf&����eg������dl���|��ikZ��8��jn�����mo������hx���l��qsJ��(��rv�����uw����7��n	,L	+*	*	)�(�'�&�%^$<#	"�!
� �
�pN,
����`>����r
P0.
!#�	�"&��%'b@$,�)+��*.��t�-/R�0�(8���13����26��d�57B� �4<����9;���[       }
      g�       if content_type.is_empty() {
                if let Ok(s) = field.text().await {
                    text = s;
         f� None => "".to_string(),
            };
            let mut data = Vec::new();
            let mut text = "".to_string();
     e�       };
            let content_type = match field.content_type() {
                Some(s) => s.to_string(),
               d�t file_name = match field.file_name() {
                Some(s) => s.to_string(),
                None => "".to_string(),
     c�ile let Some(field) = mp.next_field().await.unwrap() {
            let name = field.name().unwrap().to_string();
            leb�c fn map_parts(mp: Option<Multipart>) -> Vec<Part> {
    let mut result = Vec::new();
    if let Some(mut mp) = mp {
        wha�ue();
        result.insert(name.to_string(), value.to_string());
    }
    result
}

/// Get Vec of Parts from MultiPart.
asyn`� String> {
    l[et mut result = BTreeMap::new();
    for cookie in cookies.list() {
        let (name, value) = cookie.name_val_�tions for building ServerTrans.

/// Get BTreeMap of cookies from Cookies.
fn map_cookies(cookies: Cookies) -> BTreeMap<String,^�;
    st.x.qy.sql = Arc::new(src);
    state.process(st).await;
}

/////////////////////////////////////////////
// Helper func0]�r: String) {
    let mut st = ServerTrans::new();
    let src = format!("EXEC email.LogSendError({},{},'{}')", msg, retry, err)\�e the database to reflect an error occurred sending an email.
async fn email_error(state: &SharedState, msg: u64, retry: i8, er!#[� ServerTrans::new();
    st.x.qy.sql = Arc::new(format!("EXEC email.Sent({})", msg));
    state.process(st).await;
}

/// UpdatZ�
}

/// Update the database to reflect an email was sent.
async fn email_sent(state: &SharedState, msg: u64) {
    let mut st ="&Y�ings
        .pool_config(PoolConfig::new().max_size(20))
 [       .build();

    let _result = sender.send(&email)?;
    Ok(())X� // Configure expected authentication mechanism
        .authentication(vec![Mechanism::Plain])
        // Connection pool sett%'W�elay(&server)?
        // Add credentials for authentication
        .credentials(Credentials::new(username, password))
       V�)
        .singlepart(body)?;

    // Create TLS transport on port 587 with STARTTLS
    let sender = SmtpTransport::starttls_r$,U�(body),
    };

    let email = Message::builder()
        .to(to.parse()?)
        .from(from.parse()?)
        .subject(titleT�Transport, Transport,
    };

    let body = match format {
        1 => SinglePart::html(body),
        _ => SinglePart::plain)+S�ansport::smtp::{
            authentication::{Credentials, Mechanism},
            PoolConfig,
        },
        Message, SmtpR�e, password): (String, String, String),
) -> Result<(), EmailError> {
    use lettre::{
        messagZ_blank href$� | back| '">Back</a> | ' ELSE '' END | '
<a href=/Menu>Menu</a> 
| <a target=_blank href=/Menu>N%'#� style="color:white;background:lightblue;padding:4px;">
' | CASE WHEN back != '' THEN '<a href="'"�le>
   body{font-family:sans-serif;}
   body{ max-width:60em; }
</style>
</head>
<body>
<div$,!�name="viewport" content="width=device-width, initial-scale=1">
<title>' | title | '</title>
<sty �e * 146097 
    + y * 365 
    + ( y + 3 ) / 4 - ( y + 99 ) / 100 + ( y + 399 ) / 400
    + d
ENDl)+� 146097 is the number of the days in a 400 year cycle ( 400 * 365 + 97 leap years ).
  RETURN cycl�lt days come from cycles, from years having at least 365 days, from leap years and finally d.
  --*.�
  SET cycle = y / 400, y = y % 400 -- The Gregorian calendar repeats every 400 years.
 
  -- Resu�DECLARE y int, d int, cycle int
  -- Extract y and d from yd.
  SET y = yd / 512, d = yd % 512 - 1-/�ereZ days divisible by 4 are leap years, except if divisible by 100, except if divisible by 400.
  �) ) )
  RETURN date.YearMonthDayToDays( date.YearMonthDay( year, month, day ) )
ENDssix + 1, LEN(s(@�st be 1..31 parsing date ' | htm.Attr(''|day)
  SET year = PARSEINT( SUBSTRING( s, ssix + 1, LEN(s� SET day = PARSEINT( SUBSTRING( s, six+1, ssix - six - 1) )
  IF day < 1 OR day > 31 THROW 'Day mu13� SUBSTRING( s, ssix, 1 ) = ' ' BREAK
    SET ssix = ssix + 1
  END
 
  DECLARE day int, year int
 �  END
  DECLARE ssix int
  SET ssix = six+1
  WHILE true
  BEGIN
    IF ssix > LEN(s) BREAK
    IF26�  BEGIN
    IF six > LEN(s) BREAK
    IF SUBSTRING( s, six, 1 ) = ' ' BREAK
    SET six = six + 1
�arsing date ' | htm.Attr(ms)
  DECLARE six int -- Index of first space
  SET six = 4
  WHILE true
57�'Nov' THEN 11
    WHEN ms = 'Dec' THEN 12
    ELSE 0
  END  
  IF month = 0 THROW 'Unknown month p�7
    WHEN ms = 'Aug' THEN 8
[e::SinglePart,
        tr*.Q�l using lettre.
fn send_email(
    (from, to, title, body, format): (String, String, String, String, i64),
    (server, usernamP�for EmailError {
    fn from(e: lettre::transport::smtp::Error) -> Self {
        EmailError::Send(e)
    }
}

/// Send an emai-/O�   fn from(e: lettre::error::Error) -> Self {
        EmailError::Lettre(e)
    }
}

impl From<lettre::transport::smtp::Error> N�re::address::AddressError) -> Self {
        EmailError::Address(e)
    }
}

impl From<lettre::error::Error> for EmailError {
 (4M�or),
    Send(lettre::transport::smtp::Error),
}

impl From<lettre::address::AddressError> for EmailError {
    fn from(e: lettL�num for send_email
#[derive(Debug)]
enum EmailError {
    Address(lettre::address::AddressError),
    Lettre(lettre::error::Err13K�state, msg, retry, se.to_string()).await;
                    }
                },
            }
        }
    }
}

/// Error eJ�:Send([se) => {
                        let retry = if se.is_transient() { 1 } else { 0 };
                        email_error(&28I�                       email_error(&state, msg, 0, le.to_string()).await;
                    }
                    EmailError:H�     email_error(&state, msg, 0, ae.to_string()).await;
                    }
                    EmailError::Lettre(le) => {
 57G�nt(&state, msg).await,
                Err(e) => match e {
                    EmailError::Address(ae) => {
                   F� account));
            let result = blocking_task.await.unwrap();
            match result {
                Ok(_) => email_se69E� for (msg, email, account) in send_list {
            let blocking_task = tokio::task::spawn_blocking(move || send_email(email,:D�erver, username, password),
                        ));
                    }
                }
            }
        }
       Z    WHEN ms = 'Sep' THEN 9
    WHEN ms = 'Oct' THEN 10
    WHEN ms = 4<� ms = 'Apr' THEN 4
    WHEN ms = 'May' THEN 5
    WHEN ms = 'Jun' THEN 6
    WHEN ms = 'Jul' THEN � year ) THEN 366 ELSE 365 END
  END
  RETURN 512 * ( cycle * 400 + year ) + day + 1
ENDIsLeapYear(9;�400
  
  IF day < 0
  BEGIN
    SET year = year - 1
    SET day = day + CASE WHEN date.IsLeapYear(� 1, 4 => 1, 5 => 2 ..
  SET day = day - ( year + 3 ) / 4 + ( year + 99 ) / 100 - ( year + 399 ) / :>
�... not 300, 400, 404 ... not 500.
  -- Adjustment as function of y is 0 => 0, 1 => 1, 2 =>1, 3 =>�just day to allow for leap years.
  -- Leap years are 0, 4, 8, 12 ... 96, not 100, 104 ... not 200=?�146097
  SET year = days / 365
  SET day = days - year * 365 -- Same as days % 365
  -- Need to ad
� 97 leap years )
  SET cycle = days / 146097
  SET days = days - 146097 * cycle -- Same as days % 8D	�ar int, day int, cycle int
  -- 146097 is the number offd93�uid�1���86�d2DT]web.Main()�/SetPassword��k�1��pw�pomegranatepeach246���毕kwSZC^�web.Main()�/Execute���sql�DROP FN login.getx��hpw�B0x46f65dd62c4b05e1[_�5071dc5a0e914297f7a0aaced2e0875d84018a27640d4574�uid�1��渠�stb05e1Pweb.Main()�/Execute���sql�#CREATE FN logwyCin.getx() AS BEGIN END���渖�b� FN logM �t�pe : the datatype of an existing column is changed. The only changes allowed are between the different sizes of integers, betwe�The actions are as follows:
<ul>
<li>ADD Colname Coltype : a new column is added to the table.</li>
<li>MODIFY Colname Colty�s when a value is stored in column of a table.
<h3>ALTER TABLE</h3>
<p>ALTER TABLE schema.tablename action1, action2 .... <p>�etrieve. Local float and integer variables and arithmetic operations are all 64 bits (8 bytes). The lower precision only applie�ed in a special system table if the length exceeds the reserved inline storage, meaning they are slightly slower to store and r�or numbers, a zero length string for string and binary, and false for the boolean type. The variable length data types are stor� bytes stored inline.</li>
<li>bool : boolean ( true or false ).</li>
</ul>

<p>Each data type has a default value : zero f��r of bytes stored inline.<%se</h3><p>Has tables and functions for displa_�ying, editing arbitrary tables in the database.
<h3>date</h3><p>Has functions for manipulating dates - conversions between DayZX`�s ( from year 0 ), Year-Day, Year-Month-Day and string.
' 
EXEC web.Trailer()
END��hpw�B0x46f65dd62c4b05e15071dc5a0e914297f7[a]a0aaced2e0875d84018a27640d4574�uid�1��渢Eood string.
' 
EXEC web.Trailer()
END��hpw�B0x46f65dd62c4b05e15071dc5a0e914297f7z�GIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCookie( 'hpw', '' | hpw, '' )
      RETURN result
{�    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
  DECLARE hpwf string SET hpwf = web.Cookie('hpw')

  I^\|�F uids != ''
  BEGIN
    DECLARE uid int SET uid = PARSEINT(uids)
    DECLARE hpwt binary SET hpwt = HashedPassword FROM log}�in.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXEC web.Head( 'Login' )
  SELECT '<form method=post>%/li>
<li>PARSEFLOAT( s string ) : parses a floating point number from s.</li>K B�
<li>EXCEPTION() returns a string with any error that occurred during an EXECUTE statement.</li>
<li>REPACKFILE(k,schema,tablC�e) : A file is re-packed to free up pages. The result is an integer, the number of pages freed, or -1 if the table or index doe><D�s not exist. k=0 => main file, k=1.. => an index, k in -4..-1 => byte storage files. 
<li>VERIFYDB() : verifies the logical paE�ge structure of the database. , the result is a string. Note: this needs exclusive access to the database to give consistent reA=F�sults, as it can observe update activity in shared data structures. Calling it while another process is updating the database mG�ay result in an exception.
<li>See the web schema for functions that can be used to access http requests.</li>
</ul>
<h3>ConB@H�versions</h3>
<p>To be decided. Currently the only implicit conversion is to string for ope%rands of string concatenation.
<h2I�>Indexes
<h3>CREATE INDEX</h3><p>CREATE INDEX indexname ON schema.tablename( Colname1, Colname2 ... )<p>Creates a new index. IG?J�ndexes allow efficient access to rows other than by Id values. 
<p>For example, <br>CREATE INDEX ByCust ON dbo.Order(Cust) 
<K�br>creates an index allowing the orders associated with a particular customer to be efficiently retrieved without scanning the FDL�entire order table.
<h2>Drop</h2>
<h3>DROP object-type object-name</h3><p>object-type can be any one of SCHEMA,TABLE or FUNCTM�ION.
<p>The specified object is removed from the database. In the case of a SCHEMA, all objects in the SCHEMA are also removedIEN�. In the case of TABLE, all the rows in the table are also removed.
<h3>DROP INDEX</h3><p>DROP INDEX indexname ON schema.tableO�name<p>The specified index is removed from the database.
<h2>Comments</h2>
<p>There are two kinds of comments. Single line coJHP%�mments start with -- and extend to the end of the line. Delimited comments start with /* and are terminated by */. Comments havQ�e no effect, they are simply to help document the code.
<h2>Comparison with other SQL implementations</h2><p>There is a singleSCR� variable length string datatype "string" for unicode strings ( equivalent to nvarchar(max) in MSSQL ), no fixed length stringsS�.
<p>Similarly there is a single binary datatype "binary" equivalent to varbinary(max) in MSSQL.
<p>Every table automaticallyNLT� gets an integer Id field ( it does not have to be specified ), which is automatically filled in if not specified in an INSERT U�statement. Id values must be unique ( an attempt to insert or assign a duplicate Id will raise an exception ). 
<p>WHERE condiQMV�tion is not optional in UPDATE and DELETE statements - WHERE true can be used if you really want to UPDATE or DELETE all rows. W�This is a "safety" feature.
<p>Local v%ariables cannot be assigned with SELECT, instead SET or FOR is used, can be FROM a tableRPX�, e.g.
<p>DECLARE s string SET s = Name FROM sys.Schema WHERE Id = schema
<p>No cursors ( use FOR instead ).
<p>Local variabY�les cannot be assigned in a DECLARE statement.
<p>No default schemas. Schema of tables and functions must always be stated expWOZ�licitly.
<p>No nulls. Columns are initialised to default a value if not specified by INSERT, or when new columns are added to [�a table by ALTER TABLE.
<p>No triggers. No joins. No outer references.
<h2>Guide to the pre-defined schemas</h2>
<h3>sys</h3VT\�>
<p>Has core system tables for language objects and related functions.
<h3>web</h3>
<p>Has the function that handles web re]�quests ( web.main ) and other functions related to handling web requests.
<h3>handler</h3>
<p>Has handler functions, one for YU^�each web page.
<h3>htm</h3>
<p>Has functions related to encoding html.
<h3>browQ�(�ropped before using ALTER TABLE. They can be added again afterwards.
</ul>
<h2>Data manipulation statements</h2>
<h3>INSERT<�the column is removed from the table.</li>
</ul>
<p>Note: currently, any indexes that have been added to a table need to be d�etween float and double, and modification of the number of bytes stored inline for binary and string.</li>
<li>DROP Colname : �oltype : the datatype of an existing column is changed. The only changes allowed are between the different sizes of integers, b� <p>The actions are as follows:
<ul>
<li>ADD Colname Coltype : a new column is added to the table.</li>
<li>MODIFY Colname C�plies when a value is stored in column of a table.
<h3>ALTER TABLE</h3>
<p>ALTER TABLE schema.tablename action1, action2 ....�nd retrieve. Local float and integer variables and arithmetic operations are all 64 bits (8 bytes). The lower precision only ap�stored in a special systemQ table if the length exceeds the reserved inline storage, meaning they are slightly slower to store a�ro for numbers, a zero length string for string and binary, and false for the boolean type. The variable length data types are �r of bytes stored inline.</li>
<li>bool : boolean ( true or false ).</li>
</ul>

<p>Each data type has a default value : ze	�umber of bytes stored inline.</li>
<li>binary(n) : a variable length string of bytes. n (optional, default 15) specifies numbe� bytes respectively.</li>
<li>string(n) : a variable length string of unicode characters. n (optional, default 15) specifies n
�nt(n), 1 <= n <= 8. Signed n-byte integer. Default is 8 bytes.</li>
<li>float, double : floating point numbers of size 4 and 8�n Id column, which auto-increments on INSERT ( if no explicit value is supplied).<p>The data types are as follows:
<ul>
<li>i
�tablename ( Colname1 Coltype1, Colname2 Coltype2, ... )
<p>Creates aQ new base table. Every base table is automatically given a� to organise database objects into logical categories.
<h2>Table definition</h2>
<h3>CREATE TABLE</h3><p>CREATE TABLE schema.�CREATE SCHEMA name
<p>Creates a new schema. Every database object (Table, Function) has an associated schema. Schemas are used
�yntax is described, optional elements are enclosed in square brackets.
<h2>Schema definition</h2>
<h3>CREATE SCHEMA</h3>
<p>�EC web.Head('Manual')
SELECT '<h1>Manual</h1>
<p>This manual describes the various SQL statements that are available. Where s�web.Main()�/EditFunc��n�/Manual�s�handler��def�4�() AS BEGIN

   DECLARE cu int SET cu = login.getx(0) IF cu = 0 RETURN

EX
ir-Month-Day and string.
' 
EXEC web.Trailer()
ENDanipulating dates - conversions between Days ( from year 0 ), Year-Day, Yea	�n the database.
<h3>date</h3><p>Has functions for manipulating dates - conversions between Days ( from year 0 )Pient for further processing and eventual display. 
<h3>UPDATE</h3><p>UPDATE schema.tablename SET Colname1 = Exp1, Colnam28$�as a stand-alone statement, the results are passed to the code that invoked the batch, and may be displayed to a user or sent t#� expression, the order is reversed ( descending order ).
<p>The SELECT expressions can be given names using AS.
<p>When used 57"�puted, based on the list of expressions and the WHERE and ORDER BY clauses.
<p>If the keyword DESC is placed after an ORDER BY!�alls ).
<h3>SELECT</h3><p>SELECT expressions FROM source-table [WHERE bool-exp ] [ORDER BY expressions]
<p>A new table is com69 �cified values are inserted into the table. The values may be any expressions ( possibly involving local variables or function c:�/h3>
<p>INSERT INTO schema.tablename ( Colname1, Colname2 ... ) VALUES ( Val1, Val2... ) [,] ( Val3, Val4 ...) ...
<p>The speTrror message being set to the string.
<h3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, parh�ion string). If any exception occurs, the database is left unchanged.
<h3>THROW</h3>
<p>THROW string-expression 
<p>An excepg� of a function or batch. EXCEPTION() can be used to obtain a string describing the most recent exception (and clears the except	f�<p>The stored function is called with the supplied parameters.
<h3>Exceptions</h3><p>An exception will terminate the executione�eturn value ) is created, which can later be called by an EXEC statement.
<h3>EXEC</h3><p>EXEC schema.name( exp1, exp2 ... )

d�3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, param2 type2... ) AS BEGIN statements END
<p>A stored function ( no rc�a prior batch before being used. A GO statement may be used to signify the start of a new batch.
<h2>Stored Functions</h2>
<h
b�he result ( which should be a list of SQL statements ).
<p>Note thatT �tp�ssion, which has syntax CASE WHEN bool1 THEN exp1 WHEN bool2 THEN exp2 .... ELSE exp END - the result is the expression associao�lumns from tables. These may be combined using operators, stored functions, pre-defined functions. There is also the CASE expren�error.

<h2>Expressions</h2>
<p>Expressions are composed from literals, named local variables, local parameters and named com�3>CHECK</h3>
<p>CHECK schema.name
<p>Checks that a function compiles ok. EXCEPTION() should be used to check if there is any l�d function with no return value.
<p>The pre-defined local variable result can be assigned instead to set the return value.
<hk�h3>RETURN</h3>
<p>RETURN expression
<p>Returns a value from a stored function. RETURN with no expression returns from a storej�am2 type2... ) RETURNS type AS BEGIN statements END
<p>A stored function is created which can later be used in expressions.
<i�tion is raised, with the ePecuted for each row from *.,�ition. If there is no such row, the values of the local variables remain unchanged.
<h3>FOR</h3><p>FOR name1 = exp1, name2 = e+�l variables are assigned. If the FROM clause is specified, the values are taken from a table row which satisfies the WHERE cond-/*�ountered if there is a loop ).
<h3>SET</h3>
<p>SET name1 = exp1, name2 = exp2 .... [ FROM table ] [ WHERE bool-exp ]
<p>Loca)�red with the specified types. The variables are initialised to default values ( but only once, not each time the DECLARE is enc(4(�laration and assignment statements</h2>
<h3>DECLARE</h3><p>DECLARE name1 type1, name2 type2 ....
<p>Local variables are decla'�OM schema.tablename WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are removed.
<h2>Local variable dec13&�e2 = Exp2 .... WHERE bool-exp
<p>Rows in the table which satisfy the WHERE condition are updated.
<h3>DELETE</h3><p>DELETE FR%�o a clS s binary, start int, len*.~�/li>
<li>BINLEN( s binary ) : returns the length of s, which must be a binary expression.</li> 
<li>SUBSTRING( s string, star}� * c.
<h3>Pre-defined functions</h3>
<ul>
<li>LEN( s string ) : returns the length of s, which must be a string expression.<-/|� operator  ( result is true if either arg is true )</li>
</ul>
<p>Brackets can be used where necessary, for example ( a + b ){�false, false if arg is true ).</li>
<li>AND : boolean operator ( result is true if both args are true )</li>
<li>OR : boolean(	z�necessary.</li>
<li>= != > < >= <= : comparison of any data type.</li>
<li>NOT : boolean negation ( result is true if arg is y�ers.</li>
<li>| : concatenation of string/binary values. The second expression is automatically converted to string/binary if 13x�on and remainder (after division) of numbers. Remainder only applies to integers.</li>
<li>+ - : addition, subtraction of numbw�, and SNote: this needs exclusive access to the database to give consistent��does not exist. k=0 => main file, k=1.. => an index, k in -4..-1 => byte storage files. 
<li>VERIFYDB() : verifies the logical%'��able) : A file is re-packed to free up pages. The result is an integer, the number of pages freed, or -1 if the table or index ��li>
<li>EXCEPTION() returns a string with any error that occurred during an EXECUTE statement.</li>
<li>REPACKFILE(k,schema,t$,��li>PARSEINT( s string ) : parses an integer from s.</li>
<li>PARSEFLOAT( s string ) : parses a floating point number from s.</��ccurrence of pat is replaced with sub.</li>
<li>LASTID() : returns the last Id value allocated by an INSERT statement.</li>
<)+�� int ) : binary version of SUBSTRING.</li>
<li>REPLACE( s string, pat string, sub string ) : returns a copy of s where every o�t int, len int ) : returns the substring of s from start (1-based) length len.</li>
<li>BINSUBSTRING(Stable.
<h2>Drop</h2>
<h3>DROP object-type object-name</h3><p>object-type can be any one of SCHEMA,TABLE or FU��
<br>creates an index allowing the orders associated with a particular customer to be efficiently retrieved without scanning t��. Indexes allow efficient access to rows other than by Id values. 
<p>For example, <br>CREATE INDEX ByCust ON dbo.Order(Cust) 0��<h2>Indexes
<h3>CREATE INDEX</h3><p>CREATE INDEX indexname ON schema.tablename( Colname1, Colname2 ... )<p>Creates a new index��Conversions</h3>
<p>To be decided. Currently the only implicit conversion is to string for operands of string concatenation.
!#��e may result in an exception.
<li>See the web schema for functions that can be used to access http requests.</li>
</ul>
<h3>�� results, as it can observe update activity in shared data structures. Calling it while another process is updating the databas"&�� page structure of the database. , the result is a string. Sfied in an INSE��ngs.
<p>Similarly there is a single binary datatype "binary" equivalent to varbinary(max) in MSSQL.
<p>Every table automatica��gle variable length string datatype "string" for unicode strings ( equivalent to nvarchar(max) in MSSQL ), no fixed length stri��have no effect, they are simply to help document the code.
<h2>Comparison with other SQL implementations</h2><p>There is a sin�� comments start with -- and extend to the end of the line. Delimited comments start with /* and are terminated by */. Comments ��blename<p>The specified index is removed from the database.
<h2>Comments</h2>
<p>There are two kinds of comments. Single line��ved. In the case of TABLE, all the rows in the table are also removed.
<h3>DROP INDEX</h3><p>DROP INDEX indexname ON schema.ta��NCTION.
<p>The specified object is removed from the database. In the case of a SCHEMA, all objects in the SCHEMA are also remo��he entire order Snces.
<h2>Guide to the pre-defined schemas</h2>
<h3>sys<��explicitly.
<p>No nulls. Columns are initialised to default a value if not specified by INSERT, or when new columns are added ��iables cannot be assigned in a DECLARE statement.
<p>No default schemas. Schema of tables and functions must always be stated ��ble, e.g.
<p>DECLARE s string SET s = Name FROM sys.Schema WHERE Id = schema
<p>No cursors ( use FOR instead ).
<p>Local var��s. This is a "safety" feature.
<p>Local variables cannot be assigned with SELECT, instead SET or FOR is used, can be FROM a ta��ndition is not optional in UPDATE and DELETE statements - WHERE true can be used if you really want to UPDATE or DELETE all row��RT statement. Id values must be unique ( an attempt to insert or assign a duplicate Id will raise an exception ). 
<p>WHERE co��lly gets an integer Id field ( it does not have to be specified ), which is automatically filled in if not speciW0��AND HashedPassword = hpw
    IF result > 0
    BEGIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetC��ookie( 'hpw', '' | hpw, '' )
      RETURN result
    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
  DECL��LARE hpwt binary SET hpwt = HashedPassword FROM login.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXEC ��><br><input type=submit value=Login></form>'
  EXEC web.Trailer()

  RETURN 0
END���渘`�kput type=password name=password��web.Head( 'Login' )
  SELECT '<form method=post>User Name <input name=username><br>Password <input type=password name=password��ARE hpwf string SET hpwf = web.Cookie('hpw')

  IF uids != ''
  BEGIN
    DECLARE uid int SET uid = PARSEINT(uids)
    DEC��ld be changed.
  */

  IF username != ''
  BEGIN
    DECLARE password string SET password = web.Form('password')
    SET ��lt = Id FROM login.user WHM/li>
<li>binary(n) : a variable length string of bytes. n (optional, default 15) specifies number of��es respectively.</li>
<li>string(n) : a variable length string of unicode characters. n (optional, default 15) specifies numbe��), 1 <= n <= 8. Signed n-byte integer. Default is 8 bytes.</li>
<li>float, double : floating point numbers of size 4 and 8 byt	�� column, which auto-increments on INSERT ( if no explicit value is supplied).<p>The data types are as follows:
<ul>
<li>int(n��ename ( Colname1 Coltype1, Colname2 Coltype2, ... )
<p>Creates a new base table. Every base table is automatically given an Id
��organise database objects into logical categories.
<h2>Table definition</h2>
<h3>CREATE TABLE</h3><p>CREATE TABLE schema.tabl��TE SCHEMA name
<p>Creates a new schema. Every database object (Table, Function) has an associated schema. Schemas are used to 
��x is described, optional elements are enclosed in square brackets.
<PREAK</h3><p>BREAK
<p>Execution of the enclosing FOR or WHILE loop i3�as bool-exp evaluates to true. See also BREAK.
<h3>GOTO</h3><p>GOTO label
<p>Control is transferred to the labelled statement%'2�atement2 ( if specified ) is executed.
<h3>WHILE</h3><p>WHILE bool-exp Statement
<p>Statement is repeatedly executed as long 1�/h3>
<p>IF bool-exp THEN Statement1 [ ELSE Statement2 ]
<p>If bool-exp evaluates to true Statement1 is executed, otherwise St$,0�ted in order. A BEGIN..END compound statement can be used whenever a single statement is allowed.
<h3>IF .. THEN ... ELSE ...</�ws.
<h2>Control flow statements</h2>
<h3>BEGIN .. END</h3><p>BEGIN Statement1 Statement2 ... END
<p>The statements are execu)+.�the table which satisfies the WHERE condition, with the named local variables being assigned expressions which depend on the ro-�xp2 .... FROM table [ WHERE bool-exp ] [ORDER BY expressions] Statement
<p>Statement is repeatedly exPor batch. EXCEPTION() can be used to obtain a string describing the most recent exception (and clears the excep:�
<p>The stored function is called with the supplied parameters.
<h3>Exceptions</h3><p>An exception will terminate the executio9�return value ) is created, which can later be called by an EXEC statement.
<h3>EXEC</h3><p>EXEC schema.name( exp1, exp2 ... )
08�h3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, param2 type2... ) AS BEGIN statements END
<p>A stored function ( no 7� a prior batch before being used. A GO statement may be used to signify the start of a new batch.
<h2>Stored Functions</h2>
<!#6�the result ( which should be a list of SQL statements ).
<p>Note that database objects ( tables, function ) must be created in5�s terminated.
<h2>Batch execution</h2><p>EXECUTE ( string-expression )
<p>Evaluates the string expression, and then executes "&4�. A label consists of a name followed by a colon (:)
<h3>BPo the CASE exprB� error.

<h2>Expressions</h2>
<p>Expressions are composed from literals, named local variables, local parameters and named cA�h3>CHECK</h3>
<p>CHECK schema.name
<p>Checks that a function compiles ok. EXCEPTION() should be used to check if there is any@�ed function with no return value.
<p>The pre-defined local variable result can be assigned instead to set the return value.
<?�<h3>RETURN</h3>
<p>RETURN expression
<p>Returns a value from a stored function. RETURN with no expression returns from a stor>�ram2 type2... ) RETURNS type AS BEGIN statements END
<p>A stored function is created which can later be used in expressions.
=�ption is raised, with the error message being set to the string.
<h3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, pa<�tion string). If any exception occurs, the database is left unchanged.
<h3>THROW</h3>
<p>THROW string-expression 
<p>An exce;�n of a function PThe operators ( all binary, except for - which can be unarI�, and are written without the square brackets, often in upper case only by convention ). The square brackets can be omitted if H� are enclosed in square brackets and are case sensitive ( although language keywords such as CREATE SELECT are case insensitiveG� hexadecimal preceded by 0x. Integers are a list of digits (0-9). The bool literals are true and false.
<h3>Names</h3><p>NamesF�gle quotes. If a single quote is needed in a string literal, it is written as two single quotes. Binary literals are written inE�ated with the first bool expression which evaluates to true.
<h3>Literals</h3>
<p>String literals are written enclosed in sinD�ession, which has syntax CASE WHEN bool1 THEN exp1 WHEN bool2 THEN exp2 .... ELSE exp END - the result is the expression associC�olumns from tables. These may be combined using operators, stored functions, pre-defined functions. There is alsPnctions</h3>
<ul>
<li>LEN( s string ) : returns the length of s, which must be a string expression.P�n operator  ( result is true if either arg is true )</li>
</ul>
<p>Brackets can be used where necessary, for example ( a + b O� false, false if arg is true ).</li>
<li>AND : boolean operator ( result is true if both args are true )</li>
<li>OR : boolea	N� necessary.</li>
<li>= != > < >= <= : comparison of any data type.</li>
<li>NOT : boolean negation ( result is true if arg isM�bers.</li>
<li>| : concatenation of string/binary values. The second expression is automatically converted to string/binary if
L�ion and remainder (after division) of numbers. Remainder only applies to integers.</li>
<li>+ - : addition, subtraction of numK�y, and NOT which is only unary ) in order of precedence, high to low, are as follows:
<ul>
<li>*  / % : multiplication, divis
J�the name consists of only letters (A-Z,a-z).
<h3>Operators</h3>
<p>P �tX�table) : A file is re-packed to free up pages. The result is an integer, the number of pages freed, or -1 if the table or indexW�/li>
<li>EXCEPTION() returns a string with any error that occurred during an EXECUTE statement.</li>
<li>REPACKFILE(k,schema,V�<li>PARSEINT( s string ) : parses an integer from s.</li>
<li>PARSEFLOAT( s string ) : parses a floating point number from s.<U�occurrence of pat is replaced with sub.</li>
<li>LASTID() : returns the last Id value allocated by an INSERT statement.</li>
T�n int ) : binary version of SUBSTRING.</li>
<li>REPLACE( s string, pat string, sub string ) : returns a copy of s where every S�rt int, len int ) : returns the substring of s from start (1-based) length len.</li>
<li>BINSUBSTRING( s binary, start int, leR�</li>
<li>BINLEN( s binary ) : returns the length of s, which must be a binary expression.</li> 
<li>SUBSTRING( s string, staQ�) * c.
<h3>Pre-defined fuOexes allow efficient access to rows other than by Id values. 
<p>For example, <br>CREATE INDEX ByCust ON dbo.Order(Cust)28^�
<h2>Indexes
<h3>CREATE INDEX</h3><p>CREATE INDEX indexname ON schema.tablename( Colname1, Colname2 ... )<p>Creates a new inde]�>Conversions</h3>
<p>To be decided. Currently the only implicit conversion is to string for operands of string concatenation.
57\�se may result in an exception.
<li>See the web schema for functions that can be used to access http requests.</li>
</ul>
<h3[�t results, as it can observe update activity in shared data structures. Calling it while another process is updating the databa69Z�l page structure of the database. , the result is a string. Note: this needs exclusive access to the database to give consisten:Y� does not exist. k=0 => main file, k=1.. => an index, k in -4..-1 => byte storage files. 
<li>VERIFYDB() : verifies the logicaOQL ), no fixed length str*.f� have no effect, they are simply to help document the code.
<h2>Comparison with other SQL implementations</h2><p>There is a sie�e comments start with -- and extend to the end of the line. Delimited comments start with /* and are terminated by */. Comments-/d�ablename<p>The specified index is removed from the database.
<h2>Comments</h2>
<p>There are two kinds of comments. Single linc�oved. In the case of TABLE, all the rows in the table are also removed.
<h3>DROP INDEX</h3><p>DROP INDEX indexname ON schema.t(4b�UNCTION.
<p>The specified object is removed from the database. In the case of a SCHEMA, all objects in the SCHEMA are also rema�the entire order table.
<h2>Drop</h2>
<h3>DROP object-type object-name</h3><p>object-type can be any one of SCHEMA,TABLE or F13`� 
<br>creates an index allowing the orders associated with a particular customer to be efficiently retrieved without scanning _�x. IndOefault schemas. Schema of tables and functions must always be statedm�able, e.g.
<p>DECLARE s string SET s = Name FROM sys.Schema WHERE Id = schema
<p>No cursors ( use FOR instead ).
<p>Local va%'l�ws. This is a "safety" feature.
<p>Local variables cannot be assigned with SELECT, instead SET or FOR is used, can be FROM a tk�ondition is not optional in UPDATE and DELETE statements - WHERE true can be used if you really want to UPDATE or DELETE all ro$,j�ERT statement. Id values must be unique ( an attempt to insert or assign a duplicate Id will raise an exception ). 
<p>WHERE ci�ally gets an integer Id field ( it does not have to be specified ), which is automatically filled in if not specified in an INS)+h�ings.
<p>Similarly there is a single binary datatype "binary" equivalent to varbinary(max) in MSSQL.
<p>Every table automaticg�ngle variable length string datatype "string" for unicode strings ( equivalent to nvarchar(max) in MSSOr 0 ), Year-Day, Year-Month-Day and string.
' 
EXEC web.Trailer()
END���渝'? dates - conversions betweent�splaying, editing arbitrary tables in the database.
<h3>date</h3><p>Has functions for manipulating dates - conversions betweens�for each web page.
<h3>htm</h3>
<p>Has functions related to encoding html.
<h3>browse</h3><p>Has tables and functions for di0r�b requests ( web.main ) and other functions related to handling web requests.
<h3>handler</h3>
<p>Has handler functions, one q�</h3>
<p>Has core system tables for language objects and related functions.
<h3>web</h3>
<p>Has the function that handles we!#p� to a table by ALTER TABLE.
<p>No triggers. No joins. No outer references.
<h2>Guide to the pre-defined schemas</h2>
<h3>syso� explicitly.
<p>No nulls. Columns are initialised to default a value if not specified by INSERT, or when new columns are added"&n�riables cannot be assigned in a DECLARE statement.
<p>No dO method=post>Us|�F uids != ''
  BEGIN
    DECLARE uid int SET uid = PARSEINT(uids)
    DECLARE hpwt binary SET hpwt = HashedPassword FROM log{�    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
  DECLARE hpwf string SET hpwf = web.Cookie('hpw')

  Iz�GIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.SetCookie( 'hpw', '' | hpw, '' )
      RETURN result
y�h( password|result )
    SET result = Id FROM login.user WHERE Id = result AND HashedPassword = hpw
    IF result > 0
    BEx�d = web.Form('password')
    SET result = Id FROM login.user WHERE Name = username
    DECLARE hpw binary SET hpw = login.hasw�ld be changed.
  */
  -- RETURN 1 -- Login disabled.

  IF username != ''
  BEGIN
    DECLARE password string SET passworv�ine below enable Login after Login password has been setup for some user.
     In addition, the salt string in login.Hash shouu� Days ( from yeaOssword')
    SET result = Id FROM login.user WHERE Name =��
     In addition, the salt string in login.Hash should be changed.
  */
  -- RETURN 1 -- Login disabled.

  IF username !=��in is initially disabled. Remove or comment out the line below enable Login after Login password has been setup for some user.
��ed in user. Note: role is not yet checked */

  DECLARE username string SET username = web.Form('username')

  /*
     Log��web.Main()�/EditFunc��b1�/ShowSchema?s=login�n�get�s�login��def��( role int ) RETURNS int AS
BEGIN
  /* Get the current loggEC web.Trailer()

  RETURN 0
ENDassword <input type=password name=password><br><input type=submit value=Login></form>'
  EXE~�er Name <input name=username><br>Password <input type=password name=password><br><input type=submit value=Login></form>'
  EXE}�in.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXEC web.Head( 'Login' )
  SELECT '<formS �bq�ted with the first bool expression which evaluates to true.
<h3>Literals</h3>
<p>String literals are written enclosed in singr�le quotes. If a single quote is needed in a string literal, it is written as two single quotes. Binary literals are written in t�are enclosed in square brackets and are case sensitive ( although language keywords such as CREATE SELECT are case insensitive,v�he name consists of only letters (A-Z,a-z).
<h3>Operators</h3>
<p>The operators ( all binary, except for - which can be unaryu� and are written without the square brackets, often in upper case only by convention ). The square brackets can be omitted if ts�hexadecimal preceded by 0x. Integers are a list of digits (0-9). The bool literals are true and false.
<h3>Names</h3><p>Names x�on and remainder (after division) of numbers. Remainder only applies to integers.</li>
<li>+ - : addition, subtraction of numby�ers.</li>
<li>| : concateSnation of string/binary values. The second expression is automatically converted to string/binary if 1w�, and NOT which is only unary ) in order of precedence, high to low, are as follows:
<ul>
<li>*  / % : multiplication, divisi��Days ( from year 0 ), Year-Day, Year-Month-Day and string.
' 
EXEC web.Trailer()
END���渜��~ dates - conversions between ��playing, editing arbitrary tables in the database.
<h3>date</h3><p>Has functions for manipulating dates - conversions between ��or each web page.
<h3>htm</h3>
<p>Has functions related to encoding html.
<h3>browse</h3><p>Has tables and functions for dis
�� requests ( web.main ) and other functions related to handling web requests.
<h3>handler</h3>
<p>Has handler functions, one f��/h3>
<p>Has core system tables for language objects and related functions.
<h3>web</h3>
<p>Has the function that handles web
��to a table by ALTER TABLE.
<p>No triggers. No joins. No outer refereMh2>Schema definition</h2>
<h3>CREATE SCHEMA</h3>
<p>CREA��eb.Head('Manual')
SELECT '<h1>Manual</h1>
<p>This manual describes the various SQL statements that are available. Where synta��web.Main()�/EditFunc��n�/Manual�s�handler��def�4�() AS BEGIN

DECLARE cu int SET cu = login.get(0) IF cu = 0 RETURN

EXEC w�anth-Day and string.
' 
EXEC web.Trailer()
ENDanipulating dates - conversions between Days ( from year 0 ), Year-Day, Year-Mo��e database.
<h3>date</h3><p>Has functions for manipulating dates - conversions between Days ( from year 0 ), Year-Day, Year-Mo�� functions related to encoding html.
<h3>browse</h3><p>Has tables and functions for displaying, editing arbitrary tables in th��ons related to handling web requests.
<h3>handler</h3>
<p>Has handler functions, one for each web page.
<h3>htm</h3>
<p>Has��guage objects and related functions.
<h3>web</h3>
<p>Has the function that handles web requests ( web.main ) aMnd other functi��ers. No joins. No outer references.
<h2>Guide to the pre-defined schemas</h2>
<h3>sys</h3>
<p>Has core system tables for lan��nitialised to default a value if not specified by INSERT, or when new columns are added to a table by ALTER TABLE.
<p>No trigg��statement.
<p>No default schemas. Schema of tables and functions must always be stated explicitly.
<p>No nulls. Columns are i��Name FROM sys.Schema WHERE Id = schema
<p>No cursors ( use FOR instead ).
<p>Local variables cannot be assigned in a DECLARE ��l variables cannot be assigned with SELECT, instead SET or FOR is used, can be FROM a table, e.g.
<p>DECLARE s string SET s = ��ELETE statements - WHERE true can be used if you really want to UPDATE or DELETE all rows. This is a "safety" feature.
<p>Loca��( an attempt to insert or assign a duplicate Id will raise an exception ). 
<p>WHERE condition is not optional in UPDATE and D��not have to be sMpecified ), which is automatically filled in if not specified in an INSERT statement. Id values must be unique ��nary datatype "binary" equivalent to varbinary(max) in MSSQL.
<p>Every table automatically gets an integer Id field ( it does ��ring" for unicode strings ( equivalent to nvarchar(max) in MSSQL ), no fixed length strings.
<p>Similarly there is a single bi0�� document the code.
<h2>Comparison with other SQL implementations</h2><p>There is a single variable length string datatype "st��he end of the line. Delimited comments start with /* and are terminated by */. Comments have no effect, they are simply to help!#��d from the database.
<h2>Comments</h2>
<p>There are two kinds of comments. Single line comments start with -- and extend to t�� in the table are also removed.
<h3>DROP INDEX</h3><p>DROP INDEX indexname ON schema.tablename<p>The specified index is remove"&��oved from the database. In the case of a SCHEMA, all objectMs in the SCHEMA are also removed. In the case of TABLE, all the rows��<h3>DROP object-type object-name</h3><p>object-type can be any one of SCHEMA,TABLE or FUNCTION.
<p>The specified object is rem%'��ers associated with a particular customer to be efficiently retrieved without scanning the entire order table.
<h2>Drop</h2>
��s other than by Id values. 
<p>For example, <br>CREATE INDEX ByCust ON dbo.Order(Cust) 
<br>creates an index allowing the ord$,��EATE INDEX indexname ON schema.tablename( Colname1, Colname2 ... )<p>Creates a new index. Indexes allow efficient access to row��rently the only implicit conversion is to string for operands of string concatenation.
<h2>Indexes
<h3>CREATE INDEX</h3><p>CR)+��the web schema for functions that can be used to access http requests.</li>
</ul>
<h3>Conversions</h3>
<p>To be decided. Cur��vity in shared data structures. Calling it while another process is updating the database may result iMn an exception.
<li>See *.��result is a string. Note: this needs exclusive access to the database to give consistent results, as it can observe update acti�� => an index, k in -4..-1 => byte storage files. 
<li>VERIFYDB() : verifies the logical page structure of the database. , the -/��pages. The result is an integer, the number of pages freed, or -1 if the table or index does not exist. k=0 => main file, k=1..��ith any error that occurred during an EXECUTE statement.</li>
<li>REPACKFILE(k,schema,table) : A file is re-packed to free up (4��eger from s.</li>
<li>PARSEFLOAT( s string ) : parses a floating point number from s.</li>
<li>EXCEPTION() returns a string w��/li>
<li>LASTID() : returns the last Id value allocated by an INSERT statement.</li>
<li>PARSEINT( s string ) : parses an int13��li>
<li>REPLACE( s string, pat string, sub string ) : returns a copy of s where every occurrence of pat is replaced with sub.<��g of sM from start (1-based) length len.</li>
<li>BINSUBSTRING( s binary, start int, len int ) : binary version of SUBSTRING.</28��the length of s, which must be a binary expression.</li> 
<li>SUBSTRING( s string, start int, len int ) : returns the substrin��<ul>
<li>LEN( s string ) : returns the length of s, which must be a string expression.</li>
<li>BINLEN( s binary ) : returns 57��rg is true )</li>
</ul>
<p>Brackets can be used where necessary, for example ( a + b ) * c.
<h3>Pre-defined functions</h3>
��i>AND : boolean operator ( result is true if both args are true )</li>
<li>OR : boolean operator  ( result is true if either a69��omparison of any data type.</li>
<li>NOT : boolean negation ( result is true if arg is false, false if arg is true ).</li>
<l:��ing/binary values. The second expression is automatically converted to string/binary if necessary.</li>
<li>= != > < >= <= : cN �t��mbers. Remainder only applies to integers.</li>
<li>+ - : addition, subtraction of numbers.</li>
<li>| : concatenation of str��r of precedence, high to low, are as follows:
<ul>
<li>*  / % : multiplication, division and remainder (after division) of nu��-z).
<h3>Operators</h3>
<p>The operators ( all binary, except for - which can be unary, and NOT which is only unary ) in orde��ckets, often in upper case only by convention ). The square brackets can be omitted if the name consists of only letters (A-Z,a�� case sensitive ( although language keywords such as CREATE SELECT are case insensitive, and are written without the square bra��e a list of digits (0-9). The bool literals are true and false.
<h3>Names</h3><p>Names are enclosed in square brackets and are��in a string literal, it is written as two single quotes. Binary literals are written in hexadecimal preceded by 0x. Integers ar��h evaluates to true.
<h3>NLiterals</h3>
<p>String literals are written enclosed in single quotes. If a single quote is needed �� THEN exp1 WHEN bool2 THEN exp2 .... ELSE exp END - the result is the expression associated with the first bool expression whic��d using operators, stored functions, pre-defined functions. There is also the CASE expression, which has syntax CASE WHEN bool1	��essions are composed from literals, named local variables, local parameters and named columns from tables. These may be combine��Checks that a function compiles ok. EXCEPTION() should be used to check if there is any error.

<h2>Expressions</h2>
<p>Expr
��e pre-defined local variable result can be assigned instead to set the return value.
<h3>CHECK</h3>
<p>CHECK schema.name
<p>��p>Returns a value from a stored function. RETURN with no expression returns from a stored function with no return value.
<p>Th
��atements END
<p>A stored function is created which can later be usedN in expressions.
<h3>RETURN</h3>
<p>RETURN expression
<��being set to the string.
<h3>CREATE FN</h3><p>CREATE FN schema.name ( param1 type1, param2 type2... ) RETURNS type AS BEGIN st��he database is left unchanged.
<h3>THROW</h3>
<p>THROW string-expression 
<p>An exception is raised, with the error message ��n be used to obtain a string describing the most recent exception (and clears the exception string). If any exception occurs, t��he supplied parameters.
<h3>Exceptions</h3><p>An exception will terminate the execution of a function or batch. EXCEPTION() ca��er be called by an EXEC statement.
<h3>EXEC</h3><p>EXEC schema.name( exp1, exp2 ... )
<p>The stored function is called with t��e ( param1 type1, param2 type2... ) AS BEGIN statements END
<p>A stored function ( no return value ) is created, which can lat��tatement may be used to signify the start of a new batch.
<h2>Stored Functions</h2>
<h3>CREATE FN</h3><p>CREATNE FN schema.nam��QL statements ).
<p>Note that database objects ( tables, function ) must be created in a prior batch before being used. A GO s��p>EXECUTE ( string-expression )
<p>Evaluates the string expression, and then executes the result ( which should be a list of S�� a colon (:)
<h3>BREAK</h3><p>BREAK
<p>Execution of the enclosing FOR or WHILE loop is terminated.
<h2>Batch execution</h2><��BREAK.
<h3>GOTO</h3><p>GOTO label
<p>Control is transferred to the labelled statement. A label consists of a name followed by��<h3>WHILE</h3><p>WHILE bool-exp Statement
<p>Statement is repeatedly executed as long as bool-exp evaluates to true. See also ��LSE Statement2 ]
<p>If bool-exp evaluates to true Statement1 is executed, otherwise Statement2 ( if specified ) is executed.
��ement can be used whenever a single statement is allowed.
<h3>IF .. THEN ... ELSE ...</h3>
<p>IF bool-exp THEN Statement1 [ E��h3>BEGIN .. END<N/h3><p>BEGIN Statement1 Statement2 ... END
<p>The statements are executed in order. A BEGIN..END compound stat��ition, with the named local variables being assigned expressions which depend on the rows.
<h2>Control flow statements</h2>
<��ORDER BY expressions] Statement
<p>Statement is repeatedly executed for each row from the table which satisfies the WHERE cond0��es of the local variables remain unchanged.
<h3>FOR</h3><p>FOR name1 = exp1, name2 = exp2 .... FROM table [ WHERE bool-exp ] [��ause is specified, the values are taken from a table row which satisfies the WHERE condition. If there is no such row, the valu!#��/h3>
<p>SET name1 = exp1, name2 = exp2 .... [ FROM table ] [ WHERE bool-exp ]
<p>Local variables are assigned. If the FROM cl��les are initialised to default values ( but only once, not each time the DECLARE is encountered if there is a loop ).
<h3>SET<"&��
<h3>DECLARE</h3><p>DECLARE name1 type1, name2 type2 ....
N<p>Local variables are declared with the specified types. The variab��ows in the table which satisfy the WHERE condition are removed.
<h2>Local variable declaration and assignment statements</h2>
%'��n the table which satisfy the WHERE condition are updated.
<h3>DELETE</h3><p>DELETE FROM schema.tablename WHERE bool-exp
<p>R��entual display. 
<h3>UPDATE</h3><p>UPDATE schema.tablename SET Colname1 = Exp1, Colname2 = Exp2 .... WHERE bool-exp
<p>Rows i$,��are passed to the code that invoked the batch, and may be displayed to a user or sent to a client for further processing and ev��cending order ).
<p>The SELECT expressions can be given names using AS.
<p>When used as a stand-alone statement, the results )+��and the WHERE and ORDER BY clauses.
<p>If the keyword DESC is placed after an ORDER BY expression, the order is reversed ( des��sions FROM source-table [WHERE bool-exp ] [ORDER BY expressions]
<p>A new table is computed, based onN the list of expressions *.��e. The values may be any expressions ( possibly involving local variables or function calls ).
<h3>SELECT</h3><p>SELECT expres��Colname1, Colname2 ... ) VALUES ( Val1, Val2... ) [,] ( Val3, Val4 ...) ...
<p>The specified values are inserted into the tabl-/��n be added again afterwards.
</ul>
<h2>Data manipulation statements</h2>
<h3>INSERT</h3>
<p>INSERT INTO schema.tablename ( ��i>
</ul>
<p>Note: currently, any indexes that have been added to a table need to be dropped before using ALTER TABLE. They ca(4��n of the number of bytes stored inline for binary and string.</li>
<li>DROP Colname : the column is removed from the table.</l��umn is changed. The only changes allowed are between the different sizes of integers, between float and double, and modificatio13��li>ADD Colname Coltype : a new column is added to the table.</li>
<li>MODIFY Colname Coltype : the datatype of an existing col��f a taNble.
<h3>ALTER TABLE</h3>
<p>ALTER TABLE schema.tablename action1, action2 .... <p>The actions are as follows:
<ul>
<28��iables and arithmetic operations are all 64 bits (8 bytes). The lower precision only applies when a value is stored in column o��length exceeds the reserved inline storage, meaning they are slightly slower to store and retrieve. Local float and integer var57�� string and binary, and false for the boolean type. The variable length data types are stored in a special system table if the �� : boolean ( true or false ).</li>
</ul>

<p>Each data type has a default value : zero for numbers, a zero length string for69��binary(n) : a variable length string of bytes. n (optional, default 15) specifies number of bytes stored inline.</li>
<li>bool:�� : a variable length string of unicode characters. n (optional, default 15) specifies number of bytes stored inline.</li>
<li>O �t��r. Default is 8 bytes.</li>
<li>float, double : floating point numbers of size 4 and 8 bytes respectively.</li>
<li>string(n)��SERT ( if no explicit value is supplied).<p>The data types are as follows:
<ul>
<li>int(n), 1 <= n <= 8. Signed n-byte intege��Coltype2, ... )
<p>Creates a new base table. Every base table is automatically given an Id column, which auto-increments on IN��al categories.
<h2>Table definition</h2>
<h3>CREATE TABLE</h3><p>CREATE TABLE schema.tablename ( Colname1 Coltype1, Colname2 ��ema. Every database object (Table, Function) has an associated schema. Schemas are used to organise database objects into logic��e enclosed in square brackets.
<h2>Schema definition</h2>
<h3>CREATE SCHEMA</h3>
<p>CREATE SCHEMA name
<p>Creates a new sch�c7f7a0aaced2e0875d84018a27640d4574�uid�1��渟x$N EXEC web.Trailer()

  RETURN 0
END��hpw�B0x46f65dd62c4b05e15071dc5a0e91429��rd><br><input type=submit Ovalue=Login></form>'
  EXEC web.Trailer()

  RETURN 0
END��hpw�B0x46f65dd62c4b05e15071dc5a0e91429��C web.Head( 'Login' )
  SELECT '<form method=post>User Name <input name=username><br>Password <input type=password name=passwo��ECLARE hpwt binary SET hpwt = HashedPassword FROM login.user WHERE Id = uid
    IF hpwf = '' | hpwt RETURN uid
  END

  EXE	��CLARE hpwf string SET hpwf = web.Cookie('hpw')

  IF uids != ''
  BEGIN
    DECLARE uid int SET uid = PARSEINT(uids)
    D��tCookie( 'hpw', '' | hpw, '' )
      RETURN result
    END
  END

  DECLARE uids string SET uids = web.Cookie('uid')
  DE
��t AND HashedPassword = hpw
    IF result > 0
    BEGIN
      EXEC web.SetCookie( 'uid', '' | result, '' )
      EXEC web.Se�� username
    DECLARE hpw binary SET hpw = login.hash( password|result )
    SET result = Id FROM login.user WHERE Id = resul
�� ''
  BEGIN
    DECLARE password string SET password = web.Form('pa