File: db.py

package info (click to toggle)
pytango 10.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 10,216 kB
  • sloc: python: 28,206; cpp: 16,380; sql: 255; sh: 82; makefile: 43
file content (3036 lines) | stat: -rw-r--r-- 98,994 bytes parent folder | download | duplicates (3)
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
# SPDX-FileCopyrightText: All Contributors to the PyTango project
# SPDX-License-Identifier: LGPL-3.0-or-later

"""
This is an internal PyTango module.
"""

__all__ = ("db_init",)

__docformat__ = "restructuredtext"

import collections.abc

from tango._tango import (
    StdStringVector,
    Database,
    DbDatum,
    DbData,
    DbDevInfo,
    DbDevInfos,
    DbDevImportInfo,
    DbDevExportInfo,
    DbDevExportInfos,
    DbHistory,
    DbServerInfo,
    DbServerData,
)

from tango.utils import (
    _trace_client,
    is_pure_str,
    is_non_str_seq,
    seq_2_StdStringVector,
    seq_2_DbDevInfos,
    seq_2_DbDevExportInfos,
    seq_2_DbData,
    DbData_2_dict,
    obj_2_property,
    ensure_binary,
)
from tango.utils import document_method as __document_method


# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
# DbDatum extension
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-


def __DbDatum___setitem(self, k, v):
    self.value_string[k] = v


def __DbDatum___delitem(self, k):
    self.value_string.__delitem__(k)


def __DbDatum_append(self, v):
    self.value_string.append(v)


def __DbDatum_extend(self, v):
    self.value_string.extend(v)


def __DbDatum___imul(self, n):
    self.value_string *= n


def __init_DbDatum():
    DbDatum.__len__ = lambda self: len(self.value_string)
    DbDatum.__getitem__ = lambda self, k: self.value_string[k]
    DbDatum.__setitem__ = __DbDatum___setitem
    DbDatum.__delitem__ = __DbDatum___delitem
    DbDatum.__iter__ = lambda self: self.value_string.__iter__()
    DbDatum.__contains__ = lambda self, v: self.value_string.__contains__(v)
    DbDatum.__add__ = lambda self, seq: self.value_string + seq
    DbDatum.__mul__ = lambda self, n: self.value_string * n
    DbDatum.__imul__ = __DbDatum___imul
    DbDatum.append = __DbDatum_append
    DbDatum.extend = __DbDatum_extend


#    DbDatum.__str__      = __DbDatum___str__
#    DbDatum.__repr__      = __DbDatum___repr__

# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
# Database extension
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-


def __Database____init__(self, *args, **kwargs):
    return Database.__init_orig__(self, *args, **kwargs)


def __Database__add_server(self, servname, dev_info, with_dserver=False):
    """
    add_server( self, servname, dev_info, with_dserver=False) -> None

            Add a (group of) devices to the database. This is considered as a
            low level call because it may render the database inconsistent
            if it is not used properly.

            If *with_dserver* parameter is set to False (default), this
            call will only register the given dev_info(s). You should include
            in the list of dev_info an entry to the usually hidden **DServer**
            device.

            If *with_dserver* parameter is set to True, the call will add an
            additional **DServer** device if it is not included in the
            *dev_info* parameter.

        Example using *with_dserver=True*::

            dev_info1 = DbDevInfo()
            dev_info1.name = 'my/own/device'
            dev_info1._class = 'MyDevice'
            dev_info1.server = 'MyServer/test'
            db.add_server(dev_info1.server, dev_info1, with_dserver=True)

        Same example using *with_dserver=False*::

            dev_info1 = DbDevInfo()
            dev_info1.name = 'my/own/device'
            dev_info1._class = 'MyDevice'
            dev_info1.server = 'MyServer/test'

            dev_info2 = DbDevInfo()
            dev_info2.name = 'dserver/' + dev_info1.server
            dev_info2._class = 'DServer
            dev_info2.server = dev_info1.server

            dev_info = dev_info1, dev_info2
            db.add_server(dev_info1.server, dev_info)

        .. versionadded:: 8.1.7
            added *with_dserver* parameter

        Parameters :
            - servname : (str) server name
            - dev_info : (sequence<DbDevInfo> | DbDevInfos | DbDevInfo) containing the server device(s) information
            - with_dserver: (bool) whether or not to auto create **DServer** device in server
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """

    if not isinstance(dev_info, collections.abc.Sequence) and not isinstance(
        dev_info, DbDevInfo
    ):
        raise TypeError("Value must be a DbDevInfos, a seq<DbDevInfo> or a DbDevInfo")

    if isinstance(dev_info, DbDevInfos):
        pass
    elif isinstance(dev_info, DbDevInfo):
        dev_info = seq_2_DbDevInfos((dev_info,))
    else:
        dev_info = seq_2_DbDevInfos(dev_info)
    if with_dserver:
        has_dserver = False
        for i in dev_info:
            if i._class == "DServer":
                has_dserver = True
                break
        if not has_dserver:
            dserver_info = DbDevInfo()
            dserver_info.name = "dserver/" + dev_info[0].server
            dserver_info._class = "DServer"
            dserver_info.server = dev_info[0].server
            dev_info.append(dserver_info)
    self._add_server(servname, dev_info)


def __Database__export_server(self, dev_info):
    """
    export_server(self, dev_info) -> None

            Export a group of devices to the database.

        Parameters :
            - devinfo : (sequence<DbDevExportInfo> | DbDevExportInfos | DbDevExportInfo)
                        containing the device(s) to export information
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """

    if not isinstance(dev_info, collections.abc.Sequence) and not isinstance(
        dev_info, DbDevExportInfo
    ):
        raise TypeError(
            "Value must be a DbDevExportInfos, a seq<DbDevExportInfo> or "
            "a DbDevExportInfo"
        )

    if isinstance(dev_info, DbDevExportInfos):
        pass
    elif isinstance(dev_info, DbDevExportInfo):
        dev_info = seq_2_DbDevExportInfos(
            (dev_info),
        )
    else:
        dev_info = seq_2_DbDevExportInfos(dev_info)
    self._export_server(dev_info)


def __generic_get_property(obj_name, value, f):
    ret = None
    if isinstance(value, DbData):
        new_value = value
    elif isinstance(value, DbDatum):
        new_value = DbData()
        new_value.append(value)
    elif is_pure_str(value):
        new_value = DbData()
        new_value.append(DbDatum(value))
    elif isinstance(value, collections.abc.Sequence):
        new_value = DbData()
        for e in value:
            if isinstance(e, DbDatum):
                new_value.append(e)
            else:
                e = ensure_binary(e, "latin-1")
                new_value.append(DbDatum(e))
    elif isinstance(value, collections.abc.Mapping):
        new_value = DbData()
        for k, v in value.items():
            if isinstance(v, DbDatum):
                new_value.append(v)
            else:
                new_value.append(DbDatum(k))
        ret = value
    else:
        raise TypeError(
            "Value must be a string, tango.DbDatum, "
            "tango.DbData, a sequence or a dictionary"
        )

    f(obj_name, new_value)
    if ret is None:
        ret = {}

    return new_value, ret


def __Database__generic_get_property(self, obj_name, value, f):
    """internal usage"""

    new_value, ret = __generic_get_property(obj_name, value, f)
    return DbData_2_dict(new_value, ret)


def __Database__generic_put_property(self, obj_name, value, f):
    """internal usage"""
    value = obj_2_property(value)
    return f(obj_name, value)


def __Database__generic_delete_property(self, obj_name, value, f):
    """internal usage"""
    if isinstance(value, DbData):
        new_value = value
    elif isinstance(value, DbDatum):
        new_value = DbData()
        new_value.append(value)
    elif is_pure_str(value):
        new_value = DbData()
        value = ensure_binary(value, "latin-1")
        new_value.append(DbDatum(value))
    elif isinstance(value, collections.abc.Sequence):
        new_value = DbData()
        for e in value:
            if isinstance(e, DbDatum):
                new_value.append(e)
            else:
                e = ensure_binary(e, "latin-1")
                new_value.append(DbDatum(e))
    elif isinstance(value, collections.abc.Mapping):
        new_value = DbData()
        for k, v in value.items():
            if isinstance(v, DbDatum):
                new_value.append(v)
            else:
                new_value.append(DbDatum(k))
    else:
        raise TypeError(
            "Value must be a string, tango.DbDatum, "
            "tango.DbData, a sequence or a dictionary"
        )

    return f(obj_name, new_value)


