This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPileSchema.xsd
1270 lines (1087 loc) · 52.5 KB
/
PileSchema.xsd
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
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="PileSchema"
targetNamespace="http://pile-contributors.github.io/database/PileSchema.xsd"
elementFormDefault="qualified"
xmlns="http://pile-contributors.github.io/database/PileSchema.xsd"
xmlns:dbsm="http://pile-contributors.github.io/database/PileSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Helper Types -->
<xs:complexType name="parameterlessType" />
<xs:complexType name="identity">
<xs:annotation>
<xs:documentation xml:lang="en">The column containing this element is the identity column.</xs:documentation>
</xs:annotation>
<xs:attribute name="seed" use="optional" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="increment" use="optional" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">The increment step to use.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="notForReplication" use="optional" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:group name="withIdentity">
<xs:annotation>
<xs:documentation xml:lang="en">Elements part of this group may use the `identity` element.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="identity" minOccurs="0" maxOccurs="1" type="identity" />
</xs:sequence>
</xs:group>
<xs:attributeGroup name="withDefaultExpression">
<xs:annotation>
<xs:documentation xml:lang="en">Elements part of this group may use the `defaultExpression` attribute.</xs:documentation>
</xs:annotation>
<xs:attribute name="defaultExpression" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Default for a variable or column.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- INTEGER Types -->
<xs:complexType name="bit">
<xs:annotation>
<xs:documentation xml:lang="en">Boolean column data type.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="bool">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="tristateValues">
<xs:restriction base="xs:string">
<xs:enumeration value="true" />
<xs:enumeration value="false" />
<xs:enumeration value="undefined" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="tristate">
<xs:annotation>
<xs:documentation xml:lang="en">True(2), False (0) and Undefined(1).</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="tristateValues">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="char">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="int">
<xs:annotation>
<xs:documentation xml:lang="en">Common integer (int) column data type.</xs:documentation>
</xs:annotation>
<xs:group ref="withIdentity" />
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:int">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="int">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="bigint">
<xs:annotation>
<xs:documentation xml:lang="en">Large integer (long) column data type.</xs:documentation>
</xs:annotation>
<xs:group ref="withIdentity" />
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:long">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="long">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="smallint">
<xs:annotation>
<xs:documentation xml:lang="en">Small integer (short) column data type.</xs:documentation>
</xs:annotation>
<xs:group ref="withIdentity" />
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:short">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="short">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="tinyint">
<xs:annotation>
<xs:documentation xml:lang="en">Tiny integer (byte) column data type.</xs:documentation>
</xs:annotation>
<xs:group ref="withIdentity" />
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:byte">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="char">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="choiceItem">
<xs:annotation>
<xs:documentation xml:lang="en">One item in a predefined list
of choices.</xs:documentation>
</xs:annotation>
<xs:attribute name="id" use="required" type="xs:int">
<xs:annotation>
<xs:documentation xml:lang="en">Numeric value for this
item.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">String value for this
item.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="label" use="optional" type="xs:string" default="">
<xs:annotation>
<xs:documentation xml:lang="en">User-visible string for this
item (gets translated). If empty same value as the name
is assumed.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="choice">
<xs:annotation>
<xs:documentation xml:lang="en">One of a predefined list of
choices.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="item" maxOccurs="unbounded" minOccurs="1" type="choiceItem" />
</xs:sequence>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:int">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the
column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="int">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to
represent this column in a Qt source
file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- DECIMAL Types -->
<xs:simpleType name="mantissaBits">
<xs:annotation>
<xs:documentation xml:lang="en">Restriction on real
numbers to allow defining the float data
type.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="53" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="float">
<xs:annotation>
<xs:documentation xml:lang="en">Real number (float) column
data type.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="mantissaBits" use="optional" type="mantissaBits" />
<xs:attribute name="default" use="optional" type="xs:decimal" />
<xs:attribute name="qtype" use="optional" type="xs:string" default="float">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to
represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="real">
<xs:annotation>
<xs:documentation xml:lang="en">Real number (double) column
data type.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="double">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent
this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="decimal">
<xs:annotation>
<xs:documentation xml:lang="en">Real number (float) column data
type with precision and scale.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="precision" use="required" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Number of significant digits
after decimal dot.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="scale" use="required" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="default" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for
this column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="double">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent
this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="decimalScale0">
<xs:annotation>
<xs:documentation xml:lang="en">Real number (float) column data
type without a scale TODO: explain scale.</xs:documentation>
</xs:annotation>
<xs:group ref="withIdentity" />
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="precision" use="required" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">Number of significant digits
after decimal dot.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="default" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for
this column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="double">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent
this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- MONEY Types -->
<xs:simpleType name="moneydefault">
<xs:restriction base="xs:decimal">
<xs:totalDigits value="10" />
<xs:fractionDigits value="4" />
<xs:minInclusive value="-922337203685477.5808" />
<xs:maxInclusive value="922337203685477.5807" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="money">
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="moneydefault">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for
the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="smallmoneyDefault">
<xs:restriction base="xs:decimal">
<xs:totalDigits value="10" />
<xs:fractionDigits value="4" />
<xs:minInclusive value="-214748.3648" />
<xs:maxInclusive value="214748.3647" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="smallmoney">
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="smallmoneyDefault">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for
the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- STRING Types -->
<xs:attributeGroup name="withStringDefault">
<xs:annotation>
<xs:documentation xml:lang="en">Adds an default attribute of
type string to the element.</xs:documentation>
</xs:annotation>
<xs:attribute name="default" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for
the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:complexType name="parameterlessStringType">
<xs:annotation>
<xs:documentation xml:lang="en">String column data type.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attributeGroup ref="withStringDefault" />
<xs:attribute name="qtype" use="optional" type="xs:string" default="QString">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="GUID">
<xs:annotation>
<xs:documentation xml:lang="en">The representation of a GUID with restrictions added to validate input.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="uniqueidentifier">
<xs:annotation>
<xs:documentation xml:lang="en">A unique identifier (GUID).</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="GUID" />
<xs:attribute name="qtype" use="optional" type="xs:string" default="QString">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- DATE & TIME Types -->
<xs:simpleType name="fractionalSecondsPrecision">
<xs:annotation>
<xs:documentation xml:lang="en">Type to represent fractional seconds.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="7" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="variablePrecisionTime">
<xs:annotation>
<xs:documentation xml:lang="en">Date and time column data type.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attributeGroup ref="withStringDefault" />
<xs:attribute name="fractionalSecondsPrecision" use="optional" type="fractionalSecondsPrecision" />
<xs:attribute name="qtype" use="optional" type="xs:string" default="QTime">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="dateType">
<xs:annotation>
<xs:documentation xml:lang="en">A date (without time component).</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:date">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QDate">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="timeType">
<xs:annotation>
<xs:documentation xml:lang="en">A time (without date component).</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:time">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QTime">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="dateTimeType">
<xs:annotation>
<xs:documentation xml:lang="en">A date and a time.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attribute name="default" use="optional" type="xs:time">
<xs:annotation>
<xs:documentation xml:lang="en">Default value for the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QDateTime">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- CHAR Types -->
<xs:simpleType name="withMax">
<xs:annotation>
<xs:documentation xml:lang="en">Allows the use of `max` as a keyword in attribute.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="max" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="charInteger">
<xs:annotation>
<xs:documentation xml:lang="en">Allows as value an integer in 1-8000 range.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="8000" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="charLength">
<xs:annotation>
<xs:documentation xml:lang="en">Allowed values are `max` or an integer in 1-8000 range.</xs:documentation>
</xs:annotation>
<xs:union memberTypes="charInteger withMax" />
</xs:simpleType>
<xs:complexType name="char">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attributeGroup ref="withStringDefault" />
<xs:attribute name="length" use="optional" type="charLength">
<xs:annotation>
<xs:documentation xml:lang="en">The length may be an integer (1-8000) or it may be `max` to use the largest possible value.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QString">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="binary">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
<xs:attribute name="length" use="optional" type="charLength">
<xs:annotation>
<xs:documentation xml:lang="en">The length may be an integer (1-8000) or it may be `max` to use the largest possible value.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QByteArray">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="ncharInteger">
<xs:annotation>
<xs:documentation xml:lang="en">Allows as value an integer in 1-4000 range.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="4000" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ncharLength">
<xs:annotation>
<xs:documentation xml:lang="en">Restriction placed on the number of characters.</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ncharInteger withMax">
<xs:annotation>
<xs:documentation xml:lang="en">Allows as value an integer (1-4000) or `max`.</xs:documentation>
</xs:annotation>
</xs:union>
</xs:simpleType>
<xs:complexType name="nchar">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attributeGroup ref="withStringDefault" />
<xs:attribute name="length" use="optional" type="ncharLength">
<xs:annotation>
<xs:documentation xml:lang="en">Maximum number of characters (an integer in 1-4000 range) or `max` to use maximum length.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QByteArray">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="varchar">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: What is this?</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="withDefaultExpression" />
<xs:attributeGroup ref="withStringDefault" />
<xs:attribute name="length" use="optional" type="ncharLength">
<xs:annotation>
<xs:documentation xml:lang="en">Maximum number of characters (an integer in 1-4000 range) or `max` to use maximum length.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="qtype" use="optional" type="xs:string" default="QString">
<xs:annotation>
<xs:documentation xml:lang="en">The type to use to represent this column in a Qt source file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="vrtcol">
<xs:annotation>
<xs:documentation xml:lang="en">
This is a virtual column that presents values from another
table. The virtual column uses another, real column
to locate the table and the entry in the related model.
This element only indicates the source column in that table
and the label. The parent column element must provide
name, label and foreignInsert attributes.
</xs:documentation>
</xs:annotation>
<xs:attribute name="references" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">The name of the real column
that selects into a foreign table.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dynamic" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">Tells if the value for the
the cell requires a callback or is provided by the
database.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- Columns -->
<xs:complexType name="column">
<xs:annotation>
<xs:documentation xml:lang="en">
A column in a table.
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="1" maxOccurs="1">
<!-- Exact numerics -->
<xs:element name="bit" type="bit" />
<xs:element name="tristate" type="tristate" />
<xs:element name="int" type="int" />
<xs:element name="bigint" type="bigint" />
<xs:element name="smallint" type="smallint" />
<xs:element name="tinyint" type="tinyint" />
<xs:element name="choice" type="choice" />
<xs:element name="numeric" type="decimal" />
<xs:element name="decimal" type="decimal" />
<xs:element name="numericScale0" type="decimalScale0" />
<xs:element name="decimalScale0" type="decimalScale0" />
<xs:element name="smallmoney" type="smallmoney" />
<xs:element name="money" type="money" />
<!-- Approximate numerics -->
<xs:element name="float" type="float" />
<xs:element name="real" type="real" />
<!-- Date and time -->
<xs:element name="date" type="dateType" />
<xs:element name="datetime" type="dateTimeType" />
<xs:element name="time" type="timeType" />
<xs:element name="datetimeoffset" type="variablePrecisionTime" />
<xs:element name="datetime2" type="variablePrecisionTime" />
<xs:element name="smalldatetime" type="parameterlessStringType" />
<!--Character strings-->
<xs:element name="char" type="char" />
<xs:element name="varchar" type="varchar" />
<xs:element name="text" type="parameterlessStringType" />
<!--Unicode character strings-->
<xs:element name="nchar" type="nchar" />
<xs:element name="nvarchar" type="nchar" />
<xs:element name="ntext" type="parameterlessStringType" />
<!--Binary strings-->
<xs:element name="binary" type="binary" />
<xs:element name="varbinary" type="binary" />
<xs:element name="image" type="binary" />
<!--Other data types-->
<xs:element name="rowversion" type="parameterlessType" />
<xs:element name="hierarchyid" type="parameterlessStringType" />
<xs:element name="uniqueidentifier" type="uniqueidentifier" />
<xs:element name="sql_variant" type="parameterlessStringType" />
<xs:element name="xml" type="parameterlessStringType" />
<xs:element name="vrtcol" type="vrtcol" />
</xs:choice>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Name of this column as it will be known to the database.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="label" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">User visible string; if not
provided `name` is used.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="userformat" use="optional" type="xs:string" default="">
<xs:annotation>
<xs:documentation xml:lang="en"><p>Formatting options for when the value is presented to the user.</p>
<p>The content depends on the type of value:</p>
<dl>
<dt>bit:</dt>
<dd>May be Yes, yes, On, on, True, true or another string; in latter case the string is shown if the value is true (1) and is hidden if the value is false (0)</dd>
<dt>decimal, float, numeric, real, etc:</dt>
<dd><pre>fieldWidth`format`precision`fillChar</pre>
<p>Four values are used and are delimited by the ` character.</p>
<p><b>fieldWidth</b> is the minimum width of the generated text</p>
<p><b>format</b> can be e (format as [-]9.9e[+|-]999), E (format as [-]9.9E[+|-]999), f (format as [-]9.9), g (use e or f format, whichever is the most concise) and G (use E or f format, whichever is the most concise)</p>
<p><b>precision</b> number of digits after the decimal point or maximum number of significant digits</p>
<p><b>fillChar</b> is the character used to fill the space defined by <b>fieldWidth</b></p>
<p>For example <code>0`f`2` </code> will present number -1.25687 as <code>-1.26</code> </p>
</dd>
<dt>int, smallint, bigint, tinyint</dt>
<dd><pre>fieldWidth`base`fillChar</pre>
<p>Three values are used and are delimited by the ` character.</p>
<p><b>fieldWidth</b> is the minimum width of the generated text</p>
<p><b>base</b> numeric base</p>
<p><b>fillChar</b> is the character used to fill the space defined by <b>fieldWidth</b></p>
<p>For example <code>0`10` </code> will present number 1234 as <code>1234</code> </p>
</dd>
<dt>text, varchar, etc</dt>
<dd>The value of the format is used as input mask; see <a href="http://doc.qt.io/qt-5/qlineedit.html#inputMask-prop">inputMask</a>.</dd>
</dl>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="readOnly" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">Should the user be able to edit this column?.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="allowNulls" use="optional" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation xml:lang="en">Does this column allows NULL values or not?</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="foreignTable" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">If this column references a
column in another table, this is the name of that table.
This is the attribute to check if the column is a
foreign key or not.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="foreignColumn" use="optional" type="xs:string" default="id">
<xs:annotation>
<xs:documentation xml:lang="en">If this column references
a column in another table, this is the name of that
column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="foreignInsert" use="optional" type="xs:string" default="id">
<xs:annotation>
<xs:documentation xml:lang="en">If this column references a
column in another table, this attribute decides which column
get inserted into what is shown to the user in
place of the original column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="foreignBehavior" use="optional" default="choose">
<xs:annotation>
<xs:documentation xml:lang="en">This attribute hints
about the way this column interacts with the foreign table.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="choose">
<xs:annotation>
<xs:documentation xml:lang="en">The user can choose
from a predefined list of options provided by
the foreign table.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="chooseAdd">
<xs:annotation>
<xs:documentation xml:lang="en">The user may choose
from the predefined list but it may
also add new values that are going to be
inserted in the foreign table.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="columnList">
<xs:annotation>
<xs:documentation xml:lang="en">The list of columns for a table.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="column" maxOccurs="unbounded" minOccurs="1" type="column" />
</xs:choice>
</xs:complexType>
<!-- Constraints -->
<xs:simpleType name="sortOrder">
<xs:annotation>
<xs:documentation xml:lang="en">indicated the direction of the sorting for a column.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Ascending" />
<xs:enumeration value="Descending" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="constraintColumn">
<xs:annotation>
<xs:documentation xml:lang="en">A column that is part of a constraint.</xs:documentation>
</xs:annotation>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">The name of the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sortOrder" use="optional" type="sortOrder">
<xs:annotation>
<xs:documentation xml:lang="en">The order used to sort the column.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="constraint">
<xs:annotation>
<xs:documentation xml:lang="en">A column(s) based constraint.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="column" maxOccurs="unbounded" minOccurs="1" type="constraintColumn" />
</xs:sequence>
<xs:attribute name="name" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Name of the constraint.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="clustered" use="optional" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: what is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fillFactor" use="optional" type="xs:integer">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: what is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="padIndex" use="optional" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">TODO: what is this?</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="primaryKey">
<xs:annotation>
<xs:documentation xml:lang="en">The (optional) primary key for a table.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="key" maxOccurs="1" minOccurs="0" type="constraint" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="uniqueConstraints">
<xs:annotation>
<xs:documentation xml:lang="en">The list of unique constraints associated with a table.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="constraint" maxOccurs="unbounded" minOccurs="0" type="constraint" />
</xs:sequence>
</xs:complexType>
<!-- Indexes -->
<xs:complexType name="index">
<xs:annotation>
<xs:documentation xml:lang="en">One entry in the list of indexes in a table.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="constraint">
<xs:attribute name="unique" use="optional" type="xs:boolean" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="indexes">
<xs:annotation>
<xs:documentation xml:lang="en">The list of indexes in a table.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="index" maxOccurs="unbounded" minOccurs="0" type="index" />
</xs:sequence>
</xs:complexType>
<!-- Relationships -->
<xs:complexType name="relationshipColumn">
<xs:annotation>
<xs:documentation xml:lang="en">A column in a relationship.</xs:documentation>
</xs:annotation>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">Name of the column.</xs:documentation>
</xs:annotation>