def __Database__generic_get_attr_pipe_property(self, obj_name, value, f):
    """internal usage for class or device attribute and pipe properties."""

    new_value, ret = __generic_get_property(obj_name, value, f)
    nb_items = len(new_value)
    i = 0
    while i < nb_items:
        db_datum = new_value[i]
        curr_dict = {}
        ret[db_datum.name] = curr_dict
        nb_props = int(db_datum[0])
        i += 1
        for k in range(nb_props):
            db_datum = new_value[i]
            curr_dict[db_datum.name] = db_datum.value_string
            i += 1

    return ret


def __Database__generic_put_attr_pipe_property(self, obj_name, value, f):
    """internal usage for class or device attribute and pipe properties."""
    if isinstance(value, DbData):
        new_value = value
    elif is_non_str_seq(value):
        new_value = seq_2_DbData(value)
    elif isinstance(value, collections.abc.Mapping):
        new_value = DbData()
        for k1, v1 in value.items():
            attr = DbDatum(k1)
            attr.append(str(len(v1)))
            new_value.append(attr)
            for k2, v2 in v1.items():
                if isinstance(v2, DbDatum):
                    new_value.append(v2)
                    continue
                db_datum = DbDatum(k2)
                if is_non_str_seq(v2):
                    seq_2_StdStringVector(v2, db_datum.value_string)
                else:
                    if not is_pure_str(v2):
                        v2 = repr(v2)
                    db_datum.value_string.append(v2)
                new_value.append(db_datum)
    else:
        raise TypeError(
            "Value must be a tango.DbData, a sequence<DbDatum> or a dictionary"
        )

    return f(obj_name, new_value)


def __Database__generic_delete_attr_pipe_property(self, obj_name, value, f):
    """internal usage for class or device attribute and pipe properties."""
    if isinstance(value, DbData):
        f(obj_name, value)
    elif is_non_str_seq(value):
        f(obj_name, seq_2_DbData(value))
    elif isinstance(value, collections.abc.Mapping):
        for attr_pipe_name, properties in value.items():
            new_value = DbData()
            new_value.append(DbDatum(attr_pipe_name))
            for prop in properties:
                new_value.append(DbDatum(prop))
            f(obj_name, new_value)
    else:
        raise TypeError(
            "Value must be a string, tango.DbDatum, "
            "tango.DbData, a sequence or a dictionary"
        )


def __Database__put_property(self, obj_name, value):
    """
    put_property(self, obj_name, value) -> None

        Insert or update a list of properties for the specified object.

    Parameters :
        - obj_name : (str) object name
        - value : can be one of the following:

            1. DbDatum - single property data to be inserted
            2. DbData - several property data to be inserted
            3. sequence<DbDatum> - several property data to be inserted
            4. dict<str, DbDatum> - keys are property names and value has data to be inserted
            5. dict<str, obj> - keys are property names and str(obj) is property value
            6. dict<str, seq<str>> - keys are property names and value has data to be inserted
    Return     : None

    Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """

    return __Database__generic_put_property(self, obj_name, value, self._put_property)


def __Database__get_property(self, obj_name, value):
    """
    get_property(self, obj_name, value) -> dict<str, seq<str>>

            Query the database for a list of object (i.e non-device) properties.

        Parameters :
            - obj_name : (str) object name
            - value : can be one of the following:

                1. str [in] - single property data to be fetched
                2. DbDatum [in] - single property data to be fetched
                3. DbData [in,out] - several property data to be fetched
                   In this case (direct C++ API) the DbData will be filled with
                   the property values
                4. sequence<str> [in] - several property data to be fetched
                5. sequence<DbDatum> [in] - several property data to be fetched
                6. dict<str, obj> [in,out] - keys are property names
                   In this case the given dict values will be changed to contain
                   the several property values

        Return     : a dictionary which keys are the property names the value
                     associated with each key being a a sequence of strings being
                     the property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_property(self, obj_name, value, self._get_property)


def __Database__get_property_forced(self, obj_name, value):
    return __Database__generic_get_property(
        self, obj_name, value, self._get_property_forced
    )


__Database__get_property_forced.__doc__ = __Database__get_property.__doc__


def __Database__delete_property(self, obj_name, value):
    """
    delete_property(self, obj_name, value) -> None

            Delete a the given of properties for the specified object.

        Parameters :
            - obj_name : (str) object name
            - value : can be one of the following:

                1. str [in] - single property data to be deleted
                2. DbDatum [in] - single property data to be deleted
                3. DbData [in] - several property data to be deleted
                4. sequence<string> [in]- several property data to be deleted
                5. sequence<DbDatum> [in] - several property data to be deleted
                6. dict<str, obj> [in] - keys are property names to be deleted
                   (values are ignored)
                7. dict<str, DbDatum> [in] - several DbDatum.name are property names
                   to be deleted (keys are ignored)
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_delete_property(
        self, obj_name, value, self._delete_property
    )


def __Database__get_device_property(self, dev_name, value):
    """
    get_device_property(self, dev_name, value) -> dict<str, seq<str>>

        Query the database for a list of device properties.

        Parameters :
            - dev_name : (str) object name
            - value : can be one of the following:

                1. str [in] - single property data to be fetched
                2. DbDatum [in] - single property data to be fetched
                3. DbData [in,out] - several property data to be fetched
                   In this case (direct C++ API) the DbData will be filled with
                   the property values
                4. sequence<str> [in] - several property data to be fetched
                5. sequence<DbDatum> [in] - several property data to be fetched
                6. dict<str, obj> [in,out] - keys are property names
                   In this case the given dict values will be changed to contain
                   the several property values

        Return     : a dictionary which keys are the property names the value
                    associated with each key being a a sequence of strings being the
                    property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_property(
        self, dev_name, value, self._get_device_property
    )


def __Database__put_device_property(self, dev_name, value):
    """
    put_device_property(self, dev_name, value) -> None

        Insert or update a list of properties for the specified device.

        Parameters :
            - dev_name : (str) object name
            - value : can be one of the following:

                1. DbDatum - single property data to be inserted
                2. DbData - several property data to be inserted
                3. sequence<DbDatum> - several property data to be inserted
                4. dict<str, DbDatum> - keys are property names and value has data to be inserted
                5. dict<str, obj> - keys are property names and str(obj) is property value
                6. dict<str, seq<str>> - keys are property names and value has data to be inserted
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_property(
        self, dev_name, value, self._put_device_property
    )


def __Database__delete_device_property(self, dev_name, value):
    """
    delete_device_property(self, dev_name, value) -> None

        Delete a the given of properties for the specified device.

        Parameters :
            - dev_name : (str) object name
            - value : can be one of the following:
                1. str [in] - single property data to be deleted
                2. DbDatum [in] - single property data to be deleted
                3. DbData [in] - several property data to be deleted
                4. sequence<str> [in]- several property data to be deleted
                5. sequence<DbDatum> [in] - several property data to be deleted
                6. dict<str, obj> [in] - keys are property names to be deleted (values are ignored)
                7. dict<str, DbDatum> [in] - several DbDatum.name are property names to be deleted (keys are ignored)

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_delete_property(
        self, dev_name, value, self._delete_device_property
    )


def __Database__get_device_property_list(self, dev_name, wildcard, array=None):
    """
    get_device_property_list(self, dev_name, wildcard, array=None) -> DbData

            Query the database for a list of properties defined for the
            specified device and which match the specified wildcard.
            If array parameter is given, it must be an object implementing de 'append'
            method. If given, it is filled with the matching property names. If not given
            the method returns a new DbDatum containing the matching property names.

        New in PyTango 7.0.0

        Parameters :
            - dev_name : (str) device name
            - wildcard : (str) property name wildcard
            - array : [out] (sequence) (optional) array that
                          will contain the matching property names.
        Return     : if container is None, return is a new DbDatum containing the
                     matching property names. Otherwise returns the given array
                     filled with the property names

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device"""
    if array is None:
        return self._get_device_property_list(dev_name, wildcard)
    elif isinstance(array, StdStringVector):
        return self._get_device_property_list(dev_name, wildcard, array)
    elif is_non_str_seq(array):
        res = self._get_device_property_list(dev_name, wildcard)
        for e in res:
            array.append(e)
        return array


def __Database__get_device_attribute_property(self, dev_name, value):
    """
    get_device_attribute_property(self, dev_name, value) -> dict<str, dict<str, seq<str>>>

            Query the database for a list of device attribute properties for the
            specified device. The method returns all the properties for the specified
            attributes.

        Parameters :
            - dev_name : (string) device name
            - value : can be one of the following:

                1. str [in] - single attribute properties to be fetched
                2. DbDatum [in] - single attribute properties to be fetched
                3. DbData [in,out] - several attribute properties to be fetched
                   In this case (direct C++ API) the DbData will be filled with
                   the property values
                4. sequence<str> [in] - several attribute properties to be fetched
                5. sequence<DbDatum> [in] - several attribute properties to be fetched
                6. dict<str, obj> [in,out] - keys are attribute names
                   In this case the given dict values will be changed to contain the
                   several attribute property values

        Return     :  a dictionary which keys are the attribute names the
                             value associated with each key being a another
                             dictionary where keys are property names and value is
                             a DbDatum containing the property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_attr_pipe_property(
        self, dev_name, value, self._get_device_attribute_property
    )


def __Database__get_device_pipe_property(self, dev_name, value):
    """
    get_device_pipe_property(self, dev_name, value) -> dict<str, dict<str, seq<str>>>

            Query the database for a list of device pipe properties for the
            specified device. The method returns all the properties for the specified
            pipes.

        Parameters :
            - dev_name : (string) device name
            - value : can be one of the following:

                1. str [in] - single pipe properties to be fetched
                2. DbDatum [in] - single pipe properties to be fetched
                3. DbData [in,out] - several pipe properties to be fetched
                   In this case (direct C++ API) the DbData will be filled with
                   the property values
                4. sequence<str> [in] - several pipe properties to be fetched
                5. sequence<DbDatum> [in] - several pipe properties to be fetched
                6. dict<str, obj> [in,out] - keys are pipe names
                   In this case the given dict values will be changed to contain the
                   several pipe property values

        Return     :  a dictionary which keys are the pipe names the
                             value associated with each key being a another
                             dictionary where keys are property names and value is
                             a DbDatum containing the property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_attr_pipe_property(
        self, dev_name, value, self._get_device_pipe_property
    )


def __Database__put_device_attribute_property(self, dev_name, value):
    """
    put_device_attribute_property( self, dev_name, value) -> None

            Insert or update a list of properties for the specified device.

        Parameters :
            - dev_name : (str) device name
            - value : can be one of the following:

                1. DbData - several property data to be inserted
                2. sequence<DbDatum> - several property data to be inserted
                3. dict<str, dict<str, obj>> keys are attribute names and value being another
                   dictionary which keys are the attribute property names and the value
                   associated with each key being:

                   3.1 seq<str>
                   3.2 tango.DbDatum

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_attr_pipe_property(
        self, dev_name, value, self._put_device_attribute_property
    )


def __Database__put_device_pipe_property(self, dev_name, value):
    """
    put_device_pipe_property( self, dev_name, value) -> None

            Insert or update a list of properties for the specified device.

        Parameters :
            - dev_name : (str) device name
            - value : can be one of the following:

                1. DbData - several property data to be inserted
                2. sequence<DbDatum> - several property data to be inserted
                3. dict<str, dict<str, obj>> keys are pipe names and value being another
                   dictionary which keys are the pipe property names and the value
                   associated with each key being:

                   3.1 seq<str>
                   3.2 tango.DbDatum

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_attr_pipe_property(
        self, dev_name, value, self._put_device_pipe_property
    )


def __Database__delete_device_attribute_property(self, dev_name, value):
    """
    delete_device_attribute_property(self, dev_name, value) -> None

            Delete a list of attribute properties for the specified device.

        Parameters :
            - devname : (string) device name
            - propnames : can be one of the following:
                1. DbData [in] - several property data to be deleted
                2. sequence<str> [in]- several property data to be deleted
                3. sequence<DbDatum> [in] - several property data to be deleted
                3. dict<str, seq<str>> with each key an attribute name and the value a list of attribute property names to delete from that attribute

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_delete_attr_pipe_property(
        self, dev_name, value, self._delete_device_attribute_property
    )


def __Database__delete_device_pipe_property(self, dev_name, value):
    """
    delete_device_pipe_property(self, dev_name, value) -> None

            Delete a list of pipe properties for the specified device.

        Parameters :
            - devname : (string) device name
            - propnames : can be one of the following:
                1. DbData [in] - several property data to be deleted
                2. sequence<str> [in]- several property data to be deleted
                3. sequence<DbDatum> [in] - several property data to be deleted
                3. dict<str, seq<str>> with each key a pipe name and the value a list of pipe property names to delete from that pipe

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_delete_attr_pipe_property(
        self, dev_name, value, self._delete_device_pipe_property
    )


def __Database__get_class_property(self, class_name, value):
    """
    get_class_property(self, class_name, value) -> dict<str, seq<str>>

            Query the database for a list of class properties.

        Parameters :
            - class_name : (str) class name
            - value : can be one of the following:

                1. str [in] - single property data to be fetched
                2. tango.DbDatum [in] - single property data to be fetched
                3. tango.DbData [in,out] - several property data to be fetched
                   In this case (direct C++ API) the DbData will be filled with
                   the property values
                4. sequence<str> [in] - several property data to be fetched
                5. sequence<DbDatum> [in] - several property data to be fetched
                6. dict<str, obj> [in,out] - keys are property names
                   In this case the given dict values will be changed to contain
                   the several property values

        Return     : a dictionary which keys are the property names the value
                     associated with each key being a a sequence of strings being the
                     property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_property(
        self, class_name, value, self._get_class_property
    )


def __Database__put_class_property(self, class_name, value):
    """
    put_class_property(self, class_name, value) -> None

            Insert or update a list of properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - value : can be one of the following:
                1. DbDatum - single property data to be inserted
                2. DbData - several property data to be inserted
                3. sequence<DbDatum> - several property data to be inserted
                4. dict<str, DbDatum> - keys are property names and value has data to be inserted
                5. dict<str, obj> - keys are property names and str(obj) is property value
                6. dict<str, seq<str>> - keys are property names and value has data to be inserted
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_property(
        self, class_name, value, self._put_class_property
    )


def __Database__delete_class_property(self, class_name, value):
    """
    delete_class_property(self, class_name, value) -> None

            Delete a the given of properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - value : can be one of the following:

                1. str [in] - single property data to be deleted
                2. DbDatum [in] - single property data to be deleted
                3. DbData [in] - several property data to be deleted
                4. sequence<str> [in]- several property data to be deleted
                5. sequence<DbDatum> [in] - several property data to be deleted
                6. dict<str, obj> [in] - keys are property names to be deleted
                   (values are ignored)
                7. dict<str, DbDatum> [in] - several DbDatum.name are property names
                   to be deleted (keys are ignored)

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_delete_property(
        self, class_name, value, self._delete_class_property
    )


def __Database__get_class_attribute_property(self, class_name, value):
    """
    get_class_attribute_property( self, class_name, value) -> dict<str, dict<str, seq<str>>

            Query the database for a list of class attribute properties for the
            specified class. The method returns all the properties for the specified
            attributes.

        Parameters :
            - class_name : (str) class name
            - propnames : can be one of the following:

                1. str [in] - single attribute properties to be fetched
                2. DbDatum [in] - single attribute properties to be fetched
                3. DbData [in,out] - several attribute properties to be fetched
                   In this case (direct C++ API) the DbData will be filled with the property
                   values
                4. sequence<str> [in] - several attribute properties to be fetched
                5. sequence<DbDatum> [in] - several attribute properties to be fetched
                6. dict<str, obj> [in,out] - keys are attribute names
                   In this case the given dict values will be changed to contain the several
                   attribute property values

        Return     : a dictionary which keys are the attribute names the
                     value associated with each key being a another
                     dictionary where keys are property names and value is
                     a sequence of strings being the property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_attr_pipe_property(
        self, class_name, value, self._get_class_attribute_property
    )


def __Database__get_class_pipe_property(self, class_name, value):
    """
    get_class_pipe_property( self, class_name, value) -> dict<str, dict<str, seq<str>>

            Query the database for a list of class pipe properties for the
            specified class. The method returns all the properties for the specified
            pipes.

        Parameters :
            - class_name : (str) class name
            - propnames : can be one of the following:

                1. str [in] - single pipe properties to be fetched
                2. DbDatum [in] - single pipe properties to be fetched
                3. DbData [in,out] - several pipe properties to be fetched
                   In this case (direct C++ API) the DbData will be filled with the property
                   values
                4. sequence<str> [in] - several pipe properties to be fetched
                5. sequence<DbDatum> [in] - several pipe properties to be fetched
                6. dict<str, obj> [in,out] - keys are pipe names
                   In this case the given dict values will be changed to contain the several
                   pipe property values

        Return     : a dictionary which keys are the pipe names the
                     value associated with each key being a another
                     dictionary where keys are property names and value is
                     a sequence of strings being the property value.

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_get_attr_pipe_property(
        self, class_name, value, self._get_class_pipe_property
    )


def __Database__put_class_attribute_property(self, class_name, value):
    """
    put_class_attribute_property(self, class_name, value) -> None

            Insert or update a list of properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - propdata : can be one of the following:

                1. tango.DbData - several property data to be inserted
                2. sequence<DbDatum> - several property data to be inserted
                3. dict<str, dict<str, obj>> keys are attribute names and value
                   being another dictionary which keys are the attribute property
                   names and the value associated with each key being:

                   3.1 seq<str>
                   3.2 tango.DbDatum

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_attr_pipe_property(
        self, class_name, value, self._put_class_attribute_property
    )


def __Database__put_class_pipe_property(self, class_name, value):
    """
    put_class_pipe_property(self, class_name, value) -> None

            Insert or update a list of properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - propdata : can be one of the following:

                1. tango.DbData - several property data to be inserted
                2. sequence<DbDatum> - several property data to be inserted
                3. dict<str, dict<str, obj>> keys are pipe names and value
                   being another dictionary which keys are the pipe property
                   names and the value associated with each key being:

                   3.1 seq<str>
                   3.2 tango.DbDatum

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """
    return __Database__generic_put_attr_pipe_property(
        self, class_name, value, self._put_class_pipe_property
    )


def __Database__delete_class_attribute_property(self, class_name, value):
    """
    delete_class_attribute_property(self, class_name, value) -> None

            Delete a list of attribute properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - propnames : can be one of the following:

                1. DbData [in] - several property data to be deleted
                2. sequence<str> [in]- several property data to be deleted
                3. sequence<DbDatum> [in] - several property data to be deleted
                4. dict<str, seq<str>> keys are attribute names and value being a
                   list of attribute property names

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed
                     DevFailed from device (DB_SQLError)"""
    return __Database__generic_delete_attr_pipe_property(
        self, class_name, value, self._delete_class_attribute_property
    )


def __Database__delete_class_pipe_property(self, class_name, value):
    """
    delete_class_pipe_property(self, class_name, value) -> None

            Delete a list of pipe properties for the specified class.

        Parameters :
            - class_name : (str) class name
            - propnames : can be one of the following:

                1. DbData [in] - several property data to be deleted
                2. sequence<str> [in]- several property data to be deleted
                3. sequence<DbDatum> [in] - several property data to be deleted
                4. dict<str, seq<str>> keys are pipe names and value being a
                   list of pipe property names

        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed
                     DevFailed from device (DB_SQLError)"""
    return __Database__generic_delete_attr_pipe_property(
        self, class_name, value, self._delete_class_pipe_property
    )


def __Database__get_service_list(self, filter=".*"):
    import re

    data = self.get_property("CtrlSystem", "Services")
    res = {}
    filter_re = re.compile(filter)
    for service in data["Services"]:
        service_name, service_value = service.split(":")
        if filter_re.match(service_name) is not None:
            res[service_name] = service_value
    return res


def __Database__str(self):
    return f"Database({self.get_db_host()}, {self.get_db_port()})"


def __init_Database():
    Database.__init_orig__ = Database.__init__
    Database.__init__ = _trace_client(__Database____init__)
    Database.add_server = _trace_client(__Database__add_server)
    Database.export_server = _trace_client(__Database__export_server)
    Database.put_property = _trace_client(__Database__put_property)
    Database.get_property = _trace_client(__Database__get_property)
    Database.get_property_forced = _trace_client(__Database__get_property_forced)
    Database.delete_property = _trace_client(__Database__delete_property)
    Database.get_device_property = _trace_client(__Database__get_device_property)
    Database.put_device_property = _trace_client(__Database__put_device_property)
    Database.delete_device_property = _trace_client(__Database__delete_device_property)
    Database.get_device_property_list = _trace_client(
        __Database__get_device_property_list
    )
    Database.get_device_attribute_property = _trace_client(
        __Database__get_device_attribute_property
    )
    Database.get_device_pipe_property = _trace_client(
        __Database__get_device_pipe_property
    )
    Database.put_device_attribute_property = _trace_client(
        __Database__put_device_attribute_property
    )
    Database.put_device_pipe_property = _trace_client(
        __Database__put_device_pipe_property
    )
    Database.delete_device_attribute_property = _trace_client(
        __Database__delete_device_attribute_property
    )
    Database.delete_device_pipe_property = _trace_client(
        __Database__delete_device_pipe_property
    )
    Database.get_class_property = _trace_client(__Database__get_class_property)
    Database.put_class_property = _trace_client(__Database__put_class_property)
    Database.delete_class_property = _trace_client(__Database__delete_class_property)
    Database.get_class_attribute_property = _trace_client(
        __Database__get_class_attribute_property
    )
    Database.get_class_pipe_property = _trace_client(
        __Database__get_class_pipe_property
    )
    Database.put_class_attribute_property = _trace_client(
        __Database__put_class_attribute_property
    )
    Database.put_class_pipe_property = _trace_client(
        __Database__put_class_pipe_property
    )
    Database.delete_class_attribute_property = _trace_client(
        __Database__delete_class_attribute_property
    )
    Database.delete_class_pipe_property = _trace_client(
        __Database__delete_class_pipe_property
    )
    Database.get_service_list = _trace_client(__Database__get_service_list)
    Database.__str__ = __Database__str
    Database.__repr__ = __Database__str


def __doc_Database():
    def document_method(method_name, desc, append=True):
        return __document_method(Database, method_name, desc, append)

    Database.__doc__ = """
    Database is the high level Tango object which contains the link to the static database.
    Database provides methods for all database commands : get_device_property(),
    put_device_property(), info(), etc..
    To create a Database, use the default constructor. Example::

        db = Database()

    The constructor uses the TANGO_HOST env. variable to determine which
    instance of the Database to connect to.

    If TANGO_HOST env is not set, or you want to connect to a specific database, you can provide host and port to constructor:

         db = Database(host: str, port: int)

         or:

         db = Database(host: str, port: str)

    Alternatively, it is possible to start Database using file instead of a real database:

        db = Database(filename: str)

    """

    document_method(
        "write_filedatabase",
        """
    write_filedatabase(self) -> None

            Force a write to the file if using a file based database.

        Parameters : None
        Return     : None

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "reread_filedatabase",
        """
    reread_filedatabase(self) -> None

            Force a complete refresh over the database if using a file based database.

        Parameters : None
        Return     : None

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "build_connection",
        """
    build_connection(self) -> None

            Tries to build a connection to the Database server.

        Parameters : None
        Return     : None

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "check_tango_host",
        """
    check_tango_host(self, tango_host_env) -> None

            Check the TANGO_HOST environment variable syntax and extract
            database server host(s) and port(s) from it.

        Parameters :
            - tango_host_env : (str) The TANGO_HOST env. variable value
        Return     : None

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "check_access_control",
        """
    check_access_control(self, dev_name) -> AccessControlType

            Check the access for the given device for this client.

        Parameters :
            - dev_name : (str) device name
        Return     : the access control type as a AccessControlType object

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "is_control_access_checked",
        """
    is_control_access_checked(self) -> bool

            Returns True if control access is checked or False otherwise.

        Parameters : None
        Return     : (bool) True if control access is checked or False

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "set_access_checked",
        """
    set_access_checked(self, val) -> None

            Sets or unsets the control access check.

        Parameters :
            - val : (bool) True to set or False to unset the access control
        Return     : None

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_access_except_errors",
        """
    get_access_except_errors(self) -> DevErrorList

            Returns a reference to the control access exceptions.

        Parameters : None
        Return     : DevErrorList

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "is_multi_tango_host",
        """
    is_multi_tango_host(self) -> bool

            Returns if in multi tango host.

        Parameters : None
        Return     : True if multi tango host or False otherwise

        New in PyTango 7.1.4
    """,
    )

    document_method(
        "get_file_name",
        """
    get_file_name(self) -> str

            Returns the database file name or throws an exception
            if not using a file database

        Parameters : None
        Return     : a string containing the database file name

        Throws     : DevFailed

        New in PyTango 7.2.0
    """,
    )

    document_method(
        "get_info",
        """
    get_info(self) -> str

            Query the database for some general info about the tables.

        Parameters : None
        Return     : a multiline string
    """,
    )

    document_method(
        "get_host_list",
        """
    get_host_list(self) -> DbDatum
    get_host_list(self, wildcard) -> DbDatum

            Returns the list of all host names registered in the database.

        Parameters :
            - wildcard : (str) (optional) wildcard (eg: 'l-c0*')
        Return     : DbDatum with the list of registered host names
    """,
    )

    document_method(
        "get_services",
        """
    get_services(self, serv_name, inst_name) -> DbDatum

            Query database for specified services.

        Parameters :
            - serv_name : (str) service name
            - inst_name : (str) instance name (can be a wildcard character ('*'))
        Return     : DbDatum with the list of available services

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_device_service_list",
        """
    get_device_service_list(self, dev_name) -> DbDatum

            Query database for the list of services provided by the given device.

        Parameters :
            - dev_name : (str) device name
        Return     : DbDatum with the list of services

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "register_service",
        """
    register_service(self, serv_name, inst_name, dev_name) -> None

            Register the specified service wihtin the database.

        Parameters :
            - serv_name : (str) service name
            - inst_name : (str) instance name
            - dev_name : (str) device name
        Return     : None

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "unregister_service",
        """
    unregister_service(self, serv_name, inst_name) -> None

            Unregister the specified service from the database.

        Parameters :
            - serv_name : (str) service name
            - inst_name : (str) instance name
        Return     : None

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "add_device",
        """
    add_device(self, dev_info) -> None

            Add a device to the database. The device name, server and class
            are specified in the DbDevInfo structure

            Example :
                dev_info = DbDevInfo()
                dev_info.name = 'my/own/device'
                dev_info._class = 'MyDevice'
                dev_info.server = 'MyServer/test'
                db.add_device(dev_info)

        Parameters :
            - dev_info : (DbDevInfo) device information
        Return     : None
    """,
    )

    document_method(
        "delete_device",
        """
    delete_device(self, dev_name) -> None

            Delete the device of the specified name from the database.

        Parameters :
            - dev_name : (str) device name
        Return     : None
    """,
    )

    document_method(
        "import_device",
        """
    import_device(self, dev_name) -> DbDevImportInfo

            Query the databse for the export info of the specified device.

            Example :
                dev_imp_info = db.import_device('my/own/device')
                print(dev_imp_info.name)
                print(dev_imp_info.exported)
                print(dev_imp_info.ior)
                print(dev_imp_info.version)

        Parameters :
            - dev_name : (str) device name
        Return     : DbDevImportInfo
    """,
    )

    document_method(
        "get_device_info",
        """
    get_device_info(self, dev_name) -> DbDevFullInfo

            Query the databse for the full info of the specified device.

            Example :
                dev_info = db.get_device_info('my/own/device')
                print(dev_info.name)
                print(dev_info.class_name)
                print(dev_info.ds_full_name)
                print(dev_info.exported)
                print(dev_info.ior)
                print(dev_info.version)
                print(dev_info.pid)
                print(dev_info.started_date)
                print(dev_info.stopped_date)

        Parameters :
            - dev_name : (str) device name
        Return     : DbDevFullInfo

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "export_device",
        """
    export_device(self, dev_export) -> None

            Update the export info for this device in the database.

            Example :
                dev_export = DbDevExportInfo()
                dev_export.name = 'my/own/device'
                dev_export.ior = <the real ior>
                dev_export.host = <the host>
                dev_export.version = '3.0'
                dev_export.pid = '....'
                db.export_device(dev_export)

        Parameters :
            - dev_export : (DbDevExportInfo) export information
        Return     : None
    """,
    )

    document_method(
        "unexport_device",
        """
    unexport_device(self, dev_name) -> None

            Mark the specified device as unexported in the database

            Example :
               db.unexport_device('my/own/device')

        Parameters :
            - dev_name : (str) device name
        Return     : None
    """,
    )

    document_method(
        "get_device_name",
        """
    get_device_name(self, serv_name, class_name) -> DbDatum

            Query the database for a list of devices served by a server for
            a given device class

        Parameters :
            - serv_name : (str) server name
            - class_name : (str) device class name
        Return     : DbDatum with the list of device names
    """,
    )

    document_method(
        "get_device_exported",
        """
    get_device_exported(self, filter) -> DbDatum

            Query the database for a list of exported devices whose names
            satisfy the supplied filter (* is wildcard for any character(s))

        Parameters :
            - filter : (str) device name filter (wildcard)
        Return     : DbDatum with the list of exported devices
    """,
    )

    document_method(
        "get_device_domain",
        """
    get_device_domain(self, wildcard) -> DbDatum

            Query the database for a list of of device domain names which
            match the wildcard provided (* is wildcard for any character(s)).
            Domain names are case insensitive.

        Parameters :
            - wildcard : (str) domain filter
        Return     : DbDatum with the list of device domain names
    """,
    )

    document_method(
        "get_device_family",
        """
    get_device_family(self, wildcard) -> DbDatum

            Query the database for a list of of device family names which
            match the wildcard provided (* is wildcard for any character(s)).
            Family names are case insensitive.

        Parameters :
            - wildcard : (str) family filter
        Return     : DbDatum with the list of device family names
    """,
    )

    document_method(
        "get_device_member",
        """
    get_device_member(self, wildcard) -> DbDatum

            Query the database for a list of of device member names which
            match the wildcard provided (* is wildcard for any character(s)).
            Member names are case insensitive.

        Parameters :
            - wildcard : (str) member filter
        Return     : DbDatum with the list of device member names
    """,
    )

    document_method(
        "get_device_alias",
        """
    get_device_alias(self, alias) -> str

            Get the device name from an alias.

        Parameters :
            - alias : (str) alias
        Return     : device name

        .. deprecated:: 8.1.0
            Use :meth:`~tango.Database.get_device_from_alias` instead
    """,
    )

    document_method(
        "get_alias",
        """
    get_alias(self, alias) -> str

            Get the device alias name from its name.

        Parameters :
            - alias : (str) device name
        Return     : alias

        New in PyTango 3.0.4

        .. deprecated:: 8.1.0
            Use :meth:`~tango.Database.get_alias_from_device` instead
    """,
    )

    document_method(
        "get_device_from_alias",
        """
    get_device_from_alias(self, alias) -> str

            Get the device name from an alias.

        Parameters :
            - alias : (str) alias
        Return     : device name

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "get_alias_from_device",
        """
    get_alias_from_device(self, alias) -> str

            Get the device alias name from its name.

        Parameters :
            - alias : (str) device name
        Return     : alias

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "get_device_alias_list",
        """
    get_device_alias_list(self, filter) -> DbDatum

            Get device alias list. The parameter alias is a string to filter
            the alias list returned. Wildcard (*) is supported.

        Parameters :
            - filter : (str) a string with the alias filter (wildcard (*) is supported)
        Return     : DbDatum with the list of device names

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_for_device",
        """
    get_class_for_device(self, dev_name) -> str

            Return the class of the specified device.

        Parameters :
            - dev_name : (str) device name
        Return     : a string containing the device class
    """,
    )

    document_method(
        "get_class_inheritance_for_device",
        """
    get_class_inheritance_for_device(self, dev_name) -> DbDatum

            Return the class inheritance scheme of the specified device.

        Parameters :
            - devn_ame : (str) device name
        Return     : DbDatum with the inheritance class list

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_for_device",
        """
    get_class_for_device(self, dev_name) -> str

            Return the class of the specified device.

        Parameters :
            - dev_name : (str) device name
        Return     : a string containing the device class
    """,
    )

    document_method(
        "get_device_exported_for_class",
        """
    get_device_exported_for_class(self, class_name) -> DbDatum

            Query database for list of exported devices for the specified class.

        Parameters :
            - class_name : (str) class name
        Return     : DbDatum with the list of exported devices for the

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "put_device_alias",
        """
    put_device_alias(self, dev_name, alias) -> None

            Query database for list of exported devices for the specified class.

        Parameters :
            - dev_name : (str) device name
            - alias : (str) alias name
        Return     : None
    """,
    )

    document_method(
        "delete_device_alias",
        """
    delete_device_alias(self, alias) -> void

            Delete a device alias

        Parameters :
            - alias : (str) alias name
        Return     : None
    """,
    )

    document_method(
        "_add_server",
        """
    _add_server(self, serv_name, dev_info) -> None

            Add a group of devices to the database.
            This corresponds to the pure C++ API call.

        Parameters :
            - serv_name : (str) server name
            - dev_info : (DbDevInfos) server device(s) information
        Return     : None
    """,
    )

    document_method(
        "delete_server",
        """
    delete_server(self, server) -> None

            Delete the device server and its associated devices from database.

        Parameters :
            - server : (str) name of the server to be deleted with
                       format: <server name>/<instance>
        Return     : None
    """,
    )

    document_method(
        "_export_server",
        """
    _export_server(self, dev_info) -> None

            Export a group of devices to the database.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_info : (DbDevExportInfos) device(s) to export information
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "unexport_server",
        """
    unexport_server(self, server) -> None

            Mark all devices exported for this server as unexported.

        Parameters :
            - server : (str) name of the server to be unexported with
                       format: <server name>/<instance>
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "rename_server",
        """
    rename_server(self, old_ds_name, new_ds_name) -> None

            Rename a device server process.

        Parameters :
            - old_ds_name : (str) old name
            - new_ds_name : (str) new name
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "get_server_info",
        """
    get_server_info(self, server) -> DbServerInfo

            Query the database for server information.

        Parameters :
            - server : (str) name of the server with format: <server name>/<instance>
        Return     : DbServerInfo with server information

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "put_server_info",
        """
    put_server_info(self, info) -> None

            Add/update server information in the database.

        Parameters :
            - info : (DbServerInfo) new server information
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "delete_server_info",
        """
    delete_server_info(self, server) -> None

            Delete server information of the specified server from the database.

        Parameters :
            - server : (str) name of the server to be deleted with
                       format: <server name>/<instance>
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_server_class_list",
        """
    get_server_class_list(self, server) -> DbDatum

            Query the database for a list of classes instantiated by the
            specified server. The DServer class exists in all TANGO servers
            and for this reason this class is removed from the returned list.

        Parameters :
            - server : (str) name of the server to be deleted with
                       format: <server name>/<instance>
        Return     : DbDatum containing list of class names instanciated by
                     the specified server

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_server_name_list",
        """
    get_server_name_list(self) -> DbDatum

            Return the list of all server names registered in the database.

        Parameters : None
        Return     : DbDatum containing list of server names

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_instance_name_list",
        """
    get_instance_name_list(self, serv_name) -> DbDatum

            Return the list of all instance names existing in the database for the specifed server.

        Parameters :
            - serv_name : (str) server name with format <server name>
        Return     : DbDatum containing list of instance names for the specified server

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_server_list",
        """
    get_server_list(self) -> DbDatum
    get_server_list(self, wildcard) -> DbDatum

            Return the list of all servers registered in the database.
            If wildcard parameter is given, then the list of matching servers
            will be returned (ex: Serial/\\*)

        Parameters :
            - wildcard : (str) host wildcard (ex: Serial/\\*)
        Return     : DbDatum containing list of registered servers
    """,
    )

    document_method(
        "get_host_server_list",
        """
    get_host_server_list(self, host_name) -> DbDatum

            Query the database for a list of servers registered on the specified host.

        Parameters :
            - host_name : (str) host name
        Return     : DbDatum containing list of servers for the specified host

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "get_device_class_list",
        """
    get_device_class_list(self, server) -> DbDatum

            Query the database for a list of devices and classes served by
            the specified server. Return a list with the following structure:
            [device name, class name, device name, class name, ...]

        Parameters :
            - server : (str) name of the server with format: <server name>/<instance>
        Return     : DbDatum containing list with the following structure:
                     [device_name, class name]

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 3.0.4
    """,
    )

    document_method(
        "_get_property",
        """
    _get_property(self, obj_name, props) -> None

            Query the database for a list of object (i.e non-device)
            properties. The property names are specified by the
            DbData (seq<DbDatum>) structures. The method returns the
            properties in the same DbDatum structures
            This corresponds to the pure C++ API call.

        Parameters :
            - obj_name : (str) object name
            - props [in, out] : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_get_property_forced",
        """
    _get_property_forced(self, obj_name, props) -> None

            Query the database for a list of object (i.e non-device)
            properties. The property names are specified by the
            DbData (seq<DbDatum>) structures. The method returns the
            properties in the same DbDatum structures
            This corresponds to the pure C++ API call.

        Parameters :
            - obj_name : (str) object name
            - props [in, out] : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "_delete_property",
        """
    _delete_property(self, obj_name, props) -> None

            Delete a list of properties for the specified object.
            This corresponds to the pure C++ API call.

        Parameters :
            - obj_name : (str) object name
            - props : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_property_history",
        """
    get_property_history(self, obj_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specifed object
            property. Note that propname can contain a wildcard character
            (eg: 'prop*')

        Parameters :
            - serv_name : (str) server name
            - prop_name : (str) property name
        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_object_list",
        """
    get_object_list(self, wildcard) -> DbDatum

            Query the database for a list of object (free properties) for
            which properties are defined and which match the specified
            wildcard.

        Parameters :
            - wildcard : (str) object wildcard
        Return     : DbDatum containing the list of object names matching the given wildcard

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_object_property_list",
        """
    get_object_property_list(self, obj_name, wildcard) -> DbDatum

            Query the database for a list of properties defined for the
            specified object and which match the specified wildcard.

        Parameters :
            - obj_name : (str) object name
            - wildcard : (str) property name wildcard
        Return     : DbDatum with list of properties defined for the specified
                     object and which match the specified wildcard

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "_get_device_property",
        """
    _get_device_property(self, dev_name, props) -> None

            Query the database for a list of device properties for the
            specified device. The property names are specified by the
            DbData (seq<DbDatum>) structures. The method returns the
            properties in the same DbDatum structures
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_device_property",
        """
    _put_device_property(self, dev_name, props) -> None

            Insert or update a list of properties for the specified device.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props : (DbData) property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_device_property",
        """
    _delete_device_property(self, dev_name, props) -> None

            Delete a list of properties for the specified device.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props : (DbData) property names to be deleted
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_device_property_history",
        """
    get_device_property_history(self, dev_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specified device
            property. Note that propname can contain a wildcard character
            (eg: 'prop*').
            This corresponds to the pure C++ API call.

        Parameters :
            - serv_name : (str) server name
            - prop_name : (str) property name
        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "_get_device_property_list",
        """
    _get_device_property_list(self, dev_name, wildcard) -> DbDatum
    _get_device_property_list(self, dev_name, wildcard, container) -> None

            Query the database for a list of properties defined for the
            specified device and which match the specified wildcard.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - wildcard : (str) property name wildcard
            - container [out] : (StdStringVector) array that will contain the matching
                                property names
        Return     : DbDatum containing the list of property names or None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "_get_device_attribute_property",
        """
    _get_device_attribute_property(self, dev_name, props) -> None

            Query the database for a list of device attribute properties for
            the specified device. The attribute names are specified by the
            DbData (seq<DbDatum>) structures. The method returns all the
            properties for the specified attributes in the same DbDatum structures.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props [in, out] : (DbData) attribute names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_get_device_pipe_property",
        """
    _get_device_pipe_property(self, dev_name, props) -> None

            Query the database for a list of device pipe properties for
            the specified device. The pipe names are specified by the
            DbData (seq<DbDatum>) structures. The method returns all the
            properties for the specified pipes in the same DbDatum structures.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props [in, out] : (DbData) pipe names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_device_attribute_property",
        """
    _put_device_attribute_property(self, dev_name, props) -> None

            Insert or update a list of attribute properties for the specified device.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props : (DbData) property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_device_pipe_property",
        """
    _put_device_pipe_property(self, dev_name, props) -> None

            Insert or update a list of pipe properties for the specified device.
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - props : (DbData) property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_device_attribute_property",
        """
    _delete_device_attribute_property(self, dev_name, props) -> None

            Delete a list of attribute properties for the specified device.
            The attribute names are specified by the vector of DbDatum structures. Here
            is an example of how to delete the unit property of the velocity attribute of
            the id11/motor/1 device using this method :

            db_data = tango.DbData();
            db_data.append(DbDatum("velocity"));
            db_data.append(DbDatum("unit"));
            db.delete_device_attribute_property("id11/motor/1", db_data);

            This corresponds to the pure C++ API call.

        Parameters :
            - serv_name : (str) server name
            - props : (DbData) attribute property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_device_pipe_property",
        """
    _delete_device_pipe_property(self, dev_name, props) -> None

            Delete a list of pipe properties for the specified device.
            The pipe names are specified by the vector of DbDatum structures. Here
            See _delete_device_attribute_property for example usage.

            This corresponds to the pure C++ API call.

        Parameters :
            - serv_name : (str) server name
            - props : (DbData) pipe property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_device_attribute_property_history",
        """
    get_device_attribute_property_history(self, dev_name, attr_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specified device
            attribute property. Note that propname and devname can contain a
            wildcard character (eg: 'prop*').

        Parameters :
            - dev_name : (str) device name
            - attr_name : (str) attribute name
            - prop_name : (str) property name

        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_device_pipe_property_history",
        """
    get_device_pipe_property_history(self, dev_name, pipe_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specified device
            pipe property. Note that propname and devname can contain a
            wildcard character (eg: 'prop*').

        Parameters :
            - dev_name : (str) device name
            - pipe_name : (str) pipe name
            - prop_name : (str) property name

        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_device_attribute_list",
        """
    get_device_attribute_list(self, dev_name, att_list) -> None

            Get the list of attribute(s) with some data defined in database
            for a specified device. Note that this is not the list of all
            device attributes because not all attribute(s) have some data
            in database
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - att_list [out] : (StdStringVector) array that will contain the
                               attribute name list
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_device_pipe_list",
        """
    get_device_pipe_list(self, dev_name, pipe_list) -> None

            Get the list of pipe(s) with some data defined in database
            for a specified device. Note that this is not the list of all
            device pipes because not all pipe(s) have some data
            in database
            This corresponds to the pure C++ API call.

        Parameters :
            - dev_name : (str) device name
            - pipe_list [out] : (StdStringVector) array that will contain the
                                pipe name list
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_get_class_property",
        """
    _get_class_property(self, class_name, props) -> None

            Query the database for a list of class properties. The property
            names are specified by the DbData (seq<DbDatum>) structures.
            The method returns the properties in the same DbDatum structures.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props [in, out] : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_class_property",
        """
    _put_class_property(self, class_name, props) -> None

            Insert or update a list of properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props : (DbData) property data to be inserted
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_class_property",
        """
    _delete_class_property(self, class_name, props) -> None

            Delete a list of properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props  : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_class_property_history",
        """
    get_class_property_history(self, class_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specified class
            property. Note that propname can contain a wildcard character
            (eg: 'prop*').

        Parameters :
            - class_name : (str) class name
            - prop_name : (str) property name
        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_list",
        """
    get_class_list(self, wildcard) -> DbDatum

            Query the database for a list of classes which match the specified wildcard

        Parameters :
            - wildcard : (str) class wildcard
        Return     : DbDatum containing the list of matching classes

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_property_list",
        """
    get_class_property_list(self, class_name) -> DbDatum

            Query the database for a list of properties defined for the specified class.

        Parameters :
            - class_name : (str) class name
        Return     : DbDatum containing the list of properties for the specified class

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_get_class_attribute_property",
        """
    _get_class_attribute_property(self, class_name, props) -> None

            Query the database for a list of class attribute properties for
            the specified object. The attribute names are returned with the
            number of properties specified as their value. The first DbDatum
            element of the returned DbData vector contains the first
            attribute name and the first attribute property number. The
            following DbDatum element contains the first attribute property
            name and property values.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props [in,out] : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_get_class_pipe_property",
        """
    _get_class_pipe_property(self, class_name, props) -> None

            Query the database for a list of class pipe properties for
            the specified object. The pipe names are returned with the
            number of properties specified as their value. The first DbDatum
            element of the returned DbData vector contains the first
            pipe name and the first pipe property number. The
            following DbDatum element contains the first pipe property
            name and property values.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props [in,out] : (DbData) property names
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_class_attribute_property",
        """
    _put_class_attribute_property(self, class_name, props) -> None

            Insert or update a list of attribute properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props : (DbData) property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_put_class_pipe_property",
        """
    _put_class_pipe_property(self, class_name, props) -> None

            Insert or update a list of pipe properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - props : (DbData) property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_class_attribute_property",
        """
    _delete_class_attribute_property(self, class_name, props) -> None

            Delete a list of attribute properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) server name
            - props : (DbData) attribute property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "_delete_class_pipe_property",
        """
    _delete_class_pipe_property(self, class_name, props) -> None

            Delete a list of pipe properties for the specified class.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) server name
            - props : (DbData) pipe property data
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_class_attribute_property_history",
        """
    get_class_attribute_property_history(self, dev_name, attr_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specifed class attribute
            property. Note that prop_name and attr_name can contain a wildcard character
            (eg: 'prop*').

        Parameters :
            - dev_name : (str) device name
            - attr_name : (str) attribute name
            - prop_name : (str) property name
        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_pipe_property_history",
        """
    get_class_pipe_property_history(self, dev_name, pipe_name, prop_name) -> DbHistoryList

            Get the list of the last 10 modifications of the specifed class pipe
            property. Note that prop_name and attr_name can contain a wildcard character
            (eg: 'prop*').

        Parameters :
            - dev_name : (str) device name
            - pipe_name : (str) pipe name
            - prop_name : (str) property name
        Return     : DbHistoryList containing the list of modifications

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_class_attribute_list",
        """
    get_class_attribute_list(self, class_name, wildcard) -> DbDatum

            Query the database for a list of attributes defined for the specified
            class which match the specified wildcard.

        Parameters :
            - class_name : (str) class name
            - wildcard : (str) attribute name
        Return     : DbDatum containing the list of matching attributes for the given class

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "get_class_pipe_list",
        """
    get_class_pipe_list(self, class_name, wildcard) -> DbDatum

            Query the database for a list of pipes defined for the specified
            class which match the specified wildcard.
            This corresponds to the pure C++ API call.

        Parameters :
            - class_name : (str) class name
            - wildcard : (str) pipe name
        Return     : DbDatum containing the list of matching pipes for the given class

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "get_attribute_alias",
        """
    get_attribute_alias(self, alias) -> str

            Get the full attribute name from an alias.

        Parameters :
            - alias : (str) attribute alias
        Return     :  full attribute name

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        .. deprecated:: 8.1.0
            Use :meth:`~tango.Database.get_attribute_from_alias` instead
    """,
    )

    document_method(
        "get_attribute_from_alias",
        """
    get_attribute_from_alias(self, alias) -> str

            Get the full attribute name from an alias.

        Parameters :
            - alias : (str) attribute alias
        Return     :  full attribute name

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "get_alias_from_attribute",
        """
    get_alias_from_attribute(self, attr_name) -> str

            Get the attribute alias from the full attribute name.

        Parameters :
            - attr_name : (str) full attribute name
        Return     :  attribute alias

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 8.1.0
    """,
    )

    document_method(
        "get_attribute_alias_list",
        """
    get_attribute_alias_list(self, filter) -> DbDatum

            Get attribute alias list. The parameter alias is a string to
            filter the alias list returned. Wildcard (*) is supported. For
            instance, if the string alias passed as the method parameter
            is initialised with only the * character, all the defined
            attribute alias will be returned. If there is no alias with the
            given filter, the returned array will have a 0 size.

        Parameters :
            - filter : (str) attribute alias filter
        Return     : DbDatum containing the list of matching attribute alias

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "put_attribute_alias",
        """
    put_attribute_alias(self, attr_name, alias) -> None

            Set an alias for an attribute name. The attribute alias is
            specified by alias and the attribute name is specifed by
            attr_name. If the given alias already exists, a DevFailed exception
            is thrown.

        Parameters :
            - attr_name : (str) full attribute name
            - alias : (str) alias
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "delete_attribute_alias",
        """
    delete_attribute_alias(self, alias) -> None

            Remove the alias associated to an attribute name.

        Parameters :
            - alias : (str) alias
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)
    """,
    )

    document_method(
        "export_event",
        """
    export_event(self, event_data) -> None

            Export an event to the database.

        Parameters :
            - eventdata : (sequence<str>) event data (same as DbExportEvent Database command)
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "unexport_event",
        """
    unexport_event(self, event) -> None

            Un-export an event from the database.

        Parameters :
            - event : (str) event
        Return     : None

        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device (DB_SQLError)

        New in PyTango 7.0.0
    """,
    )


def __doc_DbDatum():
    def document_method(method_name, desc, append=True):
        return __document_method(DbDatum, method_name, desc, append)

    DbDatum.__doc__ = """
    A single database value which has a name, type, address and value
    and methods for inserting and extracting C++ native types. This is
    the fundamental type for specifying database properties. Every
    property has a name and has one or more values associated with it.
    A status flag indicates if there is data in the DbDatum object or
    not. An additional flag allows the user to activate exceptions.

    Note: DbDatum is extended to support the python sequence API.
          This way the DbDatum behaves like a sequence of strings.
          This allows the user to work with a DbDatum as if it was
          working with the old list of strings.

    New in PyTango 7.0.0"""

    document_method(
        "size",
        """
    size(self) -> int

            Returns the number of separate elements in the value.

        Parameters : None
        Return     : the number of separate elements in the value.

        New in PyTango 7.0.0
    """,
    )

    document_method(
        "is_empty",
        """
    is_empty(self) -> bool

            Returns True or False depending on whether the
            DbDatum object contains data or not. It can be used to test
            whether a property is defined in the database or not.

        Parameters : None
        Return     : (bool) True if no data or False otherwise.

        New in PyTango 7.0.0
    """,
    )


def __doc_DbDevExportInfo():
    DbDevExportInfo.__doc__ = """
    A structure containing export info for a device (should be
    retrieved from the database) with the following members:

        - name : (str) device name
        - ior : (str) CORBA reference of the device
        - host : name of the computer hosting the server
        - version : (str) version
        - pid : process identifier"""


def __doc_DbDevImportInfo():
    DbDevImportInfo.__doc__ = """
    A structure containing import info for a device (should be
    retrieved from the database) with the following members:

        - name : (str) device name
        - exported : 1 if device is running, 0 else
        - ior : (str)CORBA reference of the device
        - version : (str) version"""


def __doc_DbDevInfo():
    DbDevInfo.__doc__ = """
    A structure containing available information for a device with
    the following members:

        - name : (str) name
        - _class : (str) device class
        - server : (str) server"""


def __doc_DbHistory():
    def document_method(method_name, desc, append=True):
        return __document_method(DbHistory, method_name, desc, append)

    DbHistory.__doc__ = """
    A structure containing the modifications of a property. No public members."""

    document_method(
        "get_name",
        """
    get_name(self) -> str

            Returns the property name.

        Parameters : None
        Return     : (str) property name
    """,
    )

    document_method(
        "get_attribute_name",
        """
    get_attribute_name(self) -> str

            Returns the attribute name (empty for object properties or device properties)

        Parameters : None
        Return     : (str) attribute name
    """,
    )

    document_method(
        "get_date",
        """
    get_date(self) -> str

            Returns the update date

        Parameters : None
        Return     : (str) update date
    """,
    )

    document_method(
        "get_value",
        """
    get_value(self) -> DbDatum

            Returns a COPY of the property value

        Parameters : None
        Return     : (DbDatum) a COPY of the property value
    """,
    )

    document_method(
        "is_deleted",
        """
    is_deleted(self) -> bool

            Returns True if the property has been deleted or False otherwise

        Parameters : None
        Return     : (bool) True if the property has been deleted or False otherwise
    """,
    )


def __doc_DbServerInfo():
    DbServerInfo.__doc__ = """
    A structure containing available information for a device server with
    the following members:

        - name : (str) name
        - host : (str) host
        - mode : (str) mode
        - level : (str) level"""


def __doc_DbServerData():
    def document_method(method_name, desc, append=True):
        return __document_method(DbServerData, method_name, desc, append)

    DbServerData.__doc__ = """\
    A structure used for moving DS from one tango host to another.
    Create a new instance by: DbServerData(<server name>, <server instance>)"""

    document_method(
        "get_name",
        """
    get_name(self) -> str

            Returns the full server name

        Parameters : None
        Return     : (str) the full server name
    """,
    )

    document_method(
        "put_in_database",
        """
    put_in_database(self, tg_host) -> None

            Store all the data related to the device server process in the
            database specified by the input arg.

        Parameters :
            - tg_host : (str) The tango host for the new database
        Return     : None
    """,
    )

    document_method(
        "already_exist",
        """
    already_exist(self, tg_host) -> bool

            Check if any of the device server process device(s) is already
            defined in the database specified by the tango host given as input arg

        Parameters :
            - tg_host : (str) The tango host for the new database
        Return     : (str) True in case any of the device is already known. False otherwise
    """,
    )

    document_method(
        "remove",
        """
    remove(self) -> None
    remove(self, tg_host) -> None

            Remove device server process from a database.

        Parameters :
            - tg_host : (str) The tango host for the new database
        Return     : None
    """,
    )


def db_init(doc=True):
    __init_DbDatum()
    if doc:
        __doc_DbDatum()

    __init_Database()
    if doc:
        __doc_Database()
        __doc_DbDevExportInfo()
        __doc_DbDevImportInfo()
        __doc_DbDevInfo()
        __doc_DbHistory()
        __doc_DbServerInfo()
        __doc_DbServerData()