libduckdb-sys 1.10502.0

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

pub const DUCKDB_TYPE_DUCKDB_TYPE_INVALID: DUCKDB_TYPE = 0;
pub const DUCKDB_TYPE_DUCKDB_TYPE_BOOLEAN: DUCKDB_TYPE = 1;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TINYINT: DUCKDB_TYPE = 2;
pub const DUCKDB_TYPE_DUCKDB_TYPE_SMALLINT: DUCKDB_TYPE = 3;
pub const DUCKDB_TYPE_DUCKDB_TYPE_INTEGER: DUCKDB_TYPE = 4;
pub const DUCKDB_TYPE_DUCKDB_TYPE_BIGINT: DUCKDB_TYPE = 5;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UTINYINT: DUCKDB_TYPE = 6;
pub const DUCKDB_TYPE_DUCKDB_TYPE_USMALLINT: DUCKDB_TYPE = 7;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UINTEGER: DUCKDB_TYPE = 8;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UBIGINT: DUCKDB_TYPE = 9;
pub const DUCKDB_TYPE_DUCKDB_TYPE_FLOAT: DUCKDB_TYPE = 10;
pub const DUCKDB_TYPE_DUCKDB_TYPE_DOUBLE: DUCKDB_TYPE = 11;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP: DUCKDB_TYPE = 12;
pub const DUCKDB_TYPE_DUCKDB_TYPE_DATE: DUCKDB_TYPE = 13;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME: DUCKDB_TYPE = 14;
pub const DUCKDB_TYPE_DUCKDB_TYPE_INTERVAL: DUCKDB_TYPE = 15;
pub const DUCKDB_TYPE_DUCKDB_TYPE_HUGEINT: DUCKDB_TYPE = 16;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UHUGEINT: DUCKDB_TYPE = 32;
pub const DUCKDB_TYPE_DUCKDB_TYPE_VARCHAR: DUCKDB_TYPE = 17;
pub const DUCKDB_TYPE_DUCKDB_TYPE_BLOB: DUCKDB_TYPE = 18;
pub const DUCKDB_TYPE_DUCKDB_TYPE_DECIMAL: DUCKDB_TYPE = 19;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_S: DUCKDB_TYPE = 20;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_MS: DUCKDB_TYPE = 21;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_NS: DUCKDB_TYPE = 22;
pub const DUCKDB_TYPE_DUCKDB_TYPE_ENUM: DUCKDB_TYPE = 23;
pub const DUCKDB_TYPE_DUCKDB_TYPE_LIST: DUCKDB_TYPE = 24;
pub const DUCKDB_TYPE_DUCKDB_TYPE_STRUCT: DUCKDB_TYPE = 25;
pub const DUCKDB_TYPE_DUCKDB_TYPE_MAP: DUCKDB_TYPE = 26;
pub const DUCKDB_TYPE_DUCKDB_TYPE_ARRAY: DUCKDB_TYPE = 33;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UUID: DUCKDB_TYPE = 27;
pub const DUCKDB_TYPE_DUCKDB_TYPE_UNION: DUCKDB_TYPE = 28;
pub const DUCKDB_TYPE_DUCKDB_TYPE_BIT: DUCKDB_TYPE = 29;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME_TZ: DUCKDB_TYPE = 30;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_TZ: DUCKDB_TYPE = 31;
pub const DUCKDB_TYPE_DUCKDB_TYPE_ANY: DUCKDB_TYPE = 34;
pub const DUCKDB_TYPE_DUCKDB_TYPE_BIGNUM: DUCKDB_TYPE = 35;
pub const DUCKDB_TYPE_DUCKDB_TYPE_SQLNULL: DUCKDB_TYPE = 36;
pub const DUCKDB_TYPE_DUCKDB_TYPE_STRING_LITERAL: DUCKDB_TYPE = 37;
pub const DUCKDB_TYPE_DUCKDB_TYPE_INTEGER_LITERAL: DUCKDB_TYPE = 38;
pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME_NS: DUCKDB_TYPE = 39;
pub const DUCKDB_TYPE_DUCKDB_TYPE_GEOMETRY: DUCKDB_TYPE = 40;
#[doc = "! An enum over DuckDB's internal types."]
pub type DUCKDB_TYPE = ::std::os::raw::c_uint;
#[doc = "! An enum over DuckDB's internal types."]
pub use self::DUCKDB_TYPE as duckdb_type;
pub const duckdb_state_DuckDBSuccess: duckdb_state = 0;
pub const duckdb_state_DuckDBError: duckdb_state = 1;
#[doc = "! An enum over the returned state of different functions."]
pub type duckdb_state = ::std::os::raw::c_uint;
pub const duckdb_pending_state_DUCKDB_PENDING_RESULT_READY: duckdb_pending_state = 0;
pub const duckdb_pending_state_DUCKDB_PENDING_RESULT_NOT_READY: duckdb_pending_state = 1;
pub const duckdb_pending_state_DUCKDB_PENDING_ERROR: duckdb_pending_state = 2;
pub const duckdb_pending_state_DUCKDB_PENDING_NO_TASKS_AVAILABLE: duckdb_pending_state = 3;
#[doc = "! An enum over the pending state of a pending query result."]
pub type duckdb_pending_state = ::std::os::raw::c_uint;
pub const duckdb_result_type_DUCKDB_RESULT_TYPE_INVALID: duckdb_result_type = 0;
pub const duckdb_result_type_DUCKDB_RESULT_TYPE_CHANGED_ROWS: duckdb_result_type = 1;
pub const duckdb_result_type_DUCKDB_RESULT_TYPE_NOTHING: duckdb_result_type = 2;
pub const duckdb_result_type_DUCKDB_RESULT_TYPE_QUERY_RESULT: duckdb_result_type = 3;
#[doc = "! An enum over DuckDB's different result types."]
pub type duckdb_result_type = ::std::os::raw::c_uint;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_INVALID: duckdb_statement_type = 0;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_SELECT: duckdb_statement_type = 1;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_INSERT: duckdb_statement_type = 2;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_UPDATE: duckdb_statement_type = 3;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXPLAIN: duckdb_statement_type = 4;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DELETE: duckdb_statement_type = 5;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_PREPARE: duckdb_statement_type = 6;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CREATE: duckdb_statement_type = 7;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXECUTE: duckdb_statement_type = 8;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ALTER: duckdb_statement_type = 9;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_TRANSACTION: duckdb_statement_type = 10;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_COPY: duckdb_statement_type = 11;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ANALYZE: duckdb_statement_type = 12;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_VARIABLE_SET: duckdb_statement_type = 13;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CREATE_FUNC: duckdb_statement_type = 14;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DROP: duckdb_statement_type = 15;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXPORT: duckdb_statement_type = 16;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_PRAGMA: duckdb_statement_type = 17;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_VACUUM: duckdb_statement_type = 18;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CALL: duckdb_statement_type = 19;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_SET: duckdb_statement_type = 20;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_LOAD: duckdb_statement_type = 21;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_RELATION: duckdb_statement_type = 22;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXTENSION: duckdb_statement_type = 23;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_LOGICAL_PLAN: duckdb_statement_type = 24;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ATTACH: duckdb_statement_type = 25;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DETACH: duckdb_statement_type = 26;
pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_MULTI: duckdb_statement_type = 27;
#[doc = "! An enum over DuckDB's different statement types."]
pub type duckdb_statement_type = ::std::os::raw::c_uint;
pub const duckdb_error_type_DUCKDB_ERROR_INVALID: duckdb_error_type = 0;
pub const duckdb_error_type_DUCKDB_ERROR_OUT_OF_RANGE: duckdb_error_type = 1;
pub const duckdb_error_type_DUCKDB_ERROR_CONVERSION: duckdb_error_type = 2;
pub const duckdb_error_type_DUCKDB_ERROR_UNKNOWN_TYPE: duckdb_error_type = 3;
pub const duckdb_error_type_DUCKDB_ERROR_DECIMAL: duckdb_error_type = 4;
pub const duckdb_error_type_DUCKDB_ERROR_MISMATCH_TYPE: duckdb_error_type = 5;
pub const duckdb_error_type_DUCKDB_ERROR_DIVIDE_BY_ZERO: duckdb_error_type = 6;
pub const duckdb_error_type_DUCKDB_ERROR_OBJECT_SIZE: duckdb_error_type = 7;
pub const duckdb_error_type_DUCKDB_ERROR_INVALID_TYPE: duckdb_error_type = 8;
pub const duckdb_error_type_DUCKDB_ERROR_SERIALIZATION: duckdb_error_type = 9;
pub const duckdb_error_type_DUCKDB_ERROR_TRANSACTION: duckdb_error_type = 10;
pub const duckdb_error_type_DUCKDB_ERROR_NOT_IMPLEMENTED: duckdb_error_type = 11;
pub const duckdb_error_type_DUCKDB_ERROR_EXPRESSION: duckdb_error_type = 12;
pub const duckdb_error_type_DUCKDB_ERROR_CATALOG: duckdb_error_type = 13;
pub const duckdb_error_type_DUCKDB_ERROR_PARSER: duckdb_error_type = 14;
pub const duckdb_error_type_DUCKDB_ERROR_PLANNER: duckdb_error_type = 15;
pub const duckdb_error_type_DUCKDB_ERROR_SCHEDULER: duckdb_error_type = 16;
pub const duckdb_error_type_DUCKDB_ERROR_EXECUTOR: duckdb_error_type = 17;
pub const duckdb_error_type_DUCKDB_ERROR_CONSTRAINT: duckdb_error_type = 18;
pub const duckdb_error_type_DUCKDB_ERROR_INDEX: duckdb_error_type = 19;
pub const duckdb_error_type_DUCKDB_ERROR_STAT: duckdb_error_type = 20;
pub const duckdb_error_type_DUCKDB_ERROR_CONNECTION: duckdb_error_type = 21;
pub const duckdb_error_type_DUCKDB_ERROR_SYNTAX: duckdb_error_type = 22;
pub const duckdb_error_type_DUCKDB_ERROR_SETTINGS: duckdb_error_type = 23;
pub const duckdb_error_type_DUCKDB_ERROR_BINDER: duckdb_error_type = 24;
pub const duckdb_error_type_DUCKDB_ERROR_NETWORK: duckdb_error_type = 25;
pub const duckdb_error_type_DUCKDB_ERROR_OPTIMIZER: duckdb_error_type = 26;
pub const duckdb_error_type_DUCKDB_ERROR_NULL_POINTER: duckdb_error_type = 27;
pub const duckdb_error_type_DUCKDB_ERROR_IO: duckdb_error_type = 28;
pub const duckdb_error_type_DUCKDB_ERROR_INTERRUPT: duckdb_error_type = 29;
pub const duckdb_error_type_DUCKDB_ERROR_FATAL: duckdb_error_type = 30;
pub const duckdb_error_type_DUCKDB_ERROR_INTERNAL: duckdb_error_type = 31;
pub const duckdb_error_type_DUCKDB_ERROR_INVALID_INPUT: duckdb_error_type = 32;
pub const duckdb_error_type_DUCKDB_ERROR_OUT_OF_MEMORY: duckdb_error_type = 33;
pub const duckdb_error_type_DUCKDB_ERROR_PERMISSION: duckdb_error_type = 34;
pub const duckdb_error_type_DUCKDB_ERROR_PARAMETER_NOT_RESOLVED: duckdb_error_type = 35;
pub const duckdb_error_type_DUCKDB_ERROR_PARAMETER_NOT_ALLOWED: duckdb_error_type = 36;
pub const duckdb_error_type_DUCKDB_ERROR_DEPENDENCY: duckdb_error_type = 37;
pub const duckdb_error_type_DUCKDB_ERROR_HTTP: duckdb_error_type = 38;
pub const duckdb_error_type_DUCKDB_ERROR_MISSING_EXTENSION: duckdb_error_type = 39;
pub const duckdb_error_type_DUCKDB_ERROR_AUTOLOAD: duckdb_error_type = 40;
pub const duckdb_error_type_DUCKDB_ERROR_SEQUENCE: duckdb_error_type = 41;
pub const duckdb_error_type_DUCKDB_INVALID_CONFIGURATION: duckdb_error_type = 42;
#[doc = "! An enum over DuckDB's different error types."]
pub type duckdb_error_type = ::std::os::raw::c_uint;
pub const duckdb_cast_mode_DUCKDB_CAST_NORMAL: duckdb_cast_mode = 0;
pub const duckdb_cast_mode_DUCKDB_CAST_TRY: duckdb_cast_mode = 1;
#[doc = "! An enum over DuckDB's different cast modes."]
pub type duckdb_cast_mode = ::std::os::raw::c_uint;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_INVALID: duckdb_file_flag = 0;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_READ: duckdb_file_flag = 1;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_WRITE: duckdb_file_flag = 2;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_CREATE: duckdb_file_flag = 3;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_CREATE_NEW: duckdb_file_flag = 4;
pub const duckdb_file_flag_DUCKDB_FILE_FLAG_APPEND: duckdb_file_flag = 5;
pub type duckdb_file_flag = ::std::os::raw::c_uint;
pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_INVALID: duckdb_config_option_scope = 0;
pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_LOCAL: duckdb_config_option_scope = 1;
pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_SESSION: duckdb_config_option_scope = 2;
pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_GLOBAL: duckdb_config_option_scope = 3;
#[doc = "! An enum over DuckDB's configuration option scopes.\n! This enum can be used to specify the default scope when creating a custom configuration option,\n! but it is also be used to determine the scope in which a configuration option is set when it is\n! changed or retrieved."]
pub type duckdb_config_option_scope = ::std::os::raw::c_uint;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_INVALID: duckdb_catalog_entry_type = 0;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_TABLE: duckdb_catalog_entry_type = 1;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_SCHEMA: duckdb_catalog_entry_type = 2;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_VIEW: duckdb_catalog_entry_type = 3;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_INDEX: duckdb_catalog_entry_type = 4;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_PREPARED_STATEMENT: duckdb_catalog_entry_type = 5;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_SEQUENCE: duckdb_catalog_entry_type = 6;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_COLLATION: duckdb_catalog_entry_type = 7;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_TYPE: duckdb_catalog_entry_type = 8;
pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_DATABASE: duckdb_catalog_entry_type = 9;
#[doc = "! An enum over DuckDB's catalog entry types."]
pub type duckdb_catalog_entry_type = ::std::os::raw::c_uint;
#[doc = "! DuckDB's index type."]
pub type idx_t = u64;
#[doc = "! Type definition for the data pointers of selection vectors."]
pub type sel_t = u32;
#[doc = "! The callback to destroy data, e.g.,\n! bind data (if any), init data (if any), extra data for replacement scans (if any), etc."]
pub type duckdb_delete_callback_t = ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
#[doc = "! The callback to copy data, e.g., bind data (if any)."]
pub type duckdb_copy_callback_t =
    ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void>;
#[doc = "! Used for threading, contains a task state.\n! Must be destroyed with `duckdb_destroy_task_state`."]
pub type duckdb_task_state = *mut ::std::os::raw::c_void;
#[doc = "! DATE is stored as days since 1970-01-01.\n! Use the `duckdb_from_date` and `duckdb_to_date` functions to extract individual information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_date {
    pub days: i32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_date_struct {
    pub year: i32,
    pub month: i8,
    pub day: i8,
}
#[doc = "! TIME is stored as microseconds since 00:00:00.\n! Use the `duckdb_from_time` and `duckdb_to_time` functions to extract individual information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_time {
    pub micros: i64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_time_struct {
    pub hour: i8,
    pub min: i8,
    pub sec: i8,
    pub micros: i32,
}
#[doc = "! TIME_NS is stored as nanoseconds since 00:00:00."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_time_ns {
    pub nanos: i64,
}
#[doc = "! TIME_TZ is stored as 40 bits for the int64_t microseconds, and 24 bits for the int32_t offset.\n! Use the `duckdb_from_time_tz` function to extract individual information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_time_tz {
    pub bits: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_time_tz_struct {
    pub time: duckdb_time_struct,
    pub offset: i32,
}
#[doc = "! TIMESTAMP is stored as microseconds since 1970-01-01.\n! Use the `duckdb_from_timestamp` and `duckdb_to_timestamp` functions to extract individual information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_timestamp {
    pub micros: i64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_timestamp_struct {
    pub date: duckdb_date_struct,
    pub time: duckdb_time_struct,
}
#[doc = "! TIMESTAMP_S is stored as seconds since 1970-01-01."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_timestamp_s {
    pub seconds: i64,
}
#[doc = "! TIMESTAMP_MS is stored as milliseconds since 1970-01-01."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_timestamp_ms {
    pub millis: i64,
}
#[doc = "! TIMESTAMP_NS is stored as nanoseconds since 1970-01-01."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_timestamp_ns {
    pub nanos: i64,
}
#[doc = "! INTERVAL is stored in months, days, and micros."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_interval {
    pub months: i32,
    pub days: i32,
    pub micros: i64,
}
#[doc = "! HUGEINT is composed of a lower and upper component.\n! Its value is upper * 2^64 + lower.\n! For simplified usage, use `duckdb_hugeint_to_double` and `duckdb_double_to_hugeint`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_hugeint {
    pub lower: u64,
    pub upper: i64,
}
#[doc = "! UHUGEINT is composed of a lower and upper component.\n! Its value is upper * 2^64 + lower.\n! For simplified usage, use `duckdb_uhugeint_to_double` and `duckdb_double_to_uhugeint`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_uhugeint {
    pub lower: u64,
    pub upper: u64,
}
#[doc = "! DECIMAL is composed of a width and a scale.\n! Their value is stored in a HUGEINT."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_decimal {
    pub width: u8,
    pub scale: u8,
    pub value: duckdb_hugeint,
}
#[doc = "! A type holding information about the query execution progress."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_query_progress_type {
    pub percentage: f64,
    pub rows_processed: u64,
    pub total_rows_to_process: u64,
}
#[doc = "! The internal representation of a VARCHAR (string_t). If the VARCHAR does not\n! exceed 12 characters, then we inline it. Otherwise, we inline a four-byte prefix for faster\n! string comparisons and store a pointer to the remaining characters. This is a non-\n! owning structure, i.e., it does not have to be freed."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct duckdb_string_t {
    pub value: duckdb_string_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union duckdb_string_t__bindgen_ty_1 {
    pub pointer: duckdb_string_t__bindgen_ty_1__bindgen_ty_1,
    pub inlined: duckdb_string_t__bindgen_ty_1__bindgen_ty_2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_string_t__bindgen_ty_1__bindgen_ty_1 {
    pub length: u32,
    pub prefix: [::std::os::raw::c_char; 4usize],
    pub ptr: *mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_string_t__bindgen_ty_1__bindgen_ty_2 {
    pub length: u32,
    pub inlined: [::std::os::raw::c_char; 12usize],
}
#[doc = "! DuckDB's LISTs are composed of a 'parent' vector holding metadata of each list,\n! and a child vector holding the entries of the lists.\n! The `duckdb_list_entry` struct contains the internal representation of a LIST metadata entry.\n! A metadata entry contains the length of the list, and its offset in the child vector."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_list_entry {
    pub offset: u64,
    pub length: u64,
}
#[doc = "! A column consists of a pointer to its internal data. Don't operate on this type directly.\n! Instead, use functions such as `duckdb_column_data`, `duckdb_nullmask_data`,\n! `duckdb_column_type`, and `duckdb_column_name`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_column {
    pub deprecated_data: *mut ::std::os::raw::c_void,
    pub deprecated_nullmask: *mut bool,
    pub deprecated_type: duckdb_type,
    pub deprecated_name: *mut ::std::os::raw::c_char,
    pub internal_data: *mut ::std::os::raw::c_void,
}
#[doc = "! 1. A standalone vector that must be destroyed, or\n! 2. A vector to a column in a data chunk that lives as long as the data chunk lives."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_vector {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! 1. A standalone vector that must be destroyed, or\n! 2. A vector to a column in a data chunk that lives as long as the data chunk lives."]
pub type duckdb_vector = *mut _duckdb_vector;
#[doc = "! A selection vector is a vector of indices, which usually refer to values in a vector.\n! Can be used to slice vectors, changing their length and the order of their entries.\n! Standalone selection vectors must be destroyed."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_selection_vector {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A selection vector is a vector of indices, which usually refer to values in a vector.\n! Can be used to slice vectors, changing their length and the order of their entries.\n! Standalone selection vectors must be destroyed."]
pub type duckdb_selection_vector = *mut _duckdb_selection_vector;
#[doc = "! Strings are composed of a `char` pointer and a size.\n! You must free `string.data` with `duckdb_free`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_string {
    pub data: *mut ::std::os::raw::c_char,
    pub size: idx_t,
}
#[doc = "! BLOBs are composed of a byte pointer and a size.\n! You must free `blob.data` with `duckdb_free`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_blob {
    pub data: *mut ::std::os::raw::c_void,
    pub size: idx_t,
}
#[doc = "! BITs are composed of a byte pointer and a size.\n! BIT byte data has 0 to 7 bits of padding.\n! The first byte contains the number of padding bits.\n! The padding bits of the second byte are set to 1, starting from the MSB.\n! You must free `data` with `duckdb_free`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_bit {
    pub data: *mut u8,
    pub size: idx_t,
}
#[doc = "! BIGNUMs are composed of a byte pointer, a size, and an `is_negative` bool.\n! The absolute value of the number is stored in `data` in little endian format.\n! You must free `data` with `duckdb_free`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_bignum {
    pub data: *mut u8,
    pub size: idx_t,
    pub is_negative: bool,
}
#[doc = "! A query result consists of a pointer to its internal data.\n! Must be freed with 'duckdb_destroy_result'."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_result {
    pub deprecated_column_count: idx_t,
    pub deprecated_row_count: idx_t,
    pub deprecated_rows_changed: idx_t,
    pub deprecated_columns: *mut duckdb_column,
    pub deprecated_error_message: *mut ::std::os::raw::c_char,
    pub internal_data: *mut ::std::os::raw::c_void,
}
#[doc = "! A database instance cache object. Must be destroyed with `duckdb_destroy_instance_cache`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_instance_cache {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A database instance cache object. Must be destroyed with `duckdb_destroy_instance_cache`."]
pub type duckdb_instance_cache = *mut _duckdb_instance_cache;
#[doc = "! A database object. Must be closed with `duckdb_close`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_database {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A database object. Must be closed with `duckdb_close`."]
pub type duckdb_database = *mut _duckdb_database;
#[doc = "! A connection to a duckdb database. Must be closed with `duckdb_disconnect`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_connection {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A connection to a duckdb database. Must be closed with `duckdb_disconnect`."]
pub type duckdb_connection = *mut _duckdb_connection;
#[doc = "! A client context of a duckdb connection. Must be destroyed with `duckdb_destroy_context`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_client_context {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A client context of a duckdb connection. Must be destroyed with `duckdb_destroy_context`."]
pub type duckdb_client_context = *mut _duckdb_client_context;
#[doc = "! A prepared statement is a parameterized query that allows you to bind parameters to it.\n! Must be destroyed with `duckdb_destroy_prepare`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_prepared_statement {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A prepared statement is a parameterized query that allows you to bind parameters to it.\n! Must be destroyed with `duckdb_destroy_prepare`."]
pub type duckdb_prepared_statement = *mut _duckdb_prepared_statement;
#[doc = "! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_extracted_statements {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`."]
pub type duckdb_extracted_statements = *mut _duckdb_extracted_statements;
#[doc = "! The pending result represents an intermediate structure for a query that is not yet fully executed.\n! Must be destroyed with `duckdb_destroy_pending`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_pending_result {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The pending result represents an intermediate structure for a query that is not yet fully executed.\n! Must be destroyed with `duckdb_destroy_pending`."]
pub type duckdb_pending_result = *mut _duckdb_pending_result;
#[doc = "! The appender enables fast data loading into DuckDB.\n! Must be destroyed with `duckdb_appender_destroy`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_appender {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The appender enables fast data loading into DuckDB.\n! Must be destroyed with `duckdb_appender_destroy`."]
pub type duckdb_appender = *mut _duckdb_appender;
#[doc = "! The table description allows querying information about the table.\n! Must be destroyed with `duckdb_table_description_destroy`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_table_description {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The table description allows querying information about the table.\n! Must be destroyed with `duckdb_table_description_destroy`."]
pub type duckdb_table_description = *mut _duckdb_table_description;
#[doc = "! The configuration can be used to provide start-up options for a database.\n! Must be destroyed with `duckdb_destroy_config`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_config {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The configuration can be used to provide start-up options for a database.\n! Must be destroyed with `duckdb_destroy_config`."]
pub type duckdb_config = *mut _duckdb_config;
#[doc = "! A custom configuration option instance. Used to register custom options that can be set on a duckdb_config.\n! or by the user in SQL using `SET <option_name> = <value>`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_config_option {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A custom configuration option instance. Used to register custom options that can be set on a duckdb_config.\n! or by the user in SQL using `SET <option_name> = <value>`."]
pub type duckdb_config_option = *mut _duckdb_config_option;
#[doc = "! A logical type.\n! Must be destroyed with `duckdb_destroy_logical_type`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_logical_type {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A logical type.\n! Must be destroyed with `duckdb_destroy_logical_type`."]
pub type duckdb_logical_type = *mut _duckdb_logical_type;
#[doc = "! Holds extra information to register a custom logical type.\n! Reserved for future use."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_create_type_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds extra information to register a custom logical type.\n! Reserved for future use."]
pub type duckdb_create_type_info = *mut _duckdb_create_type_info;
#[doc = "! Contains a data chunk of a duckdb_result.\n! Must be destroyed with `duckdb_destroy_data_chunk`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_data_chunk {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Contains a data chunk of a duckdb_result.\n! Must be destroyed with `duckdb_destroy_data_chunk`."]
pub type duckdb_data_chunk = *mut _duckdb_data_chunk;
#[doc = "! A value of a logical type.\n! Must be destroyed with `duckdb_destroy_value`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_value {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A value of a logical type.\n! Must be destroyed with `duckdb_destroy_value`."]
pub type duckdb_value = *mut _duckdb_value;
#[doc = "! Holds a recursive tree containing profiling metrics.\n! The tree matches the query plan, and has a top-level node."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_profiling_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds a recursive tree containing profiling metrics.\n! The tree matches the query plan, and has a top-level node."]
pub type duckdb_profiling_info = *mut _duckdb_profiling_info;
#[doc = "! Holds error data.\n! Must be destroyed with `duckdb_destroy_error_data`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_error_data {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds error data.\n! Must be destroyed with `duckdb_destroy_error_data`."]
pub type duckdb_error_data = *mut _duckdb_error_data;
#[doc = "! Holds a bound expression.\n! Must be destroyed with `duckdb_destroy_expression`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_expression {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds a bound expression.\n! Must be destroyed with `duckdb_destroy_expression`."]
pub type duckdb_expression = *mut _duckdb_expression;
#[doc = "! Holds the state of the C API extension initialization process."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_extension_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds the state of the C API extension initialization process."]
pub type duckdb_extension_info = *mut _duckdb_extension_info;
#[doc = "! Additional function info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_function_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Additional function info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
pub type duckdb_function_info = *mut _duckdb_function_info;
#[doc = "! The bind info of a function.\n! When setting this info, it is necessary to pass a destroy-callback function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_bind_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The bind info of a function.\n! When setting this info, it is necessary to pass a destroy-callback function."]
pub type duckdb_bind_info = *mut _duckdb_bind_info;
#[doc = "! Additional function initialization info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_init_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Additional function initialization info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
pub type duckdb_init_info = *mut _duckdb_init_info;
#[doc = "! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_scalar_function {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`."]
pub type duckdb_scalar_function = *mut _duckdb_scalar_function;
#[doc = "! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_scalar_function_set {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`."]
pub type duckdb_scalar_function_set = *mut _duckdb_scalar_function_set;
#[doc = "! The bind function callback of the scalar function."]
pub type duckdb_scalar_function_bind_t = ::std::option::Option<unsafe extern "C" fn(info: duckdb_bind_info)>;
#[doc = "! The thread-local initialization function of the scalar function."]
pub type duckdb_scalar_function_init_t = ::std::option::Option<unsafe extern "C" fn(info: duckdb_init_info)>;
#[doc = "! The function to execute the scalar function on an input chunk."]
pub type duckdb_scalar_function_t = ::std::option::Option<
    unsafe extern "C" fn(info: duckdb_function_info, input: duckdb_data_chunk, output: duckdb_vector),
>;
#[doc = "! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_aggregate_function {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`."]
pub type duckdb_aggregate_function = *mut _duckdb_aggregate_function;
#[doc = "! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_aggregate_function_set {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`."]
pub type duckdb_aggregate_function_set = *mut _duckdb_aggregate_function_set;
#[doc = "! The state of an aggregate function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_aggregate_state {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The state of an aggregate function."]
pub type duckdb_aggregate_state = *mut _duckdb_aggregate_state;
#[doc = "! A function to return the aggregate state's size."]
pub type duckdb_aggregate_state_size = ::std::option::Option<unsafe extern "C" fn(info: duckdb_function_info) -> idx_t>;
#[doc = "! A function to initialize an aggregate state."]
pub type duckdb_aggregate_init_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_function_info, state: duckdb_aggregate_state)>;
#[doc = "! An optional function to destroy an aggregate state."]
pub type duckdb_aggregate_destroy_t =
    ::std::option::Option<unsafe extern "C" fn(states: *mut duckdb_aggregate_state, count: idx_t)>;
#[doc = "! A function to update a set of aggregate states with new values."]
pub type duckdb_aggregate_update_t = ::std::option::Option<
    unsafe extern "C" fn(info: duckdb_function_info, input: duckdb_data_chunk, states: *mut duckdb_aggregate_state),
>;
#[doc = "! A function to combine aggregate states."]
pub type duckdb_aggregate_combine_t = ::std::option::Option<
    unsafe extern "C" fn(
        info: duckdb_function_info,
        source: *mut duckdb_aggregate_state,
        target: *mut duckdb_aggregate_state,
        count: idx_t,
    ),
>;
#[doc = "! A function to finalize aggregate states into a result vector."]
pub type duckdb_aggregate_finalize_t = ::std::option::Option<
    unsafe extern "C" fn(
        info: duckdb_function_info,
        source: *mut duckdb_aggregate_state,
        result: duckdb_vector,
        count: idx_t,
        offset: idx_t,
    ),
>;
#[doc = "! A table function. Must be destroyed with `duckdb_destroy_table_function`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_table_function {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A table function. Must be destroyed with `duckdb_destroy_table_function`."]
pub type duckdb_table_function = *mut _duckdb_table_function;
#[doc = "! The bind function of the table function."]
pub type duckdb_table_function_bind_t = ::std::option::Option<unsafe extern "C" fn(info: duckdb_bind_info)>;
#[doc = "! The possibly thread-local initialization function of the table function."]
pub type duckdb_table_function_init_t = ::std::option::Option<unsafe extern "C" fn(info: duckdb_init_info)>;
#[doc = "! The function to generate an output chunk during table function execution."]
pub type duckdb_table_function_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_function_info, output: duckdb_data_chunk)>;
#[doc = "! A COPY function. Must be destroyed with `duckdb_destroy_copy_function`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_copy_function {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A COPY function. Must be destroyed with `duckdb_destroy_copy_function`."]
pub type duckdb_copy_function = *mut _duckdb_copy_function;
#[doc = "! Info for the bind function of a COPY function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_copy_function_bind_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Info for the bind function of a COPY function."]
pub type duckdb_copy_function_bind_info = *mut _duckdb_copy_function_bind_info;
#[doc = "! Info for the global initialization function of a COPY function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_copy_function_global_init_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Info for the global initialization function of a COPY function."]
pub type duckdb_copy_function_global_init_info = *mut _duckdb_copy_function_global_init_info;
#[doc = "! Info for the sink function of a COPY function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_copy_function_sink_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Info for the sink function of a COPY function."]
pub type duckdb_copy_function_sink_info = *mut _duckdb_copy_function_sink_info;
#[doc = "! Info for the finalize function of a COPY function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_copy_function_finalize_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Info for the finalize function of a COPY function."]
pub type duckdb_copy_function_finalize_info = *mut _duckdb_copy_function_finalize_info;
#[doc = "! The bind function to use when binding a COPY ... TO function."]
pub type duckdb_copy_function_bind_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_bind_info)>;
#[doc = "! The initialization function to use when initializing a COPY ... TO function."]
pub type duckdb_copy_function_global_init_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_global_init_info)>;
#[doc = "! The function to sink an input chunk into during execution of a COPY ... TO function."]
pub type duckdb_copy_function_sink_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_sink_info, input: duckdb_data_chunk)>;
#[doc = "! The function to finalize the COPY ... TO function execution."]
pub type duckdb_copy_function_finalize_t =
    ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_finalize_info)>;
#[doc = "! A cast function. Must be destroyed with `duckdb_destroy_cast_function`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_cast_function {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A cast function. Must be destroyed with `duckdb_destroy_cast_function`."]
pub type duckdb_cast_function = *mut _duckdb_cast_function;
#[doc = "! The function to cast from an input vector to an output vector."]
pub type duckdb_cast_function_t = ::std::option::Option<
    unsafe extern "C" fn(info: duckdb_function_info, count: idx_t, input: duckdb_vector, output: duckdb_vector) -> bool,
>;
#[doc = "! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_replacement_scan_info {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function."]
pub type duckdb_replacement_scan_info = *mut _duckdb_replacement_scan_info;
#[doc = "! A replacement scan function."]
pub type duckdb_replacement_callback_t = ::std::option::Option<
    unsafe extern "C" fn(
        info: duckdb_replacement_scan_info,
        table_name: *const ::std::os::raw::c_char,
        data: *mut ::std::os::raw::c_void,
    ),
>;
#[doc = "! Forward declare Arrow structs\n! It is important to notice that these structs are not defined by DuckDB but are actually Arrow external objects.\n! They're defined by the C Data Interface Arrow spec: https://arrow.apache.org/docs/format/CDataInterface.html"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ArrowArray {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ArrowSchema {
    _unused: [u8; 0],
}
#[doc = "! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`."]
pub type duckdb_arrow = *mut _duckdb_arrow;
#[doc = "! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow_stream {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`."]
pub type duckdb_arrow_stream = *mut _duckdb_arrow_stream;
#[doc = "! Holds an arrow schema. Remember to release the respective ArrowSchema object."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow_schema {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds an arrow schema. Remember to release the respective ArrowSchema object."]
pub type duckdb_arrow_schema = *mut _duckdb_arrow_schema;
#[doc = "! Holds an arrow converted schema (i.e., duckdb::ArrowTableSchema).\n! In practice, this object holds the information necessary to do proper conversion between Arrow Types and DuckDB\n! Types. Check duckdb/function/table/arrow/arrow_duck_schema.hpp for more details! Must be destroyed with\n! `duckdb_destroy_arrow_converted_schema`"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow_converted_schema {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds an arrow converted schema (i.e., duckdb::ArrowTableSchema).\n! In practice, this object holds the information necessary to do proper conversion between Arrow Types and DuckDB\n! Types. Check duckdb/function/table/arrow/arrow_duck_schema.hpp for more details! Must be destroyed with\n! `duckdb_destroy_arrow_converted_schema`"]
pub type duckdb_arrow_converted_schema = *mut _duckdb_arrow_converted_schema;
#[doc = "! Holds an arrow array. Remember to release the respective ArrowSchema object."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow_array {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds an arrow array. Remember to release the respective ArrowSchema object."]
pub type duckdb_arrow_array = *mut _duckdb_arrow_array;
#[doc = "! The arrow options used when transforming the DuckDB schema and datachunks into Arrow schema and arrays.\n! Used in `duckdb_to_arrow_schema` and `duckdb_data_chunk_to_arrow`"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_arrow_options {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! The arrow options used when transforming the DuckDB schema and datachunks into Arrow schema and arrays.\n! Used in `duckdb_to_arrow_schema` and `duckdb_data_chunk_to_arrow`"]
pub type duckdb_arrow_options = *mut _duckdb_arrow_options;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_file_open_options {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
pub type duckdb_file_open_options = *mut _duckdb_file_open_options;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_file_system {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
pub type duckdb_file_system = *mut _duckdb_file_system;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_file_handle {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
pub type duckdb_file_handle = *mut _duckdb_file_handle;
#[doc = "! A handle to a database catalog.\n! Must be destroyed with `duckdb_destroy_catalog`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_catalog {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A handle to a database catalog.\n! Must be destroyed with `duckdb_destroy_catalog`."]
pub type duckdb_catalog = *mut _duckdb_catalog;
#[doc = "! A handle to a catalog entry (e.g., table, view, index, etc.).\n! Must be destroyed with `duckdb_destroy_catalog_entry`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_catalog_entry {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! A handle to a catalog entry (e.g., table, view, index, etc.).\n! Must be destroyed with `duckdb_destroy_catalog_entry`."]
pub type duckdb_catalog_entry = *mut _duckdb_catalog_entry;
#[doc = "! Holds a log storage object."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _duckdb_log_storage {
    pub internal_ptr: *mut ::std::os::raw::c_void,
}
#[doc = "! Holds a log storage object."]
pub type duckdb_log_storage = *mut _duckdb_log_storage;
#[doc = "! This function is missing the logging context, which will be added later."]
pub type duckdb_logger_write_log_entry_t = ::std::option::Option<
    unsafe extern "C" fn(
        extra_data: *mut ::std::os::raw::c_void,
        timestamp: *mut duckdb_timestamp,
        level: *const ::std::os::raw::c_char,
        log_type: *const ::std::os::raw::c_char,
        log_message: *const ::std::os::raw::c_char,
    ),
>;
#[doc = "! Passed to C API extension as a parameter to the entrypoint."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct duckdb_extension_access {
    #[doc = "! Indicate that an error has occurred."]
    pub set_error:
        ::std::option::Option<unsafe extern "C" fn(info: duckdb_extension_info, error: *const ::std::os::raw::c_char)>,
    #[doc = "! Fetch the database on which to register the extension."]
    pub get_database: ::std::option::Option<unsafe extern "C" fn(info: duckdb_extension_info) -> *mut duckdb_database>,
    #[doc = "! Fetch the API struct pointer."]
    pub get_api: ::std::option::Option<
        unsafe extern "C" fn(
            info: duckdb_extension_info,
            version: *const ::std::os::raw::c_char,
        ) -> *const ::std::os::raw::c_void,
    >,
}
unsafe extern "C" {
    #[doc = "Creates a new database instance cache.\nThe instance cache is necessary if a client/program (re)opens multiple databases to the same file within the same\nprocess. Must be destroyed with 'duckdb_destroy_instance_cache'.\n\n @return The database instance cache."]
    pub fn duckdb_create_instance_cache() -> duckdb_instance_cache;
}
unsafe extern "C" {
    #[doc = "Creates a new database instance in the instance cache, or retrieves an existing database instance.\nMust be closed with 'duckdb_close'.\n\n @param instance_cache The instance cache in which to create the database, or from which to take the database.\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open or retrieve an in-memory database.\n @param out_database The resulting cached database.\n @param config (Optional) configuration used to create the database.\n @param out_error If set and the function returns `DuckDBError`, this contains the error message.\nNote that the error message must be freed using `duckdb_free`.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_get_or_create_from_cache(
        instance_cache: duckdb_instance_cache,
        path: *const ::std::os::raw::c_char,
        out_database: *mut duckdb_database,
        config: duckdb_config,
        out_error: *mut *mut ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroys an existing database instance cache and de-allocates its memory.\n\n @param instance_cache The instance cache to destroy."]
    pub fn duckdb_destroy_instance_cache(instance_cache: *mut duckdb_instance_cache);
}
unsafe extern "C" {
    #[doc = "Creates a new database or opens an existing database file stored at the given path.\nIf no path is given a new in-memory database is created instead.\nThe database must be closed with 'duckdb_close'.\n\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.\n @param out_database The result database object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_open(path: *const ::std::os::raw::c_char, out_database: *mut duckdb_database) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.\nThe database must be closed with 'duckdb_close'.\n\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.\n @param out_database The result database object.\n @param config (Optional) configuration used to start up the database.\n @param out_error If set and the function returns `DuckDBError`, this contains the error message.\nNote that the error message must be freed using `duckdb_free`.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_open_ext(
        path: *const ::std::os::raw::c_char,
        out_database: *mut duckdb_database,
        config: duckdb_config,
        out_error: *mut *mut ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the specified database and de-allocates all memory allocated for that database.\nThis should be called after you are done with any database allocated through `duckdb_open` or `duckdb_open_ext`.\nNote that failing to call `duckdb_close` (in case of e.g. a program crash) will not cause data corruption.\nStill, it is recommended to always correctly close a database object after you are done with it.\n\n @param database The database object to shut down."]
    pub fn duckdb_close(database: *mut duckdb_database);
}
unsafe extern "C" {
    #[doc = "Opens a connection to a database. Connections are required to query the database, and store transactional state\nassociated with the connection.\nThe instantiated connection should be closed using 'duckdb_disconnect'.\n\n @param database The database file to connect to.\n @param out_connection The result connection object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_connect(database: duckdb_database, out_connection: *mut duckdb_connection) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Interrupt running query\n\n @param connection The connection to interrupt"]
    pub fn duckdb_interrupt(connection: duckdb_connection);
}
unsafe extern "C" {
    #[doc = "Get the progress of the running query.\n\n @param connection The connection running the query.\n @return The query progress type containing progress information."]
    pub fn duckdb_query_progress(connection: duckdb_connection) -> duckdb_query_progress_type;
}
unsafe extern "C" {
    #[doc = "Closes the specified connection and de-allocates all memory allocated for that connection.\n\n @param connection The connection to close."]
    pub fn duckdb_disconnect(connection: *mut duckdb_connection);
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the connection.\n\n @param connection The connection.\n @param out_context The client context of the connection. Must be destroyed with `duckdb_destroy_client_context`."]
    pub fn duckdb_connection_get_client_context(connection: duckdb_connection, out_context: *mut duckdb_client_context);
}
unsafe extern "C" {
    #[doc = "Retrieves the arrow options of the connection.\n\n @param connection The connection."]
    pub fn duckdb_connection_get_arrow_options(
        connection: duckdb_connection,
        out_arrow_options: *mut duckdb_arrow_options,
    );
}
unsafe extern "C" {
    #[doc = "Returns the connection id of the client context.\n\n @param context The client context.\n @return The connection id of the client context."]
    pub fn duckdb_client_context_get_connection_id(context: duckdb_client_context) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Destroys the client context and deallocates its memory.\n\n @param context The client context to destroy."]
    pub fn duckdb_destroy_client_context(context: *mut duckdb_client_context);
}
unsafe extern "C" {
    #[doc = "Destroys the arrow options and deallocates its memory.\n\n @param arrow_options The arrow options to destroy."]
    pub fn duckdb_destroy_arrow_options(arrow_options: *mut duckdb_arrow_options);
}
unsafe extern "C" {
    #[doc = "Returns the version of the linked DuckDB, with a version postfix for dev versions\n\nUsually used for developing C extensions that must return this for a compatibility check."]
    pub fn duckdb_library_version() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Get the list of (fully qualified) table names of the query.\n\n @param connection The connection for which to get the table names.\n @param query The query for which to get the table names.\n @param qualified Returns fully qualified table names (catalog.schema.table), if set to true, else only the (not\nescaped) table names.\n @return A duckdb_value of type VARCHAR[] containing the (fully qualified) table names of the query. Must be destroyed\nwith duckdb_destroy_value."]
    pub fn duckdb_get_table_names(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        qualified: bool,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Initializes an empty configuration object that can be used to provide start-up options for the DuckDB instance\nthrough `duckdb_open_ext`.\nThe duckdb_config must be destroyed using 'duckdb_destroy_config'\n\nThis will always succeed unless there is a malloc failure.\n\nNote that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns\n`DuckDBError`.\n\n @param out_config The result configuration object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_create_config(out_config: *mut duckdb_config) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "This returns the total amount of configuration options available for usage with `duckdb_get_config_flag`.\n\nThis should not be called in a loop as it internally loops over all the options.\n\n @return The amount of config options available."]
    pub fn duckdb_config_count() -> usize;
}
unsafe extern "C" {
    #[doc = "Obtains a human-readable name and description of a specific configuration option. This can be used to e.g.\ndisplay configuration options. This will succeed unless `index` is out of range (i.e. `>= duckdb_config_count`).\n\nThe result name or description MUST NOT be freed.\n\n @param index The index of the configuration option (between 0 and `duckdb_config_count`)\n @param out_name A name of the configuration flag.\n @param out_description A description of the configuration flag.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_get_config_flag(
        index: usize,
        out_name: *mut *const ::std::os::raw::c_char,
        out_description: *mut *const ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Sets the specified option for the specified configuration. The configuration option is indicated by name.\nTo obtain a list of config options, see `duckdb_get_config_flag`.\n\nIn the source code, configuration options are defined in `config.cpp`.\n\nThis can fail if either the name is invalid, or if the value provided for the option is invalid.\n\n @param config The configuration object to set the option on.\n @param name The name of the configuration flag to set.\n @param option The value to set the configuration flag to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_set_config(
        config: duckdb_config,
        name: *const ::std::os::raw::c_char,
        option: *const ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroys the specified configuration object and de-allocates all memory allocated for the object.\n\n @param config The configuration object to destroy."]
    pub fn duckdb_destroy_config(config: *mut duckdb_config);
}
unsafe extern "C" {
    #[doc = "Creates duckdb_error_data.\nMust be destroyed with `duckdb_destroy_error_data`.\n\n @param type The error type.\n @param message The error message.\n @return The error data."]
    pub fn duckdb_create_error_data(
        type_: duckdb_error_type,
        message: *const ::std::os::raw::c_char,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Destroys the error data and deallocates its memory.\n\n @param error_data The error data to destroy."]
    pub fn duckdb_destroy_error_data(error_data: *mut duckdb_error_data);
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_error_type of the error data.\n\n @param error_data The error data.\n @return The error type."]
    pub fn duckdb_error_data_error_type(error_data: duckdb_error_data) -> duckdb_error_type;
}
unsafe extern "C" {
    #[doc = "Returns the error message of the error data. Must not be freed.\n\n @param error_data The error data.\n @return The error message."]
    pub fn duckdb_error_data_message(error_data: duckdb_error_data) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns whether the error data contains an error or not.\n\n @param error_data The error data.\n @return True, if the error data contains an exception, else false."]
    pub fn duckdb_error_data_has_error(error_data: duckdb_error_data) -> bool;
}
unsafe extern "C" {
    #[doc = "Executes a SQL query within a connection and stores the full (materialized) result in the out_result pointer.\nIf the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling\n`duckdb_result_error`.\n\nNote that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the\nquery fails, otherwise the error stored within the result will not be freed correctly.\n\n @param connection The connection to perform the query in.\n @param query The SQL query to run.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_query(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        out_result: *mut duckdb_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the result and de-allocates all memory allocated for that result.\n\n @param result The result to destroy."]
    pub fn duckdb_destroy_result(result: *mut duckdb_result);
}
unsafe extern "C" {
    #[doc = "Returns the column name of the specified column. The result should not need to be freed; the column names will\nautomatically be destroyed when the result is destroyed.\n\nReturns `NULL` if the column is out of range.\n\n @param result The result object to fetch the column name from.\n @param col The column index.\n @return The column name of the specified column."]
    pub fn duckdb_column_name(result: *mut duckdb_result, col: idx_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the column type of the specified column.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\n\n @param result The result object to fetch the column type from.\n @param col The column index.\n @return The column type of the specified column."]
    pub fn duckdb_column_type(result: *mut duckdb_result, col: idx_t) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Returns the statement type of the statement that was executed\n\n @param result The result object to fetch the statement type from.\n @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID"]
    pub fn duckdb_result_statement_type(result: duckdb_result) -> duckdb_statement_type;
}
unsafe extern "C" {
    #[doc = "Returns the logical column type of the specified column.\n\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\nReturns `NULL` if the column is out of range.\n\n @param result The result object to fetch the column type from.\n @param col The column index.\n @return The logical column type of the specified column."]
    pub fn duckdb_column_logical_type(result: *mut duckdb_result, col: idx_t) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the arrow options associated with the given result. These options are definitions of how the arrow arrays/schema\nshould be produced.\n @param result The result object to fetch arrow options from.\n @return The arrow options associated with the given result. This must be destroyed with\n`duckdb_destroy_arrow_options`."]
    pub fn duckdb_result_get_arrow_options(result: *mut duckdb_result) -> duckdb_arrow_options;
}
unsafe extern "C" {
    #[doc = "Returns the number of columns present in a the result object.\n\n @param result The result object.\n @return The number of columns present in the result object."]
    pub fn duckdb_column_count(result: *mut duckdb_result) -> idx_t;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows present in the result object.\n\n @param result The result object.\n @return The number of rows present in the result object."]
    pub fn duckdb_row_count(result: *mut duckdb_result) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE\nqueries. For other queries the rows_changed will be 0.\n\n @param result The result object.\n @return The number of rows changed."]
    pub fn duckdb_rows_changed(result: *mut duckdb_result) -> idx_t;
}
unsafe extern "C" {
    #[doc = "DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.\n\nReturns the data of a specific column of a result in columnar format.\n\nThe function returns a dense array which contains the result data. The exact type stored in the array depends on the\ncorresponding duckdb_type (as provided by `duckdb_column_type`). For the exact type by which the data should be\naccessed, see the comments in [the types section](types) or the `DUCKDB_TYPE` enum.\n\nFor example, for a column of type `DUCKDB_TYPE_INTEGER`, rows can be accessed in the following manner:\n```c\nint32_t *data = (int32_t *) duckdb_column_data(&result, 0);\nprintf(\"Data for row %d: %d\\n\", row, data[row]);\n```\n\n @param result The result object to fetch the column data from.\n @param col The column index.\n @return The column data of the specified column."]
    pub fn duckdb_column_data(result: *mut duckdb_result, col: idx_t) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.\n\nReturns the nullmask of a specific column of a result in columnar format. The nullmask indicates for every row\nwhether or not the corresponding row is `NULL`. If a row is `NULL`, the values present in the array provided\nby `duckdb_column_data` are undefined.\n\n```c\nint32_t *data = (int32_t *) duckdb_column_data(&result, 0);\nbool *nullmask = duckdb_nullmask_data(&result, 0);\nif (nullmask[row]) {\nprintf(\"Data for row %d: NULL\\n\", row);\n} else {\nprintf(\"Data for row %d: %d\\n\", row, data[row]);\n}\n```\n\n @param result The result object to fetch the nullmask from.\n @param col The column index.\n @return The nullmask of the specified column."]
    pub fn duckdb_nullmask_data(result: *mut duckdb_result, col: idx_t) -> *mut bool;
}
unsafe extern "C" {
    #[doc = "Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`.\n\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called.\n\n @param result The result object to fetch the error from.\n @return The error of the result."]
    pub fn duckdb_result_error(result: *mut duckdb_result) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the result error type contained within the result. The error is only set if `duckdb_query` returns\n`DuckDBError`.\n\n @param result The result object to fetch the error from.\n @return The error type of the result."]
    pub fn duckdb_result_error_type(result: *mut duckdb_result) -> duckdb_error_type;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nThis function supersedes all `duckdb_value` functions, as well as the `duckdb_column_data` and `duckdb_nullmask_data`\nfunctions. It results in significantly better performance, and should be preferred in newer code-bases.\n\nIf this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be\nmixed with the legacy result functions).\n\nUse `duckdb_result_chunk_count` to figure out how many chunks there are in the result.\n\n @param result The result object to fetch the data chunk from.\n @param chunk_index The chunk index to fetch from.\n @return The resulting data chunk. Returns `NULL` if the chunk index is out of bounds."]
    pub fn duckdb_result_get_chunk(result: duckdb_result, chunk_index: idx_t) -> duckdb_data_chunk;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nChecks if the type of the internal result is StreamQueryResult.\n\n @param result The result object to check.\n @return Whether or not the result object is of the type StreamQueryResult"]
    pub fn duckdb_result_is_streaming(result: duckdb_result) -> bool;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of data chunks present in the result.\n\n @param result The result object\n @return Number of data chunks present in the result."]
    pub fn duckdb_result_chunk_count(result: duckdb_result) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error\n\n @param result The result object\n @return The return_type"]
    pub fn duckdb_result_return_type(result: duckdb_result) -> duckdb_result_type;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The boolean value at the specified location, or false if the value cannot be converted."]
    pub fn duckdb_value_boolean(result: *mut duckdb_result, col: idx_t, row: idx_t) -> bool;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int8_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_int8(result: *mut duckdb_result, col: idx_t, row: idx_t) -> i8;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int16_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_int16(result: *mut duckdb_result, col: idx_t, row: idx_t) -> i16;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int32_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_int32(result: *mut duckdb_result, col: idx_t, row: idx_t) -> i32;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int64_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_int64(result: *mut duckdb_result, col: idx_t, row: idx_t) -> i64;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_hugeint(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_hugeint;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_uhugeint(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_uhugeint;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_decimal value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_decimal(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_decimal;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint8_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_uint8(result: *mut duckdb_result, col: idx_t, row: idx_t) -> u8;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint16_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_uint16(result: *mut duckdb_result, col: idx_t, row: idx_t) -> u16;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint32_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_uint32(result: *mut duckdb_result, col: idx_t, row: idx_t) -> u32;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint64_t value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_uint64(result: *mut duckdb_result, col: idx_t, row: idx_t) -> u64;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The float value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_float(result: *mut duckdb_result, col: idx_t, row: idx_t) -> f32;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The double value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_double(result: *mut duckdb_result, col: idx_t, row: idx_t) -> f64;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_date value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_date(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_date;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_time value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_time(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_time;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_timestamp(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_timestamp;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_interval value at the specified location, or 0 if the value cannot be converted."]
    pub fn duckdb_value_interval(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_interval;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The text value at the specified location as a null-terminated string, or nullptr if the value cannot be\nconverted. The result must be freed with `duckdb_free`."]
    pub fn duckdb_value_varchar(result: *mut duckdb_result, col: idx_t, row: idx_t) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The string value at the specified location. Attempts to cast the result value to string."]
    pub fn duckdb_value_string(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_string;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.\nIf the column is NOT a VARCHAR column this function will return NULL.\n\nThe result must NOT be freed."]
    pub fn duckdb_value_varchar_internal(
        result: *mut duckdb_result,
        col: idx_t,
        row: idx_t,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.\nIf the column is NOT a VARCHAR column this function will return NULL.\n\nThe result must NOT be freed."]
    pub fn duckdb_value_string_internal(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_string;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the\nvalue cannot be converted. The resulting field \"blob.data\" must be freed with `duckdb_free.`"]
    pub fn duckdb_value_blob(result: *mut duckdb_result, col: idx_t, row: idx_t) -> duckdb_blob;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return Returns true if the value at the specified index is NULL, and false otherwise."]
    pub fn duckdb_value_is_null(result: *mut duckdb_result, col: idx_t, row: idx_t) -> bool;
}
unsafe extern "C" {
    #[doc = "Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner\nshould be freed using `duckdb_free`.\n\n @param size The number of bytes to allocate.\n @return A pointer to the allocated memory region."]
    pub fn duckdb_malloc(size: usize) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or\n`duckdb_value_string`.\n\n @param ptr The memory region to de-allocate."]
    pub fn duckdb_free(ptr: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
    #[doc = "The internal vector size used by DuckDB.\nThis is the amount of tuples that will fit into a data chunk created by `duckdb_create_data_chunk`.\n\n @return The vector size."]
    pub fn duckdb_vector_size() -> idx_t;
}
unsafe extern "C" {
    #[doc = "Whether or not the duckdb_string_t value is inlined.\nThis means that the data of the string does not have a separate allocation."]
    pub fn duckdb_string_is_inlined(string: duckdb_string_t) -> bool;
}
unsafe extern "C" {
    #[doc = "Get the string length of a string_t\n\n @param string The string to get the length of.\n @return The length."]
    pub fn duckdb_string_t_length(string: duckdb_string_t) -> u32;
}
unsafe extern "C" {
    #[doc = "Get a pointer to the string data of a string_t\n\n @param string The string to get the pointer to.\n @return The pointer."]
    pub fn duckdb_string_t_data(string: *mut duckdb_string_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Checks if a string is valid UTF-8.\n\n @param str The string to check\n @param len The length of the string (in bytes)\n @return nullptr if the string is valid UTF-8. Otherwise, a duckdb_error_data containing error information. Must be\ndestroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_valid_utf8_check(str_: *const ::std::os::raw::c_char, len: idx_t) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).\n\n @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.\n @return The `duckdb_date_struct` with the decomposed elements."]
    pub fn duckdb_from_date(date: duckdb_date) -> duckdb_date_struct;
}
unsafe extern "C" {
    #[doc = "Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).\n\n @param date The year, month and date stored in a `duckdb_date_struct`.\n @return The `duckdb_date` element."]
    pub fn duckdb_to_date(date: duckdb_date_struct) -> duckdb_date;
}
unsafe extern "C" {
    #[doc = "Test a `duckdb_date` to see if it is a finite value.\n\n @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.\n @return True if the date is finite, false if it is ±infinity."]
    pub fn duckdb_is_finite_date(date: duckdb_date) -> bool;
}
unsafe extern "C" {
    #[doc = "Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).\n\n @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.\n @return The `duckdb_time_struct` with the decomposed elements."]
    pub fn duckdb_from_time(time: duckdb_time) -> duckdb_time_struct;
}
unsafe extern "C" {
    #[doc = "Create a `duckdb_time_tz` object from micros and a timezone offset.\n\n @param micros The microsecond component of the time.\n @param offset The timezone offset component of the time.\n @return The `duckdb_time_tz` element."]
    pub fn duckdb_create_time_tz(micros: i64, offset: i32) -> duckdb_time_tz;
}
unsafe extern "C" {
    #[doc = "Decompose a TIME_TZ objects into micros and a timezone offset.\n\nUse `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond.\n\n @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column."]
    pub fn duckdb_from_time_tz(micros: duckdb_time_tz) -> duckdb_time_tz_struct;
}
unsafe extern "C" {
    #[doc = "Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).\n\n @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.\n @return The `duckdb_time` element."]
    pub fn duckdb_to_time(time: duckdb_time_struct) -> duckdb_time;
}
unsafe extern "C" {
    #[doc = "Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.\n\n @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.\n @return The `duckdb_timestamp_struct` with the decomposed elements."]
    pub fn duckdb_from_timestamp(ts: duckdb_timestamp) -> duckdb_timestamp_struct;
}
unsafe extern "C" {
    #[doc = "Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.\n\n @param ts The de-composed elements in a `duckdb_timestamp_struct`.\n @return The `duckdb_timestamp` element."]
    pub fn duckdb_to_timestamp(ts: duckdb_timestamp_struct) -> duckdb_timestamp;
}
unsafe extern "C" {
    #[doc = "Test a `duckdb_timestamp` to see if it is a finite value.\n\n @param ts The duckdb_timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
    pub fn duckdb_is_finite_timestamp(ts: duckdb_timestamp) -> bool;
}
unsafe extern "C" {
    #[doc = "Test a `duckdb_timestamp_s` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_s object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_S` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
    pub fn duckdb_is_finite_timestamp_s(ts: duckdb_timestamp_s) -> bool;
}
unsafe extern "C" {
    #[doc = "Test a `duckdb_timestamp_ms` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_ms object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_MS` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
    pub fn duckdb_is_finite_timestamp_ms(ts: duckdb_timestamp_ms) -> bool;
}
unsafe extern "C" {
    #[doc = "Test a `duckdb_timestamp_ns` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_ns object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_NS` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
    pub fn duckdb_is_finite_timestamp_ns(ts: duckdb_timestamp_ns) -> bool;
}
unsafe extern "C" {
    #[doc = "Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.\n\n @param val The hugeint value.\n @return The converted `double` element."]
    pub fn duckdb_hugeint_to_double(val: duckdb_hugeint) -> f64;
}
unsafe extern "C" {
    #[doc = "Converts a double value to a duckdb_hugeint object.\n\nIf the conversion fails because the double value is too big the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_hugeint` element."]
    pub fn duckdb_double_to_hugeint(val: f64) -> duckdb_hugeint;
}
unsafe extern "C" {
    #[doc = "Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.\n\n @param val The uhugeint value.\n @return The converted `double` element."]
    pub fn duckdb_uhugeint_to_double(val: duckdb_uhugeint) -> f64;
}
unsafe extern "C" {
    #[doc = "Converts a double value to a duckdb_uhugeint object.\n\nIf the conversion fails because the double value is too big the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_uhugeint` element."]
    pub fn duckdb_double_to_uhugeint(val: f64) -> duckdb_uhugeint;
}
unsafe extern "C" {
    #[doc = "Converts a double value to a duckdb_decimal object.\n\nIf the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_decimal` element."]
    pub fn duckdb_double_to_decimal(val: f64, width: u8, scale: u8) -> duckdb_decimal;
}
unsafe extern "C" {
    #[doc = "Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.\n\n @param val The decimal value.\n @return The converted `double` element."]
    pub fn duckdb_decimal_to_double(val: duckdb_decimal) -> f64;
}
unsafe extern "C" {
    #[doc = "Create a prepared statement object from a query.\n\nNote that after calling `duckdb_prepare`, the prepared statement should always be destroyed using\n`duckdb_destroy_prepare`, even if the prepare fails.\n\nIf the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.\n\n @param connection The connection object\n @param query The SQL query to prepare\n @param out_prepared_statement The resulting prepared statement object\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_prepare(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        out_prepared_statement: *mut duckdb_prepared_statement,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the prepared statement and de-allocates all memory allocated for the statement.\n\n @param prepared_statement The prepared statement to destroy."]
    pub fn duckdb_destroy_prepare(prepared_statement: *mut duckdb_prepared_statement);
}
unsafe extern "C" {
    #[doc = "Returns the error message associated with the given prepared statement.\nIf the prepared statement has no error message, this returns `nullptr` instead.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called.\n\n @param prepared_statement The prepared statement to obtain the error from.\n @return The error message, or `nullptr` if there is none."]
    pub fn duckdb_prepare_error(prepared_statement: duckdb_prepared_statement) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the number of parameters that can be provided to the given prepared statement.\n\nReturns 0 if the query was not successfully prepared.\n\n @param prepared_statement The prepared statement to obtain the number of parameters for."]
    pub fn duckdb_nparams(prepared_statement: duckdb_prepared_statement) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the name used to identify the parameter\nThe returned string should be freed using `duckdb_free`.\n\nReturns NULL if the index is out of range for the provided prepared statement.\n\n @param prepared_statement The prepared statement for which to get the parameter name from."]
    pub fn duckdb_parameter_name(
        prepared_statement: duckdb_prepared_statement,
        index: idx_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the parameter type for the parameter at the given index.\n\nReturns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared.\n\n @param prepared_statement The prepared statement.\n @param param_idx The parameter index.\n @return The parameter type"]
    pub fn duckdb_param_type(prepared_statement: duckdb_prepared_statement, param_idx: idx_t) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Returns the logical type for the parameter at the given index.\n\nReturns `nullptr` if the parameter index is out of range or the statement was not successfully prepared.\n\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\n @param prepared_statement The prepared statement.\n @param param_idx The parameter index.\n @return The logical type of the parameter"]
    pub fn duckdb_param_logical_type(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Clear the params bind to the prepared statement."]
    pub fn duckdb_clear_bindings(prepared_statement: duckdb_prepared_statement) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Returns the statement type of the statement to be executed\n\n @param statement The prepared statement.\n @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID"]
    pub fn duckdb_prepared_statement_type(statement: duckdb_prepared_statement) -> duckdb_statement_type;
}
unsafe extern "C" {
    #[doc = "Returns the number of columns present in a the result of the prepared statement. If any of the column types are invalid,\nthe result will be 1.\n\n @param prepared_statement The prepared statement.\n @return The number of columns present in the result of the prepared statement."]
    pub fn duckdb_prepared_statement_column_count(prepared_statement: duckdb_prepared_statement) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the name of the specified column of the result of the prepared_statement.\nThe returned string should be freed using `duckdb_free`.\n\nReturns `nullptr` if the column is out of range.\n\n @param prepared_statement The prepared statement.\n @param col_idx The column index.\n @return The column name of the specified column."]
    pub fn duckdb_prepared_statement_column_name(
        prepared_statement: duckdb_prepared_statement,
        col_idx: idx_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the column type of the specified column of the result of the prepared_statement.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\n @param prepared_statement The prepared statement to fetch the column type from.\n @param col_idx The column index.\n @return The logical type of the specified column."]
    pub fn duckdb_prepared_statement_column_logical_type(
        prepared_statement: duckdb_prepared_statement,
        col_idx: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the column type of the specified column of the result of the prepared_statement.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\n\n @param prepared_statement The prepared statement to fetch the column type from.\n @param col_idx The column index.\n @return The type of the specified column."]
    pub fn duckdb_prepared_statement_column_type(
        prepared_statement: duckdb_prepared_statement,
        col_idx: idx_t,
    ) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Binds a value to the prepared statement at the specified index.\n\nSupersedes all type-specific bind functions (e.g., `duckdb_bind_varchar`, `duckdb_bind_int64`, etc.)."]
    pub fn duckdb_bind_value(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_value,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Retrieve the index of the parameter for the prepared statement, identified by name"]
    pub fn duckdb_bind_parameter_index(
        prepared_statement: duckdb_prepared_statement,
        param_idx_out: *mut idx_t,
        name: *const ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a bool value to the prepared statement at the specified index."]
    pub fn duckdb_bind_boolean(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: bool,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds an int8_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_int8(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: i8) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds an int16_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_int16(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: i16)
    -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds an int32_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_int32(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: i32)
    -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds an int64_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_int64(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: i64)
    -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_hugeint value to the prepared statement at the specified index."]
    pub fn duckdb_bind_hugeint(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_hugeint,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_uhugeint value to the prepared statement at the specified index."]
    pub fn duckdb_bind_uhugeint(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_uhugeint,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_decimal value to the prepared statement at the specified index."]
    pub fn duckdb_bind_decimal(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_decimal,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a uint8_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_uint8(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: u8) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a uint16_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_uint16(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: u16,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a uint32_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_uint32(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: u32,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a uint64_t value to the prepared statement at the specified index."]
    pub fn duckdb_bind_uint64(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: u64,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a float value to the prepared statement at the specified index."]
    pub fn duckdb_bind_float(prepared_statement: duckdb_prepared_statement, param_idx: idx_t, val: f32)
    -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a double value to the prepared statement at the specified index."]
    pub fn duckdb_bind_double(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: f64,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_date value to the prepared statement at the specified index."]
    pub fn duckdb_bind_date(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_date,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_time value to the prepared statement at the specified index."]
    pub fn duckdb_bind_time(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_time,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_timestamp value to the prepared statement at the specified index."]
    pub fn duckdb_bind_timestamp(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_timestamp,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_timestamp value to the prepared statement at the specified index."]
    pub fn duckdb_bind_timestamp_tz(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_timestamp,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a duckdb_interval value to the prepared statement at the specified index."]
    pub fn duckdb_bind_interval(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: duckdb_interval,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a null-terminated varchar value to the prepared statement at the specified index.\n\nSuperseded by `duckdb_bind_value`."]
    pub fn duckdb_bind_varchar(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: *const ::std::os::raw::c_char,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a varchar value to the prepared statement at the specified index.\n\nSuperseded by `duckdb_bind_value`."]
    pub fn duckdb_bind_varchar_length(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        val: *const ::std::os::raw::c_char,
        length: idx_t,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a blob value to the prepared statement at the specified index."]
    pub fn duckdb_bind_blob(
        prepared_statement: duckdb_prepared_statement,
        param_idx: idx_t,
        data: *const ::std::os::raw::c_void,
        length: idx_t,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Binds a NULL value to the prepared statement at the specified index."]
    pub fn duckdb_bind_null(prepared_statement: duckdb_prepared_statement, param_idx: idx_t) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Executes the prepared statement with the given bound parameters, and returns a materialized query result.\n\nThis method can be called multiple times for each prepared statement, and the parameters can be modified\nbetween calls to this function.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_execute_prepared(
        prepared_statement: duckdb_prepared_statement,
        out_result: *mut duckdb_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns an optionally-streaming query result.\nTo determine if the resulting query was in fact streamed, use `duckdb_result_is_streaming`\n\nThis method can be called multiple times for each prepared statement, and the parameters can be modified\nbetween calls to this function.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_execute_prepared_streaming(
        prepared_statement: duckdb_prepared_statement,
        out_result: *mut duckdb_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Extract all statements from a query.\nNote that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using\n`duckdb_destroy_extracted`, even if no statements were extracted.\n\nIf the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.\n\n @param connection The connection object\n @param query The SQL query to extract\n @param out_extracted_statements The resulting extracted statements object\n @return The number of extracted statements or 0 on failure."]
    pub fn duckdb_extract_statements(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        out_extracted_statements: *mut duckdb_extracted_statements,
    ) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Prepare an extracted statement.\nNote that after calling `duckdb_prepare_extracted_statement`, the prepared statement should always be destroyed using\n`duckdb_destroy_prepare`, even if the prepare fails.\n\nIf the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.\n\n @param connection The connection object\n @param extracted_statements The extracted statements object\n @param index The index of the extracted statement to prepare\n @param out_prepared_statement The resulting prepared statement object\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_prepare_extracted_statement(
        connection: duckdb_connection,
        extracted_statements: duckdb_extracted_statements,
        index: idx_t,
        out_prepared_statement: *mut duckdb_prepared_statement,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Returns the error message contained within the extracted statements.\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_extracted` is called.\n\n @param extracted_statements The extracted statements to fetch the error from.\n @return The error of the extracted statements."]
    pub fn duckdb_extract_statements_error(
        extracted_statements: duckdb_extracted_statements,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "De-allocates all memory allocated for the extracted statements.\n @param extracted_statements The extracted statements to destroy."]
    pub fn duckdb_destroy_extracted(extracted_statements: *mut duckdb_extracted_statements);
}
unsafe extern "C" {
    #[doc = "Executes the prepared statement with the given bound parameters, and returns a pending result.\nThe pending result represents an intermediate structure for a query that is not yet fully executed.\nThe pending result can be used to incrementally execute a query, returning control to the client between tasks.\n\nNote that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using\n`duckdb_destroy_pending`, even if this function returns DuckDBError.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The pending query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_pending_prepared(
        prepared_statement: duckdb_prepared_statement,
        out_result: *mut duckdb_pending_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns a pending result.\nThis pending result will create a streaming duckdb_result when executed.\nThe pending result represents an intermediate structure for a query that is not yet fully executed.\n\nNote that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using\n`duckdb_destroy_pending`, even if this function returns DuckDBError.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The pending query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_pending_prepared_streaming(
        prepared_statement: duckdb_prepared_statement,
        out_result: *mut duckdb_pending_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the pending result and de-allocates all memory allocated for the result.\n\n @param pending_result The pending result to destroy."]
    pub fn duckdb_destroy_pending(pending_result: *mut duckdb_pending_result);
}
unsafe extern "C" {
    #[doc = "Returns the error message contained within the pending result.\n\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called.\n\n @param pending_result The pending result to fetch the error from.\n @return The error of the pending result."]
    pub fn duckdb_pending_error(pending_result: duckdb_pending_result) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Executes a single task within the query, returning whether or not the query is ready.\n\nIf this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.\nIf this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_task function should be called again.\nIf this returns DUCKDB_PENDING_ERROR, an error occurred during execution.\n\nThe error message can be obtained by calling duckdb_pending_error on the pending_result.\n\n @param pending_result The pending result to execute a task within.\n @return The state of the pending result after the execution."]
    pub fn duckdb_pending_execute_task(pending_result: duckdb_pending_result) -> duckdb_pending_state;
}
unsafe extern "C" {
    #[doc = "If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.\nIf this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_check_state function should be called again.\nIf this returns DUCKDB_PENDING_ERROR, an error occurred during execution.\n\nThe error message can be obtained by calling duckdb_pending_error on the pending_result.\n\n @param pending_result The pending result.\n @return The state of the pending result."]
    pub fn duckdb_pending_execute_check_state(pending_result: duckdb_pending_result) -> duckdb_pending_state;
}
unsafe extern "C" {
    #[doc = "Fully execute a pending query result, returning the final query result.\n\nIf duckdb_pending_execute_task has been called until DUCKDB_PENDING_RESULT_READY was returned, this will return fast.\nOtherwise, all remaining tasks must be executed first.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param pending_result The pending result to execute.\n @param out_result The result object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_execute_pending(
        pending_result: duckdb_pending_result,
        out_result: *mut duckdb_result,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is\nDUCKDB_PENDING_RESULT_READY, this function will return true.\n\n @param pending_state The pending state on which to decide whether to finish execution.\n @return Boolean indicating pending execution should be considered finished."]
    pub fn duckdb_pending_execution_is_finished(pending_state: duckdb_pending_state) -> bool;
}
unsafe extern "C" {
    #[doc = "Destroys the value and de-allocates all memory allocated for that type.\n\n @param value The value to destroy."]
    pub fn duckdb_destroy_value(value: *mut duckdb_value);
}
unsafe extern "C" {
    #[doc = "Creates a value from a null-terminated string. Returns nullptr if the string is not valid UTF-8 or other invalid input.\n\nSuperseded by `duckdb_create_varchar_length`.\n\n @param text The null-terminated string\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_varchar(text: *const ::std::os::raw::c_char) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a string. Returns nullptr if the string is not valid UTF-8 or other invalid input.\n\n @param text The text\n @param length The length of the text\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_varchar_length(text: *const ::std::os::raw::c_char, length: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a boolean\n\n @param input The boolean value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_bool(input: bool) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from an int8_t (a tinyint)\n\n @param input The tinyint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_int8(input: i8) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a uint8_t (a utinyint)\n\n @param input The utinyint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uint8(input: u8) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from an int16_t (a smallint)\n\n @param input The smallint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_int16(input: i16) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a uint16_t (a usmallint)\n\n @param input The usmallint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uint16(input: u16) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from an int32_t (an integer)\n\n @param input The integer value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_int32(input: i32) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a uint32_t (a uinteger)\n\n @param input The uinteger value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uint32(input: u32) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a uint64_t (a ubigint)\n\n @param input The ubigint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uint64(input: u64) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from an int64\n\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_int64(val: i64) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a hugeint\n\n @param input The hugeint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_hugeint(input: duckdb_hugeint) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a uhugeint\n\n @param input The uhugeint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uhugeint(input: duckdb_uhugeint) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a BIGNUM value from a duckdb_bignum\n\n @param input The duckdb_bignum value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_bignum(input: duckdb_bignum) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a DECIMAL value from a duckdb_decimal\n\n @param input The duckdb_decimal value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_decimal(input: duckdb_decimal) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a float\n\n @param input The float value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_float(input: f32) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a double\n\n @param input The double value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_double(input: f64) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a date\n\n @param input The date value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_date(input: duckdb_date) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a time\n\n @param input The time value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_time(input: duckdb_time) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a time_ns\n\n @param input The time value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_time_ns(input: duckdb_time_ns) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a time_tz.\nNot to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t.\n\n @param value The time_tz value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_time_tz_value(value: duckdb_time_tz) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a TIMESTAMP value from a duckdb_timestamp\n\n @param input The duckdb_timestamp value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_timestamp(input: duckdb_timestamp) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a TIMESTAMP_TZ value from a duckdb_timestamp\n\n @param input The duckdb_timestamp value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_timestamp_tz(input: duckdb_timestamp) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a TIMESTAMP_S value from a duckdb_timestamp_s\n\n @param input The duckdb_timestamp_s value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_timestamp_s(input: duckdb_timestamp_s) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms\n\n @param input The duckdb_timestamp_ms value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_timestamp_ms(input: duckdb_timestamp_ms) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns\n\n @param input The duckdb_timestamp_ns value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_timestamp_ns(input: duckdb_timestamp_ns) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from an interval\n\n @param input The interval value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_interval(input: duckdb_interval) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a value from a blob\n\n @param data The blob data\n @param length The length of the blob data\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_blob(data: *const u8, length: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a BIT value from a duckdb_bit\n\n @param input The duckdb_bit value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_bit(input: duckdb_bit) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a UUID value from a uhugeint\n\n @param input The duckdb_uhugeint containing the UUID\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_uuid(input: duckdb_uhugeint) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the boolean value of the given value.\n\n @param val A duckdb_value containing a boolean\n @return A boolean, or false if the value cannot be converted"]
    pub fn duckdb_get_bool(val: duckdb_value) -> bool;
}
unsafe extern "C" {
    #[doc = "Returns the int8_t value of the given value.\n\n @param val A duckdb_value containing a tinyint\n @return A int8_t, or MinValue<int8> if the value cannot be converted"]
    pub fn duckdb_get_int8(val: duckdb_value) -> i8;
}
unsafe extern "C" {
    #[doc = "Returns the uint8_t value of the given value.\n\n @param val A duckdb_value containing a utinyint\n @return A uint8_t, or MinValue<uint8> if the value cannot be converted"]
    pub fn duckdb_get_uint8(val: duckdb_value) -> u8;
}
unsafe extern "C" {
    #[doc = "Returns the int16_t value of the given value.\n\n @param val A duckdb_value containing a smallint\n @return A int16_t, or MinValue<int16> if the value cannot be converted"]
    pub fn duckdb_get_int16(val: duckdb_value) -> i16;
}
unsafe extern "C" {
    #[doc = "Returns the uint16_t value of the given value.\n\n @param val A duckdb_value containing a usmallint\n @return A uint16_t, or MinValue<uint16> if the value cannot be converted"]
    pub fn duckdb_get_uint16(val: duckdb_value) -> u16;
}
unsafe extern "C" {
    #[doc = "Returns the int32_t value of the given value.\n\n @param val A duckdb_value containing an integer\n @return A int32_t, or MinValue<int32> if the value cannot be converted"]
    pub fn duckdb_get_int32(val: duckdb_value) -> i32;
}
unsafe extern "C" {
    #[doc = "Returns the uint32_t value of the given value.\n\n @param val A duckdb_value containing a uinteger\n @return A uint32_t, or MinValue<uint32> if the value cannot be converted"]
    pub fn duckdb_get_uint32(val: duckdb_value) -> u32;
}
unsafe extern "C" {
    #[doc = "Returns the int64_t value of the given value.\n\n @param val A duckdb_value containing a bigint\n @return A int64_t, or MinValue<int64> if the value cannot be converted"]
    pub fn duckdb_get_int64(val: duckdb_value) -> i64;
}
unsafe extern "C" {
    #[doc = "Returns the uint64_t value of the given value.\n\n @param val A duckdb_value containing a ubigint\n @return A uint64_t, or MinValue<uint64> if the value cannot be converted"]
    pub fn duckdb_get_uint64(val: duckdb_value) -> u64;
}
unsafe extern "C" {
    #[doc = "Returns the hugeint value of the given value.\n\n @param val A duckdb_value containing a hugeint\n @return A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted"]
    pub fn duckdb_get_hugeint(val: duckdb_value) -> duckdb_hugeint;
}
unsafe extern "C" {
    #[doc = "Returns the uhugeint value of the given value.\n\n @param val A duckdb_value containing a uhugeint\n @return A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted"]
    pub fn duckdb_get_uhugeint(val: duckdb_value) -> duckdb_uhugeint;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_bignum value of the given value.\nThe `data` field must be destroyed with `duckdb_free`.\n\n @param val A duckdb_value containing a BIGNUM\n @return A duckdb_bignum. The `data` field must be destroyed with `duckdb_free`."]
    pub fn duckdb_get_bignum(val: duckdb_value) -> duckdb_bignum;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_decimal value of the given value.\n\n @param val A duckdb_value containing a DECIMAL\n @return A duckdb_decimal, or MinValue<decimal> if the value cannot be converted"]
    pub fn duckdb_get_decimal(val: duckdb_value) -> duckdb_decimal;
}
unsafe extern "C" {
    #[doc = "Returns the float value of the given value.\n\n @param val A duckdb_value containing a float\n @return A float, or NAN if the value cannot be converted"]
    pub fn duckdb_get_float(val: duckdb_value) -> f32;
}
unsafe extern "C" {
    #[doc = "Returns the double value of the given value.\n\n @param val A duckdb_value containing a double\n @return A double, or NAN if the value cannot be converted"]
    pub fn duckdb_get_double(val: duckdb_value) -> f64;
}
unsafe extern "C" {
    #[doc = "Returns the date value of the given value.\n\n @param val A duckdb_value containing a date\n @return A duckdb_date, or MinValue<date> if the value cannot be converted"]
    pub fn duckdb_get_date(val: duckdb_value) -> duckdb_date;
}
unsafe extern "C" {
    #[doc = "Returns the time value of the given value.\n\n @param val A duckdb_value containing a time\n @return A duckdb_time, or MinValue<time> if the value cannot be converted"]
    pub fn duckdb_get_time(val: duckdb_value) -> duckdb_time;
}
unsafe extern "C" {
    #[doc = "Returns the time_ns value of the given value.\n\n @param val A duckdb_value containing a time_ns\n @return A duckdb_time_ns, or MinValue<time_ns> if the value cannot be converted"]
    pub fn duckdb_get_time_ns(val: duckdb_value) -> duckdb_time_ns;
}
unsafe extern "C" {
    #[doc = "Returns the time_tz value of the given value.\n\n @param val A duckdb_value containing a time_tz\n @return A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted"]
    pub fn duckdb_get_time_tz(val: duckdb_value) -> duckdb_time_tz;
}
unsafe extern "C" {
    #[doc = "Returns the TIMESTAMP value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP\n @return A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted"]
    pub fn duckdb_get_timestamp(val: duckdb_value) -> duckdb_timestamp;
}
unsafe extern "C" {
    #[doc = "Returns the TIMESTAMP_TZ value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_TZ\n @return A duckdb_timestamp, or MinValue<timestamp_tz> if the value cannot be converted"]
    pub fn duckdb_get_timestamp_tz(val: duckdb_value) -> duckdb_timestamp;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_timestamp_s value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_S\n @return A duckdb_timestamp_s, or MinValue<timestamp_s> if the value cannot be converted"]
    pub fn duckdb_get_timestamp_s(val: duckdb_value) -> duckdb_timestamp_s;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_timestamp_ms value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_MS\n @return A duckdb_timestamp_ms, or MinValue<timestamp_ms> if the value cannot be converted"]
    pub fn duckdb_get_timestamp_ms(val: duckdb_value) -> duckdb_timestamp_ms;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_timestamp_ns value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_NS\n @return A duckdb_timestamp_ns, or MinValue<timestamp_ns> if the value cannot be converted"]
    pub fn duckdb_get_timestamp_ns(val: duckdb_value) -> duckdb_timestamp_ns;
}
unsafe extern "C" {
    #[doc = "Returns the interval value of the given value.\n\n @param val A duckdb_value containing a interval\n @return A duckdb_interval, or MinValue<interval> if the value cannot be converted"]
    pub fn duckdb_get_interval(val: duckdb_value) -> duckdb_interval;
}
unsafe extern "C" {
    #[doc = "Returns the type of the given value. The type is valid as long as the value is not destroyed.\nThe type itself must not be destroyed.\n\n @param val A duckdb_value\n @return A duckdb_logical_type."]
    pub fn duckdb_get_value_type(val: duckdb_value) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the blob value of the given value.\n\n @param val A duckdb_value containing a blob\n @return A duckdb_blob"]
    pub fn duckdb_get_blob(val: duckdb_value) -> duckdb_blob;
}
unsafe extern "C" {
    #[doc = "Returns the duckdb_bit value of the given value.\nThe `data` field must be destroyed with `duckdb_free`.\n\n @param val A duckdb_value containing a BIT\n @return A duckdb_bit"]
    pub fn duckdb_get_bit(val: duckdb_value) -> duckdb_bit;
}
unsafe extern "C" {
    #[doc = "Returns a duckdb_uhugeint representing the UUID value of the given value.\n\n @param val A duckdb_value containing a UUID\n @return A duckdb_uhugeint representing the UUID value"]
    pub fn duckdb_get_uuid(val: duckdb_value) -> duckdb_uhugeint;
}
unsafe extern "C" {
    #[doc = "Obtains a string representation of the given value.\nThe result must be destroyed with `duckdb_free`.\n\n @param value The value\n @return The string value. This must be destroyed with `duckdb_free`."]
    pub fn duckdb_get_varchar(value: duckdb_value) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the struct\n @param values The values for the struct fields\n @return The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
    pub fn duckdb_create_struct_value(type_: duckdb_logical_type, values: *mut duckdb_value) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a list value from a child (element) type and an array of values of length `value_count`.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the list\n @param values The values for the list\n @param value_count The number of values in the list\n @return The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
    pub fn duckdb_create_list_value(
        type_: duckdb_logical_type,
        values: *mut duckdb_value,
        value_count: idx_t,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates an array value from a child (element) type and an array of values of length `value_count`.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the array\n @param values The values for the array\n @param value_count The number of values in the array\n @return The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
    pub fn duckdb_create_array_value(
        type_: duckdb_logical_type,
        values: *mut duckdb_value,
        value_count: idx_t,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a map value from a map type and two arrays, one for the keys and one for the values, each of length\n`entry_count`. Must be destroyed with `duckdb_destroy_value`.\n\n @param map_type The map type\n @param keys The keys of the map\n @param values The values of the map\n @param entry_count The number of entrys (key-value pairs) in the map\n @return The map value, or nullptr, if the parameters are invalid."]
    pub fn duckdb_create_map_value(
        map_type: duckdb_logical_type,
        keys: *mut duckdb_value,
        values: *mut duckdb_value,
        entry_count: idx_t,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a union value from a union type, a tag index, and a value.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param union_type The union type\n @param tag_index The index of the tag of the union\n @param value The value of the union for that tag\n @return The union value, or nullptr, if the parameters are invalid."]
    pub fn duckdb_create_union_value(
        union_type: duckdb_logical_type,
        tag_index: idx_t,
        value: duckdb_value,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the number of elements in a MAP value.\n\n @param value The MAP value.\n @return The number of elements in the map."]
    pub fn duckdb_get_map_size(value: duckdb_value) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the MAP key at index as a duckdb_value.\n\n @param value The MAP value.\n @param index The index of the key.\n @return The key as a duckdb_value."]
    pub fn duckdb_get_map_key(value: duckdb_value, index: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the MAP value at index as a duckdb_value.\n\n @param value The MAP value.\n @param index The index of the value.\n @return The value as a duckdb_value."]
    pub fn duckdb_get_map_value(value: duckdb_value, index: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns whether the value's type is SQLNULL or not.\n\n @param value The value to check.\n @return True, if the value's type is SQLNULL, otherwise false."]
    pub fn duckdb_is_null_value(value: duckdb_value) -> bool;
}
unsafe extern "C" {
    #[doc = "Creates a value of type SQLNULL.\n\n @return The duckdb_value representing SQLNULL. This must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_create_null_value() -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the number of elements in a LIST value.\n\n @param value The LIST value.\n @return The number of elements in the list."]
    pub fn duckdb_get_list_size(value: duckdb_value) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the LIST child at index as a duckdb_value.\n\n @param value The LIST value.\n @param index The index of the child.\n @return The child as a duckdb_value."]
    pub fn duckdb_get_list_child(value: duckdb_value, index: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates an enum value from a type and a value. Must be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the enum\n @param value The value for the enum\n @return The enum value, or nullptr."]
    pub fn duckdb_create_enum_value(type_: duckdb_logical_type, value: u64) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the enum value of the given value.\n\n @param value A duckdb_value containing an enum\n @return A uint64_t, or MinValue<uint64> if the value cannot be converted"]
    pub fn duckdb_get_enum_value(value: duckdb_value) -> u64;
}
unsafe extern "C" {
    #[doc = "Returns the STRUCT child at index as a duckdb_value.\n\n @param value The STRUCT value.\n @param index The index of the child.\n @return The child as a duckdb_value."]
    pub fn duckdb_get_struct_child(value: duckdb_value, index: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the SQL string representation of the given value.\n\n @param value A duckdb_value.\n @return The SQL string representation as a null-terminated string. The result must be freed with `duckdb_free`."]
    pub fn duckdb_value_to_string(value: duckdb_value) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Creates a `duckdb_logical_type` from a primitive type.\nThe resulting logical type must be destroyed with `duckdb_destroy_logical_type`.\n\nReturns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,\n`DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.\n\n @param type The primitive type to create.\n @return The logical type."]
    pub fn duckdb_create_logical_type(type_: duckdb_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the alias of a duckdb_logical_type, if set, else `nullptr`.\nThe result must be destroyed with `duckdb_free`.\n\n @param type The logical type\n @return The alias or `nullptr`"]
    pub fn duckdb_logical_type_get_alias(type_: duckdb_logical_type) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Sets the alias of a duckdb_logical_type.\n\n @param type The logical type\n @param alias The alias to set"]
    pub fn duckdb_logical_type_set_alias(type_: duckdb_logical_type, alias: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Creates a LIST type from its child type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param type The child type of the list\n @return The logical type."]
    pub fn duckdb_create_list_type(type_: duckdb_logical_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates an ARRAY type from its child type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param type The child type of the array.\n @param array_size The number of elements in the array.\n @return The logical type."]
    pub fn duckdb_create_array_type(type_: duckdb_logical_type, array_size: idx_t) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates a MAP type from its key type and value type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param key_type The map's key type.\n @param value_type The map's value type.\n @return The logical type."]
    pub fn duckdb_create_map_type(
        key_type: duckdb_logical_type,
        value_type: duckdb_logical_type,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates a UNION type from the passed arrays.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_types The array of union member types.\n @param member_names The union member names.\n @param member_count The number of union members.\n @return The logical type."]
    pub fn duckdb_create_union_type(
        member_types: *mut duckdb_logical_type,
        member_names: *mut *const ::std::os::raw::c_char,
        member_count: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates a STRUCT type based on the member types and names.\nThe resulting type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_types The array of types of the struct members.\n @param member_names The array of names of the struct members.\n @param member_count The number of members of the struct.\n @return The logical type."]
    pub fn duckdb_create_struct_type(
        member_types: *mut duckdb_logical_type,
        member_names: *mut *const ::std::os::raw::c_char,
        member_count: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates an ENUM type from the passed member name array.\nThe resulting type should be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_names The array of names that the enum should consist of.\n @param member_count The number of elements that were specified in the array.\n @return The logical type."]
    pub fn duckdb_create_enum_type(
        member_names: *mut *const ::std::os::raw::c_char,
        member_count: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Creates a DECIMAL type with the specified width and scale.\nThe resulting type should be destroyed with `duckdb_destroy_logical_type`.\n\n @param width The width of the decimal type\n @param scale The scale of the decimal type\n @return The logical type."]
    pub fn duckdb_create_decimal_type(width: u8, scale: u8) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.\n\n @param type The logical type.\n @return The `duckdb_type` id."]
    pub fn duckdb_get_type_id(type_: duckdb_logical_type) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the width of a decimal type.\n\n @param type The logical type object\n @return The width of the decimal type"]
    pub fn duckdb_decimal_width(type_: duckdb_logical_type) -> u8;
}
unsafe extern "C" {
    #[doc = "Retrieves the scale of a decimal type.\n\n @param type The logical type object\n @return The scale of the decimal type"]
    pub fn duckdb_decimal_scale(type_: duckdb_logical_type) -> u8;
}
unsafe extern "C" {
    #[doc = "Retrieves the internal storage type of a decimal type.\n\n @param type The logical type object\n @return The internal type of the decimal type"]
    pub fn duckdb_decimal_internal_type(type_: duckdb_logical_type) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the internal storage type of an enum type.\n\n @param type The logical type object\n @return The internal type of the enum type"]
    pub fn duckdb_enum_internal_type(type_: duckdb_logical_type) -> duckdb_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the dictionary size of the enum type.\n\n @param type The logical type object\n @return The dictionary size of the enum type"]
    pub fn duckdb_enum_dictionary_size(type_: duckdb_logical_type) -> u32;
}
unsafe extern "C" {
    #[doc = "Retrieves the dictionary value at the specified position from the enum.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The index in the dictionary\n @return The string value of the enum type. Must be freed with `duckdb_free`."]
    pub fn duckdb_enum_dictionary_value(type_: duckdb_logical_type, index: idx_t) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Retrieves the child type of the given LIST type. Also accepts MAP types.\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type, either LIST or MAP.\n @return The child type of the LIST or MAP type."]
    pub fn duckdb_list_type_child_type(type_: duckdb_logical_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the child type of the given ARRAY type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type. Must be ARRAY.\n @return The child type of the ARRAY type."]
    pub fn duckdb_array_type_child_type(type_: duckdb_logical_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the array size of the given array type.\n\n @param type The logical type object\n @return The fixed number of elements the values of this array type can store."]
    pub fn duckdb_array_type_array_size(type_: duckdb_logical_type) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the key type of the given map type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @return The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_map_type_key_type(type_: duckdb_logical_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the value type of the given map type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @return The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_map_type_value_type(type_: duckdb_logical_type) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the number of children of a struct type.\n\n @param type The logical type object\n @return The number of children of a struct type."]
    pub fn duckdb_struct_type_child_count(type_: duckdb_logical_type) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the name of the struct child.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The child index\n @return The name of the struct type. Must be freed with `duckdb_free`."]
    pub fn duckdb_struct_type_child_name(type_: duckdb_logical_type, index: idx_t) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Retrieves the child type of the given struct type at the specified index.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @param index The child index\n @return The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_struct_type_child_type(type_: duckdb_logical_type, index: idx_t) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns the number of members that the union type has.\n\n @param type The logical type (union) object\n @return The number of members of a union type."]
    pub fn duckdb_union_type_member_count(type_: duckdb_logical_type) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the name of the union member.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The child index\n @return The name of the union member. Must be freed with `duckdb_free`."]
    pub fn duckdb_union_type_member_name(type_: duckdb_logical_type, index: idx_t) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Retrieves the child type of the given union member at the specified index.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @param index The child index\n @return The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_union_type_member_type(type_: duckdb_logical_type, index: idx_t) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Destroys the logical type and de-allocates all memory allocated for that type.\n\n @param type The logical type to destroy."]
    pub fn duckdb_destroy_logical_type(type_: *mut duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Registers a custom type within the given connection.\nThe type must have an alias\n\n @param con The connection to use\n @param type The custom type to register\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_logical_type(
        con: duckdb_connection,
        type_: duckdb_logical_type,
        info: duckdb_create_type_info,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates an empty data chunk with the specified column types.\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\n @param types An array of column types. Column types can not contain ANY and INVALID types.\n @param column_count The number of columns.\n @return The data chunk."]
    pub fn duckdb_create_data_chunk(types: *mut duckdb_logical_type, column_count: idx_t) -> duckdb_data_chunk;
}
unsafe extern "C" {
    #[doc = "Destroys the data chunk and de-allocates all memory allocated for that chunk.\n\n @param chunk The data chunk to destroy."]
    pub fn duckdb_destroy_data_chunk(chunk: *mut duckdb_data_chunk);
}
unsafe extern "C" {
    #[doc = "Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.\nAfter calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current\ndata and validity pointers\n\n @param chunk The data chunk to reset."]
    pub fn duckdb_data_chunk_reset(chunk: duckdb_data_chunk);
}
unsafe extern "C" {
    #[doc = "Retrieves the number of columns in a data chunk.\n\n @param chunk The data chunk to get the data from\n @return The number of columns in the data chunk"]
    pub fn duckdb_data_chunk_get_column_count(chunk: duckdb_data_chunk) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the vector at the specified column index in the data chunk.\n\nThe pointer to the vector is valid for as long as the chunk is alive.\nIt does NOT need to be destroyed.\n\n @param chunk The data chunk to get the data from\n @return The vector"]
    pub fn duckdb_data_chunk_get_vector(chunk: duckdb_data_chunk, col_idx: idx_t) -> duckdb_vector;
}
unsafe extern "C" {
    #[doc = "Retrieves the current number of tuples in a data chunk.\n\n @param chunk The data chunk to get the data from\n @return The number of tuples in the data chunk"]
    pub fn duckdb_data_chunk_get_size(chunk: duckdb_data_chunk) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Sets the current number of tuples in a data chunk.\n\n @param chunk The data chunk to set the size in\n @param size The number of tuples in the data chunk"]
    pub fn duckdb_data_chunk_set_size(chunk: duckdb_data_chunk, size: idx_t);
}
unsafe extern "C" {
    #[doc = "Creates a flat vector. Must be destroyed with `duckdb_destroy_vector`.\n\n @param type The logical type of the vector.\n @param capacity The capacity of the vector.\n @return The vector."]
    pub fn duckdb_create_vector(type_: duckdb_logical_type, capacity: idx_t) -> duckdb_vector;
}
unsafe extern "C" {
    #[doc = "Destroys the vector and de-allocates its memory.\n\n @param vector A pointer to the vector."]
    pub fn duckdb_destroy_vector(vector: *mut duckdb_vector);
}
unsafe extern "C" {
    #[doc = "Retrieves the column type of the specified vector.\n\nThe result must be destroyed with `duckdb_destroy_logical_type`.\n\n @param vector The vector get the data from\n @return The type of the vector"]
    pub fn duckdb_vector_get_column_type(vector: duckdb_vector) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves the data pointer of the vector.\n\nThe data pointer can be used to read or write values from the vector.\nHow to read or write values depends on the type of the vector.\n\n @param vector The vector to get the data from\n @return The data pointer"]
    pub fn duckdb_vector_get_data(vector: duckdb_vector) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the validity mask pointer of the specified vector.\n\nIf all values are valid, this function MIGHT return NULL!\n\nThe validity mask is a bitset that signifies null-ness within the data chunk.\nIt is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.\nThe bit is set to 1 if the value is valid (i.e. not NULL) or 0 if the value is invalid (i.e. NULL).\n\nValidity of a specific value can be obtained like this:\n\nidx_t entry_idx = row_idx / 64;\nidx_t idx_in_entry = row_idx % 64;\nbool is_valid = validity_mask[entry_idx] & (1 << idx_in_entry);\n\nAlternatively, the (slower) duckdb_validity_row_is_valid function can be used.\n\n @param vector The vector to get the data from\n @return The pointer to the validity mask, or NULL if no validity mask is present"]
    pub fn duckdb_vector_get_validity(vector: duckdb_vector) -> *mut u64;
}
unsafe extern "C" {
    #[doc = "Ensures the validity mask is writable by allocating it.\n\nAfter this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL.\nThis allows NULL values to be written to the vector, regardless of whether a validity mask was present before.\n\n @param vector The vector to alter"]
    pub fn duckdb_vector_ensure_validity_writable(vector: duckdb_vector);
}
unsafe extern "C" {
    #[doc = "Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as UTF-8;\nif invalid, a NULL value is assigned at that index.\n\nSuperseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The null-terminated string"]
    pub fn duckdb_vector_assign_string_element(
        vector: duckdb_vector,
        index: idx_t,
        str_: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as UTF-8;\nif invalid, a NULL value is assigned at that index. For BLOB vectors, no validation is performed.\n\nSuperseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The string\n @param str_len The length of the string (in bytes)"]
    pub fn duckdb_vector_assign_string_element_len(
        vector: duckdb_vector,
        index: idx_t,
        str_: *const ::std::os::raw::c_char,
        str_len: idx_t,
    );
}
unsafe extern "C" {
    #[doc = "Assigns a string element in the vector at the specified location without UTF-8 validation. The caller is responsible for\nensuring the input is valid UTF-8. Use `duckdb_valid_utf8_check` to validate strings before calling this function if\nneeded. If the input is known to be valid UTF-8, this function can be called directly for better performance, avoiding\nthe overhead of redundant validation.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The string\n @param str_len The length of the string (in bytes)"]
    pub fn duckdb_unsafe_vector_assign_string_element_len(
        vector: duckdb_vector,
        index: idx_t,
        str_: *const ::std::os::raw::c_char,
        str_len: idx_t,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the child vector of a list vector.\n\nThe resulting vector is valid as long as the parent vector is valid.\n\n @param vector The vector\n @return The child vector"]
    pub fn duckdb_list_vector_get_child(vector: duckdb_vector) -> duckdb_vector;
}
unsafe extern "C" {
    #[doc = "Returns the size of the child vector of the list.\n\n @param vector The vector\n @return The size of the child list"]
    pub fn duckdb_list_vector_get_size(vector: duckdb_vector) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Sets the size of the underlying child-vector of a list vector.\nNote that this does NOT reserve the memory in the child buffer,\nand that it is possible to set a size exceeding the capacity.\nTo set the capacity, use `duckdb_list_vector_reserve`.\n\n @param vector The list vector.\n @param size The size of the child list.\n @return The duckdb state. Returns DuckDBError, if the vector is nullptr."]
    pub fn duckdb_list_vector_set_size(vector: duckdb_vector, size: idx_t) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Sets the capacity of the underlying child-vector of a list vector.\nWe increment to the next power of two, based on the required capacity.\nThus, the capacity might not match the size of the list (capacity >= size),\nwhich is set via `duckdb_list_vector_set_size`.\n\n @param vector The list vector.\n @param required_capacity The child buffer capacity to reserve.\n @return The duckdb state. Returns DuckDBError, if the vector is nullptr."]
    pub fn duckdb_list_vector_reserve(vector: duckdb_vector, required_capacity: idx_t) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Retrieves the child vector of a struct vector.\nThe resulting vector is valid as long as the parent vector is valid.\n\n @param vector The vector\n @param index The child index\n @return The child vector"]
    pub fn duckdb_struct_vector_get_child(vector: duckdb_vector, index: idx_t) -> duckdb_vector;
}
unsafe extern "C" {
    #[doc = "Retrieves the child vector of an array vector.\nThe resulting vector is valid as long as the parent vector is valid.\nThe resulting vector has the size of the parent vector multiplied by the array size.\n\n @param vector The vector\n @return The child vector"]
    pub fn duckdb_array_vector_get_child(vector: duckdb_vector) -> duckdb_vector;
}
unsafe extern "C" {
    #[doc = "Slice a vector with a selection vector.\nThe length of the selection vector must be less than or equal to the length of the vector.\nTurns the vector into a dictionary vector.\n\n @param vector The vector to slice.\n @param sel The selection vector.\n @param len The length of the selection vector."]
    pub fn duckdb_slice_vector(vector: duckdb_vector, sel: duckdb_selection_vector, len: idx_t);
}
unsafe extern "C" {
    #[doc = "Copy the src vector to the dst with a selection vector that identifies which indices to copy.\n\n @param src The vector to copy from.\n @param dst The vector to copy to.\n @param sel The selection vector. The length of the selection vector should not be more than the length of the src\nvector\n @param src_count The number of entries from selection vector to copy. Think of this as the effective length of the\nselection vector starting from index 0\n @param src_offset The offset in the selection vector to copy from (important: actual number of items copied =\nsrc_count - src_offset).\n @param dst_offset The offset in the dst vector to start copying to."]
    pub fn duckdb_vector_copy_sel(
        src: duckdb_vector,
        dst: duckdb_vector,
        sel: duckdb_selection_vector,
        src_count: idx_t,
        src_offset: idx_t,
        dst_offset: idx_t,
    );
}
unsafe extern "C" {
    #[doc = "Copies the value from `value` to `vector`.\n\n @param vector The receiving vector.\n @param value The value to copy into the vector."]
    pub fn duckdb_vector_reference_value(vector: duckdb_vector, value: duckdb_value);
}
unsafe extern "C" {
    #[doc = "Changes `to_vector` to reference `from_vector. After, the vectors share ownership of the data.\n\n @param to_vector The receiving vector.\n @param from_vector The vector to reference."]
    pub fn duckdb_vector_reference_vector(to_vector: duckdb_vector, from_vector: duckdb_vector);
}
unsafe extern "C" {
    #[doc = "Returns whether or not a row is valid (i.e. not NULL) in the given validity mask.\n\n @param validity The validity mask, as obtained through `duckdb_vector_get_validity`\n @param row The row index\n @return true if the row is valid, false otherwise"]
    pub fn duckdb_validity_row_is_valid(validity: *mut u64, row: idx_t) -> bool;
}
unsafe extern "C" {
    #[doc = "In a validity mask, sets a specific row to either valid or invalid.\n\nNote that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`,\nto ensure that there is a validity mask to write to.\n\n @param validity The validity mask, as obtained through `duckdb_vector_get_validity`.\n @param row The row index\n @param valid Whether or not to set the row to valid, or invalid"]
    pub fn duckdb_validity_set_row_validity(validity: *mut u64, row: idx_t, valid: bool);
}
unsafe extern "C" {
    #[doc = "In a validity mask, sets a specific row to invalid.\n\nEquivalent to `duckdb_validity_set_row_validity` with valid set to false.\n\n @param validity The validity mask\n @param row The row index"]
    pub fn duckdb_validity_set_row_invalid(validity: *mut u64, row: idx_t);
}
unsafe extern "C" {
    #[doc = "In a validity mask, sets a specific row to valid.\n\nEquivalent to `duckdb_validity_set_row_validity` with valid set to true.\n\n @param validity The validity mask\n @param row The row index"]
    pub fn duckdb_validity_set_row_valid(validity: *mut u64, row: idx_t);
}
unsafe extern "C" {
    #[doc = "Creates a new empty scalar function.\n\nThe return value must be destroyed with `duckdb_destroy_scalar_function`.\n\n @return The scalar function object."]
    pub fn duckdb_create_scalar_function() -> duckdb_scalar_function;
}
unsafe extern "C" {
    #[doc = "Destroys the given scalar function object.\n\n @param scalar_function The scalar function to destroy"]
    pub fn duckdb_destroy_scalar_function(scalar_function: *mut duckdb_scalar_function);
}
unsafe extern "C" {
    #[doc = "Sets the name of the given scalar function.\n\n @param scalar_function The scalar function\n @param name The name of the scalar function"]
    pub fn duckdb_scalar_function_set_name(
        scalar_function: duckdb_scalar_function,
        name: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Sets the parameters of the given scalar function to varargs. Does not require adding parameters with\nduckdb_scalar_function_add_parameter.\n\n @param scalar_function The scalar function.\n @param type The type of the arguments.\n @return The parameter type. Cannot contain INVALID."]
    pub fn duckdb_scalar_function_set_varargs(scalar_function: duckdb_scalar_function, type_: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Sets the scalar function's null-handling behavior to special.\n\n @param scalar_function The scalar function."]
    pub fn duckdb_scalar_function_set_special_handling(scalar_function: duckdb_scalar_function);
}
unsafe extern "C" {
    #[doc = "Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.\nThis limits optimization that can be performed for the function.\n\n @param scalar_function The scalar function."]
    pub fn duckdb_scalar_function_set_volatile(scalar_function: duckdb_scalar_function);
}
unsafe extern "C" {
    #[doc = "Adds a parameter to the scalar function.\n\n @param scalar_function The scalar function.\n @param type The parameter type. Cannot contain INVALID."]
    pub fn duckdb_scalar_function_add_parameter(scalar_function: duckdb_scalar_function, type_: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Sets the return type of the scalar function.\n\n @param scalar_function The scalar function\n @param type Cannot contain INVALID or ANY."]
    pub fn duckdb_scalar_function_set_return_type(scalar_function: duckdb_scalar_function, type_: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Assigns extra information to the scalar function that can be fetched during binding, etc.\n\n @param scalar_function The scalar function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
    pub fn duckdb_scalar_function_set_extra_info(
        scalar_function: duckdb_scalar_function,
        extra_info: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the (optional) bind function of the scalar function.\n\n @param scalar_function The scalar function.\n @param bind The bind function."]
    pub fn duckdb_scalar_function_set_bind(
        scalar_function: duckdb_scalar_function,
        bind: duckdb_scalar_function_bind_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the user-provided bind data in the bind object of the scalar function.\nThe bind data object can be retrieved again during execution.\nIn most case, you also need to set the copy-callback of your bind data via duckdb_scalar_function_set_bind_data_copy.\n\n @param info The bind info of the scalar function.\n @param bind_data The bind data object.\n @param destroy The callback to destroy the bind data (if any)."]
    pub fn duckdb_scalar_function_set_bind_data(
        info: duckdb_bind_info,
        bind_data: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the copy-callback for the user-provided bind data in the bind object of the scalar function.\n\n @param info The bind info of the scalar function.\n @param copy The callback to copy the bind data (if any)."]
    pub fn duckdb_scalar_function_set_bind_data_copy(info: duckdb_bind_info, copy: duckdb_copy_callback_t);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while calling bind on a scalar function.\n\n @param info The bind info object.\n @param error The error message."]
    pub fn duckdb_scalar_function_bind_set_error(info: duckdb_bind_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Sets the main function of the scalar function.\n\n @param scalar_function The scalar function\n @param function The function"]
    pub fn duckdb_scalar_function_set_function(
        scalar_function: duckdb_scalar_function,
        function: duckdb_scalar_function_t,
    );
}
unsafe extern "C" {
    #[doc = "Register the scalar function object within the given connection.\n\nThe function requires at least a name, a function and a return type.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param scalar_function The function pointer\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_scalar_function(
        con: duckdb_connection,
        scalar_function: duckdb_scalar_function,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.\n\n @param info The info object.\n @return The extra info."]
    pub fn duckdb_scalar_function_get_extra_info(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in the bind info.\n\n @param info The info object.\n @return The extra info."]
    pub fn duckdb_scalar_function_bind_get_extra_info(info: duckdb_bind_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`.\nNote that the bind data is read-only.\n\n @param info The function info.\n @return The bind data object."]
    pub fn duckdb_scalar_function_get_bind_data(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the bind info of a scalar function.\n\n @param info The bind info object of the scalar function.\n @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`."]
    pub fn duckdb_scalar_function_get_client_context(info: duckdb_bind_info, out_context: *mut duckdb_client_context);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the scalar function.\n\n @param info The info object.\n @param error The error message"]
    pub fn duckdb_scalar_function_set_error(info: duckdb_function_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Creates a new empty scalar function set.\n\nThe return value must be destroyed with `duckdb_destroy_scalar_function_set`.\n\n @return The scalar function set object."]
    pub fn duckdb_create_scalar_function_set(name: *const ::std::os::raw::c_char) -> duckdb_scalar_function_set;
}
unsafe extern "C" {
    #[doc = "Destroys the given scalar function set object."]
    pub fn duckdb_destroy_scalar_function_set(scalar_function_set: *mut duckdb_scalar_function_set);
}
unsafe extern "C" {
    #[doc = "Adds the scalar function as a new overload to the scalar function set.\n\nReturns DuckDBError if the function could not be added, for example if the overload already exists.\n\n @param set The scalar function set\n @param function The function to add"]
    pub fn duckdb_add_scalar_function_to_set(
        set: duckdb_scalar_function_set,
        function: duckdb_scalar_function,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Register the scalar function set within the given connection.\n\nThe set requires at least a single valid overload.\n\nIf the set is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param set The function set to register\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_scalar_function_set(con: duckdb_connection, set: duckdb_scalar_function_set)
    -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Returns the number of input arguments of the scalar function.\n\n @param info The bind info.\n @return The number of input arguments."]
    pub fn duckdb_scalar_function_bind_get_argument_count(info: duckdb_bind_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the input argument at index of the scalar function.\n\n @param info The bind info.\n @param index The argument index.\n @return The input argument at index. Must be destroyed with `duckdb_destroy_expression`."]
    pub fn duckdb_scalar_function_bind_get_argument(info: duckdb_bind_info, index: idx_t) -> duckdb_expression;
}
unsafe extern "C" {
    #[doc = "Retrieves the state pointer of the function info.\n\n @param info The function info object.\n @return The state pointer."]
    pub fn duckdb_scalar_function_get_state(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Sets the (optional) state init function of the scalar function.\nThis is called once for each worker thread that begins executing the function\n @param scalar_function The scalar function.\n @param init The init function."]
    pub fn duckdb_scalar_function_set_init(
        scalar_function: duckdb_scalar_function,
        init: duckdb_scalar_function_init_t,
    );
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while calling init on a scalar function.\n\n @param info The init info object.\n @param error The error message."]
    pub fn duckdb_scalar_function_init_set_error(info: duckdb_init_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Sets the state pointer in the init info of the scalar function.\n\n @param info The init info object.\n @param state The state pointer.\n @param destroy The callback to destroy the state (if any)."]
    pub fn duckdb_scalar_function_init_set_state(
        info: duckdb_init_info,
        state: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the init info of a scalar function.\n\n @param info The init info object of the scalar function.\n @param out_context The client context of the init info. Must be destroyed with `duckdb_destroy_client_context`."]
    pub fn duckdb_scalar_function_init_get_client_context(
        info: duckdb_init_info,
        out_context: *mut duckdb_client_context,
    );
}
unsafe extern "C" {
    #[doc = "Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`.\nNote that the bind data is read-only.\n\n @param info The init info object.\n @return The bind data object."]
    pub fn duckdb_scalar_function_init_get_bind_data(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in the init info.\n\n @param info The init info object.\n @return The extra info."]
    pub fn duckdb_scalar_function_init_get_extra_info(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Creates a new selection vector of size `size`.\nMust be destroyed with `duckdb_destroy_selection_vector`.\n\n @param size The size of the selection vector.\n @return The selection vector."]
    pub fn duckdb_create_selection_vector(size: idx_t) -> duckdb_selection_vector;
}
unsafe extern "C" {
    #[doc = "Destroys the selection vector and de-allocates its memory.\n\n @param sel The selection vector."]
    pub fn duckdb_destroy_selection_vector(sel: duckdb_selection_vector);
}
unsafe extern "C" {
    #[doc = "Access the data pointer of a selection vector.\n\n @param sel The selection vector.\n @return The data pointer."]
    pub fn duckdb_selection_vector_get_data_ptr(sel: duckdb_selection_vector) -> *mut sel_t;
}
unsafe extern "C" {
    #[doc = "Creates a new empty aggregate function.\n\nThe return value should be destroyed with `duckdb_destroy_aggregate_function`.\n\n @return The aggregate function object."]
    pub fn duckdb_create_aggregate_function() -> duckdb_aggregate_function;
}
unsafe extern "C" {
    #[doc = "Destroys the given aggregate function object."]
    pub fn duckdb_destroy_aggregate_function(aggregate_function: *mut duckdb_aggregate_function);
}
unsafe extern "C" {
    #[doc = "Sets the name of the given aggregate function.\n\n @param aggregate_function The aggregate function\n @param name The name of the aggregate function"]
    pub fn duckdb_aggregate_function_set_name(
        aggregate_function: duckdb_aggregate_function,
        name: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Adds a parameter to the aggregate function.\n\n @param aggregate_function The aggregate function.\n @param type The parameter type. Cannot contain INVALID."]
    pub fn duckdb_aggregate_function_add_parameter(
        aggregate_function: duckdb_aggregate_function,
        type_: duckdb_logical_type,
    );
}
unsafe extern "C" {
    #[doc = "Sets the return type of the aggregate function.\n\n @param aggregate_function The aggregate function.\n @param type The return type. Cannot contain INVALID or ANY."]
    pub fn duckdb_aggregate_function_set_return_type(
        aggregate_function: duckdb_aggregate_function,
        type_: duckdb_logical_type,
    );
}
unsafe extern "C" {
    #[doc = "Sets the main functions of the aggregate function.\n\n @param aggregate_function The aggregate function\n @param state_size state size\n @param state_init state init function\n @param update update states\n @param combine combine states\n @param finalize finalize states"]
    pub fn duckdb_aggregate_function_set_functions(
        aggregate_function: duckdb_aggregate_function,
        state_size: duckdb_aggregate_state_size,
        state_init: duckdb_aggregate_init_t,
        update: duckdb_aggregate_update_t,
        combine: duckdb_aggregate_combine_t,
        finalize: duckdb_aggregate_finalize_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the state destructor callback of the aggregate function (optional)\n\n @param aggregate_function The aggregate function\n @param destroy state destroy callback"]
    pub fn duckdb_aggregate_function_set_destructor(
        aggregate_function: duckdb_aggregate_function,
        destroy: duckdb_aggregate_destroy_t,
    );
}
unsafe extern "C" {
    #[doc = "Register the aggregate function object within the given connection.\n\nThe function requires at least a name, functions and a return type.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_aggregate_function(
        con: duckdb_connection,
        aggregate_function: duckdb_aggregate_function,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.\n\n @param aggregate_function The aggregate function"]
    pub fn duckdb_aggregate_function_set_special_handling(aggregate_function: duckdb_aggregate_function);
}
unsafe extern "C" {
    #[doc = "Assigns extra information to the scalar function that can be fetched during binding, etc.\n\n @param aggregate_function The aggregate function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
    pub fn duckdb_aggregate_function_set_extra_info(
        aggregate_function: duckdb_aggregate_function,
        extra_info: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
    pub fn duckdb_aggregate_function_get_extra_info(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the aggregate function.\n\n @param info The info object\n @param error The error message"]
    pub fn duckdb_aggregate_function_set_error(info: duckdb_function_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Creates a new empty aggregate function set.\n\nThe return value should be destroyed with `duckdb_destroy_aggregate_function_set`.\n\n @return The aggregate function set object."]
    pub fn duckdb_create_aggregate_function_set(name: *const ::std::os::raw::c_char) -> duckdb_aggregate_function_set;
}
unsafe extern "C" {
    #[doc = "Destroys the given aggregate function set object."]
    pub fn duckdb_destroy_aggregate_function_set(aggregate_function_set: *mut duckdb_aggregate_function_set);
}
unsafe extern "C" {
    #[doc = "Adds the aggregate function as a new overload to the aggregate function set.\n\nReturns DuckDBError if the function could not be added, for example if the overload already exists.\n\n @param set The aggregate function set\n @param function The function to add"]
    pub fn duckdb_add_aggregate_function_to_set(
        set: duckdb_aggregate_function_set,
        function: duckdb_aggregate_function,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Register the aggregate function set within the given connection.\n\nThe set requires at least a single valid overload.\n\nIf the set is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param set The function set to register\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_aggregate_function_set(
        con: duckdb_connection,
        set: duckdb_aggregate_function_set,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates a new empty table function.\n\nThe return value should be destroyed with `duckdb_destroy_table_function`.\n\n @return The table function object."]
    pub fn duckdb_create_table_function() -> duckdb_table_function;
}
unsafe extern "C" {
    #[doc = "Destroys the given table function object.\n\n @param table_function The table function to destroy"]
    pub fn duckdb_destroy_table_function(table_function: *mut duckdb_table_function);
}
unsafe extern "C" {
    #[doc = "Sets the name of the given table function.\n\n @param table_function The table function\n @param name The name of the table function"]
    pub fn duckdb_table_function_set_name(table_function: duckdb_table_function, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Adds a parameter to the table function.\n\n @param table_function The table function.\n @param type The parameter type. Cannot contain INVALID."]
    pub fn duckdb_table_function_add_parameter(table_function: duckdb_table_function, type_: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Adds a named parameter to the table function.\n\n @param table_function The table function.\n @param name The parameter name.\n @param type The parameter type. Cannot contain INVALID."]
    pub fn duckdb_table_function_add_named_parameter(
        table_function: duckdb_table_function,
        name: *const ::std::os::raw::c_char,
        type_: duckdb_logical_type,
    );
}
unsafe extern "C" {
    #[doc = "Assigns extra information to the table function that can be fetched during binding, etc.\n\n @param table_function The table function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
    pub fn duckdb_table_function_set_extra_info(
        table_function: duckdb_table_function,
        extra_info: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the bind function of the table function.\n\n @param table_function The table function\n @param bind The bind function"]
    pub fn duckdb_table_function_set_bind(table_function: duckdb_table_function, bind: duckdb_table_function_bind_t);
}
unsafe extern "C" {
    #[doc = "Sets the init function of the table function.\n\n @param table_function The table function\n @param init The init function"]
    pub fn duckdb_table_function_set_init(table_function: duckdb_table_function, init: duckdb_table_function_init_t);
}
unsafe extern "C" {
    #[doc = "Sets the thread-local init function of the table function.\n\n @param table_function The table function\n @param init The init function"]
    pub fn duckdb_table_function_set_local_init(
        table_function: duckdb_table_function,
        init: duckdb_table_function_init_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the main function of the table function.\n\n @param table_function The table function\n @param function The function"]
    pub fn duckdb_table_function_set_function(table_function: duckdb_table_function, function: duckdb_table_function_t);
}
unsafe extern "C" {
    #[doc = "Sets whether or not the given table function supports projection pushdown.\n\nIf this is set to true, the system will provide a list of all required columns in the `init` stage through\nthe `duckdb_init_get_column_count` and `duckdb_init_get_column_index` functions.\nIf this is set to false (the default), the system will expect all columns to be projected.\n\n @param table_function The table function\n @param pushdown True if the table function supports projection pushdown, false otherwise."]
    pub fn duckdb_table_function_supports_projection_pushdown(table_function: duckdb_table_function, pushdown: bool);
}
unsafe extern "C" {
    #[doc = "Register the table function object within the given connection.\n\nThe function requires at least a name, a bind function, an init function and a main function.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param function The function pointer\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_table_function(con: duckdb_connection, function: duckdb_table_function) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
    pub fn duckdb_bind_get_extra_info(info: duckdb_bind_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the bind info of a table function.\n\n @param info The bind info object of the table function.\n @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`."]
    pub fn duckdb_table_function_get_client_context(info: duckdb_bind_info, out_context: *mut duckdb_client_context);
}
unsafe extern "C" {
    #[doc = "Adds a result column to the output of the table function.\n\n @param info The table function's bind info.\n @param name The column name.\n @param type The logical column type."]
    pub fn duckdb_bind_add_result_column(
        info: duckdb_bind_info,
        name: *const ::std::os::raw::c_char,
        type_: duckdb_logical_type,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the number of regular (non-named) parameters to the function.\n\n @param info The info object\n @return The number of parameters"]
    pub fn duckdb_bind_get_parameter_count(info: duckdb_bind_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the parameter at the given index.\n\nThe result must be destroyed with `duckdb_destroy_value`.\n\n @param info The info object\n @param index The index of the parameter to get\n @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_bind_get_parameter(info: duckdb_bind_info, index: idx_t) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Retrieves a named parameter with the given name.\n\nThe result must be destroyed with `duckdb_destroy_value`.\n\n @param info The info object\n @param name The name of the parameter\n @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_bind_get_named_parameter(info: duckdb_bind_info, name: *const ::std::os::raw::c_char)
    -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Sets the user-provided bind data in the bind object of the table function.\nThis object can be retrieved again during execution.\n\n @param info The bind info of the table function.\n @param bind_data The bind data object.\n @param destroy The callback to destroy the bind data (if any)."]
    pub fn duckdb_bind_set_bind_data(
        info: duckdb_bind_info,
        bind_data: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the cardinality estimate for the table function, used for optimization.\n\n @param info The bind data object.\n @param is_exact Whether or not the cardinality estimate is exact, or an approximation"]
    pub fn duckdb_bind_set_cardinality(info: duckdb_bind_info, cardinality: idx_t, is_exact: bool);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while calling bind on a table function.\n\n @param info The info object\n @param error The error message"]
    pub fn duckdb_bind_set_error(info: duckdb_bind_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
    pub fn duckdb_init_get_extra_info(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.\n\nNote that the bind data should be considered as read-only.\nFor tracking state, use the init data instead.\n\n @param info The info object\n @return The bind data object"]
    pub fn duckdb_init_get_bind_data(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Sets the user-provided init data in the init object. This object can be retrieved again during execution.\n\n @param info The info object\n @param init_data The init data object.\n @param destroy The callback that will be called to destroy the init data (if any)"]
    pub fn duckdb_init_set_init_data(
        info: duckdb_init_info,
        init_data: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Returns the number of projected columns.\n\nThis function must be used if projection pushdown is enabled to figure out which columns to emit.\n\n @param info The info object\n @return The number of projected columns."]
    pub fn duckdb_init_get_column_count(info: duckdb_init_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the column index of the projected column at the specified position.\n\nThis function must be used if projection pushdown is enabled to figure out which columns to emit.\n\n @param info The info object\n @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)\n @return The column index of the projected column."]
    pub fn duckdb_init_get_column_index(info: duckdb_init_info, column_index: idx_t) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Sets how many threads can process this table function in parallel (default: 1)\n\n @param info The info object\n @param max_threads The maximum amount of threads that can process this table function"]
    pub fn duckdb_init_set_max_threads(info: duckdb_init_info, max_threads: idx_t);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while calling init.\n\n @param info The info object\n @param error The error message"]
    pub fn duckdb_init_set_error(info: duckdb_init_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
    pub fn duckdb_function_get_extra_info(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Gets the table function's bind data set by `duckdb_bind_set_bind_data`.\n\nNote that the bind data is read-only.\nFor tracking state, use the init data instead.\n\n @param info The function info object.\n @return The bind data object."]
    pub fn duckdb_function_get_bind_data(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Gets the init data set by `duckdb_init_set_init_data` during the init.\n\n @param info The info object\n @return The init data object"]
    pub fn duckdb_function_get_init_data(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.\n\n @param info The info object\n @return The init data object"]
    pub fn duckdb_function_get_local_init_data(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the function.\n\n @param info The info object\n @param error The error message"]
    pub fn duckdb_function_set_error(info: duckdb_function_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Add a replacement scan definition to the specified database.\n\n @param db The database object to add the replacement scan to\n @param replacement The replacement scan callback\n @param extra_data Extra data that is passed back into the specified callback\n @param delete_callback The delete callback to call on the extra data, if any"]
    pub fn duckdb_add_replacement_scan(
        db: duckdb_database,
        replacement: duckdb_replacement_callback_t,
        extra_data: *mut ::std::os::raw::c_void,
        delete_callback: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the replacement function name. If this function is called in the replacement callback,\nthe replacement scan is performed. If it is not called, the replacement callback is not performed.\n\n @param info The info object\n @param function_name The function name to substitute."]
    pub fn duckdb_replacement_scan_set_function_name(
        info: duckdb_replacement_scan_info,
        function_name: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Adds a parameter to the replacement scan function.\n\n @param info The info object\n @param parameter The parameter to add."]
    pub fn duckdb_replacement_scan_add_parameter(info: duckdb_replacement_scan_info, parameter: duckdb_value);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the replacement scan.\n\n @param info The info object\n @param error The error message"]
    pub fn duckdb_replacement_scan_set_error(info: duckdb_replacement_scan_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Returns the root node of the profiling information. Returns nullptr, if profiling is not enabled.\n\n @param connection A connection object.\n @return A profiling information object."]
    pub fn duckdb_get_profiling_info(connection: duckdb_connection) -> duckdb_profiling_info;
}
unsafe extern "C" {
    #[doc = "Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does\nnot exist or is not enabled. Currently, the value holds a string, and you can retrieve the string\nby calling the corresponding function: char *duckdb_get_varchar(duckdb_value value).\n\n @param info A profiling information object.\n @param key The name of the requested metric.\n @return The value of the metric. Must be freed with `duckdb_destroy_value`"]
    pub fn duckdb_profiling_info_get_value(
        info: duckdb_profiling_info,
        key: *const ::std::os::raw::c_char,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the key-value metric map of this profiling node as a MAP duckdb_value.\nThe individual elements are accessible via the duckdb_value MAP functions.\n\n @param info A profiling information object.\n @return The key-value metric map as a MAP duckdb_value."]
    pub fn duckdb_profiling_info_get_metrics(info: duckdb_profiling_info) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Returns the number of children in the current profiling info node.\n\n @param info A profiling information object.\n @return The number of children in the current node."]
    pub fn duckdb_profiling_info_get_child_count(info: duckdb_profiling_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the child node at the specified index.\n\n @param info A profiling information object.\n @param index The index of the child node.\n @return The child node at the specified index."]
    pub fn duckdb_profiling_info_get_child(info: duckdb_profiling_info, index: idx_t) -> duckdb_profiling_info;
}
unsafe extern "C" {
    #[doc = "Creates an appender object.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param schema The schema of the table to append to, or `nullptr` for the default schema.\n @param table The table name to append to.\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_create(
        connection: duckdb_connection,
        schema: *const ::std::os::raw::c_char,
        table: *const ::std::os::raw::c_char,
        out_appender: *mut duckdb_appender,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates an appender object.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param catalog The catalog of the table to append to, or `nullptr` for the default catalog.\n @param schema The schema of the table to append to, or `nullptr` for the default schema.\n @param table The table name to append to.\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_create_ext(
        connection: duckdb_connection,
        catalog: *const ::std::os::raw::c_char,
        schema: *const ::std::os::raw::c_char,
        table: *const ::std::os::raw::c_char,
        out_appender: *mut duckdb_appender,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates an appender object that executes the given query with any data appended to it.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param query The query to execute, can be an INSERT, DELETE, UPDATE or MERGE INTO statement.\n @param column_count The number of columns to append.\n @param types The types of the columns to append.\n @param table_name (optionally) the table name used to refer to the appended data, defaults to \"appended_data\".\n @param column_names (optionally) the list of column names, defaults to \"col1\", \"col2\", ...\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_create_query(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        column_count: idx_t,
        types: *mut duckdb_logical_type,
        table_name: *const ::std::os::raw::c_char,
        column_names: *mut *const ::std::os::raw::c_char,
        out_appender: *mut duckdb_appender,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Returns the number of columns that belong to the appender.\nIf there is no active column list, then this equals the table's physical columns.\n\n @param appender The appender to get the column count from.\n @return The number of columns in the data chunks."]
    pub fn duckdb_appender_column_count(appender: duckdb_appender) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Returns the type of the column at the specified index. This is either a type in the active column list, or the same type\nas a column in the receiving table.\n\nNote: The resulting type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param appender The appender to get the column type from.\n @param col_idx The index of the column to get the type of.\n @return The `duckdb_logical_type` of the column."]
    pub fn duckdb_appender_column_type(appender: duckdb_appender, col_idx: idx_t) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\nUse duckdb_appender_error_data instead.\n\nReturns the error message associated with the appender.\nIf the appender has no error message, this returns `nullptr` instead.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.\n\n @param appender The appender to get the error from.\n @return The error message, or `nullptr` if there is none."]
    pub fn duckdb_appender_error(appender: duckdb_appender) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Returns the error data associated with the appender.\nMust be destroyed with duckdb_destroy_error_data.\n\n @param appender The appender to get the error data from.\n @return The error data."]
    pub fn duckdb_appender_error_data(appender: duckdb_appender) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Flush the appender to the table, forcing the cache of the appender to be cleared. If flushing the data triggers a\nconstraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.\nIt is not possible to append more values. Call duckdb_appender_error_data to obtain the error data followed by\nduckdb_appender_destroy to destroy the invalidated appender.\n\n @param appender The appender to flush.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_flush(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Clears all buffered data from the appender without flushing it to the table. This discards any data that has been\nappended but not yet written. The appender can continue to be used after clearing.\n\n @param appender The appender to clear.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_clear(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data\ntriggers a constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.\nCall duckdb_appender_error_data to obtain the error data followed by duckdb_appender_destroy to destroy the invalidated\nappender.\n\n @param appender The appender to flush and close.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_close(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this function\nde-allocates all memory associated with the appender. If flushing the data triggers a constraint violation,\nthen all data is invalidated, and this function returns DuckDBError. Due to the destruction of the appender, it is no\nlonger possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close\nbefore destroying the appender, if you need insights into the specific error.\n\n @param appender The appender to flush, close and destroy.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_destroy(appender: *mut duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Appends a column to the active column list of the appender. Immediately flushes all previous data.\n\nThe active column list specifies all columns that are expected when flushing the data. Any non-active columns are filled\nwith their default values, or NULL.\n\n @param appender The appender to add the column to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_add_column(appender: duckdb_appender, name: *const ::std::os::raw::c_char) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Removes all columns from the active column list of the appender, resetting the appender to treat all columns as active.\nImmediately flushes all previous data.\n\n @param appender The appender to clear the columns from.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_clear_columns(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "A nop function, provided for backwards compatibility reasons. Does nothing. Only `duckdb_appender_end_row` is required."]
    pub fn duckdb_appender_begin_row(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Finish the current row of appends. After end_row is called, the next row can be appended.\n\n @param appender The appender.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_appender_end_row(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender."]
    pub fn duckdb_append_default(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a DEFAULT value, at the specified row and column, (NULL if DEFAULT not available for column) to the chunk created\nfrom the specified appender. The default value of the column must be a constant value. Non-deterministic expressions\nlike nextval('seq') or random() are not supported.\n\n @param appender The appender to get the default value from.\n @param chunk The data chunk to append the default value to.\n @param col The chunk column index to append the default value to.\n @param row The chunk row index to append the default value to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_append_default_to_chunk(
        appender: duckdb_appender,
        chunk: duckdb_data_chunk,
        col: idx_t,
        row: idx_t,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a bool value to the appender."]
    pub fn duckdb_append_bool(appender: duckdb_appender, value: bool) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append an int8_t value to the appender."]
    pub fn duckdb_append_int8(appender: duckdb_appender, value: i8) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append an int16_t value to the appender."]
    pub fn duckdb_append_int16(appender: duckdb_appender, value: i16) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append an int32_t value to the appender."]
    pub fn duckdb_append_int32(appender: duckdb_appender, value: i32) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append an int64_t value to the appender."]
    pub fn duckdb_append_int64(appender: duckdb_appender, value: i64) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_hugeint value to the appender."]
    pub fn duckdb_append_hugeint(appender: duckdb_appender, value: duckdb_hugeint) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a uint8_t value to the appender."]
    pub fn duckdb_append_uint8(appender: duckdb_appender, value: u8) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a uint16_t value to the appender."]
    pub fn duckdb_append_uint16(appender: duckdb_appender, value: u16) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a uint32_t value to the appender."]
    pub fn duckdb_append_uint32(appender: duckdb_appender, value: u32) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a uint64_t value to the appender."]
    pub fn duckdb_append_uint64(appender: duckdb_appender, value: u64) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_uhugeint value to the appender."]
    pub fn duckdb_append_uhugeint(appender: duckdb_appender, value: duckdb_uhugeint) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a float value to the appender."]
    pub fn duckdb_append_float(appender: duckdb_appender, value: f32) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a double value to the appender."]
    pub fn duckdb_append_double(appender: duckdb_appender, value: f64) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_date value to the appender."]
    pub fn duckdb_append_date(appender: duckdb_appender, value: duckdb_date) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_time value to the appender."]
    pub fn duckdb_append_time(appender: duckdb_appender, value: duckdb_time) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_timestamp value to the appender."]
    pub fn duckdb_append_timestamp(appender: duckdb_appender, value: duckdb_timestamp) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_interval value to the appender."]
    pub fn duckdb_append_interval(appender: duckdb_appender, value: duckdb_interval) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a varchar value to the appender."]
    pub fn duckdb_append_varchar(appender: duckdb_appender, val: *const ::std::os::raw::c_char) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a varchar value to the appender."]
    pub fn duckdb_append_varchar_length(
        appender: duckdb_appender,
        val: *const ::std::os::raw::c_char,
        length: idx_t,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a blob value to the appender."]
    pub fn duckdb_append_blob(
        appender: duckdb_appender,
        data: *const ::std::os::raw::c_void,
        length: idx_t,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a NULL value to the appender (of any type)."]
    pub fn duckdb_append_null(appender: duckdb_appender) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Append a duckdb_value to the appender."]
    pub fn duckdb_append_value(appender: duckdb_appender, value: duckdb_value) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Appends a pre-filled data chunk to the specified appender.\nAttempts casting, if the data chunk types do not match the active appender types.\n\n @param appender The appender to append to.\n @param chunk The data chunk to append.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_append_data_chunk(appender: duckdb_appender, chunk: duckdb_data_chunk) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates a table description object. Note that `duckdb_table_description_destroy` should always be called on the\nresulting table_description, even if the function returns `DuckDBError`.\n\n @param connection The connection context.\n @param schema The schema of the table, or `nullptr` for the default schema.\n @param table The table name.\n @param out The resulting table description object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_table_description_create(
        connection: duckdb_connection,
        schema: *const ::std::os::raw::c_char,
        table: *const ::std::os::raw::c_char,
        out: *mut duckdb_table_description,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates a table description object. Note that `duckdb_table_description_destroy` must be called on the resulting\ntable_description, even if the function returns `DuckDBError`.\n\n @param connection The connection context.\n @param catalog The catalog (database) name of the table, or `nullptr` for the default catalog.\n @param schema The schema of the table, or `nullptr` for the default schema.\n @param table The table name.\n @param out The resulting table description object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_table_description_create_ext(
        connection: duckdb_connection,
        catalog: *const ::std::os::raw::c_char,
        schema: *const ::std::os::raw::c_char,
        table: *const ::std::os::raw::c_char,
        out: *mut duckdb_table_description,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroy the TableDescription object.\n\n @param table_description The table_description to destroy."]
    pub fn duckdb_table_description_destroy(table_description: *mut duckdb_table_description);
}
unsafe extern "C" {
    #[doc = "Returns the error message associated with the given table_description.\nIf the table_description has no error message, this returns `nullptr` instead.\nThe error message should not be freed. It will be de-allocated when `duckdb_table_description_destroy` is called.\n\n @param table_description The table_description to get the error from.\n @return The error message, or `nullptr` if there is none."]
    pub fn duckdb_table_description_error(table_description: duckdb_table_description)
    -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Check if the column at 'index' index of the table has a DEFAULT expression.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @param out The out-parameter used to store the result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_column_has_default(
        table_description: duckdb_table_description,
        index: idx_t,
        out: *mut bool,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Return the number of columns of the described table.\n\n @param table_description The table_description to query.\n @return The column count."]
    pub fn duckdb_table_description_get_column_count(table_description: duckdb_table_description) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Obtain the column name at 'index'.\nThe out result must be destroyed with `duckdb_free`.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @return The column name."]
    pub fn duckdb_table_description_get_column_name(
        table_description: duckdb_table_description,
        index: idx_t,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Obtain the column type at 'index'.\nThe return value must be destroyed with `duckdb_destroy_logical_type`.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @return The column type."]
    pub fn duckdb_table_description_get_column_type(
        table_description: duckdb_table_description,
        index: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Transforms a DuckDB Schema into an Arrow Schema\n\n @param arrow_options The Arrow settings used to produce arrow.\n @param types The DuckDB logical types for each column in the schema.\n @param names The names for each column in the schema.\n @param column_count The number of columns that exist in the schema.\n @param out_schema The resulting arrow schema. Must be destroyed with `out_schema->release(out_schema)`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_to_arrow_schema(
        arrow_options: duckdb_arrow_options,
        types: *mut duckdb_logical_type,
        names: *mut *const ::std::os::raw::c_char,
        column_count: idx_t,
        out_schema: *mut ArrowSchema,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Transforms a DuckDB data chunk into an Arrow array.\n\n @param arrow_options The Arrow settings used to produce arrow.\n @param chunk The DuckDB data chunk to convert.\n @param out_arrow_array The output Arrow structure that will hold the converted data. Must be released with\n`out_arrow_array->release(out_arrow_array)`\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_data_chunk_to_arrow(
        arrow_options: duckdb_arrow_options,
        chunk: duckdb_data_chunk,
        out_arrow_array: *mut ArrowArray,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Transforms an Arrow Schema into a DuckDB Schema.\n\n @param connection The connection to get the transformation settings from.\n @param schema The input Arrow schema. Must be released with `schema->release(schema)`.\n @param out_types The Arrow converted schema with extra information about the arrow types. Must be destroyed with\n`duckdb_destroy_arrow_converted_schema`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_schema_from_arrow(
        connection: duckdb_connection,
        schema: *mut ArrowSchema,
        out_types: *mut duckdb_arrow_converted_schema,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Transforms an Arrow array into a DuckDB data chunk. The data chunk will retain ownership of the underlying Arrow data.\n\n @param connection The connection to get the transformation settings from.\n @param arrow_array The input Arrow array. Data ownership is passed on to DuckDB's DataChunk, the underlying object\ndoes not need to be released and won't have ownership of the data.\n @param converted_schema The Arrow converted schema with extra information about the arrow types.\n @param out_chunk The resulting DuckDB data chunk. Must be destroyed by duckdb_destroy_data_chunk.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_data_chunk_from_arrow(
        connection: duckdb_connection,
        arrow_array: *mut ArrowArray,
        converted_schema: duckdb_arrow_converted_schema,
        out_chunk: *mut duckdb_data_chunk,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Destroys the arrow converted schema and de-allocates all memory allocated for that arrow converted schema.\n\n @param arrow_converted_schema The arrow converted schema to destroy."]
    pub fn duckdb_destroy_arrow_converted_schema(arrow_converted_schema: *mut duckdb_arrow_converted_schema);
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes a SQL query within a connection and stores the full (materialized) result in an arrow structure.\nIf the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling\n`duckdb_query_arrow_error`.\n\nNote that after running `duckdb_query_arrow`, `duckdb_destroy_arrow` must be called on the result object even if the\nquery fails, otherwise the error stored within the result will not be freed correctly.\n\n @param connection The connection to perform the query in.\n @param query The SQL query to run.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_query_arrow(
        connection: duckdb_connection,
        query: *const ::std::os::raw::c_char,
        out_result: *mut duckdb_arrow,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch the internal arrow schema from the arrow result. Remember to call release on the respective\nArrowSchema object.\n\n @param result The result to fetch the schema from.\n @param out_schema The output schema.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_query_arrow_schema(result: duckdb_arrow, out_schema: *mut duckdb_arrow_schema) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch the internal arrow schema from the prepared statement. Remember to call release on the respective\nArrowSchema object.\n\n @param prepared The prepared statement to fetch the schema from.\n @param out_schema The output schema.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_prepared_arrow_schema(
        prepared: duckdb_prepared_statement,
        out_schema: *mut duckdb_arrow_schema,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nConvert a data chunk into an arrow struct array. Remember to call release on the respective\nArrowArray object.\n\n @param result The result object the data chunk have been fetched from.\n @param chunk The data chunk to convert.\n @param out_array The output array."]
    pub fn duckdb_result_arrow_array(
        result: duckdb_result,
        chunk: duckdb_data_chunk,
        out_array: *mut duckdb_arrow_array,
    );
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch an internal arrow struct array from the arrow result. Remember to call release on the respective\nArrowArray object.\n\nThis function can be called multiple time to get next chunks, which will free the previous out_array.\nSo consume the out_array before calling this function again.\n\n @param result The result to fetch the array from.\n @param out_array The output array.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_query_arrow_array(result: duckdb_arrow, out_array: *mut duckdb_arrow_array) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of columns present in the arrow result object.\n\n @param result The result object.\n @return The number of columns present in the result object."]
    pub fn duckdb_arrow_column_count(result: duckdb_arrow) -> idx_t;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows present in the arrow result object.\n\n @param result The result object.\n @return The number of rows present in the result object."]
    pub fn duckdb_arrow_row_count(result: duckdb_arrow) -> idx_t;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows changed by the query stored in the arrow result. This is relevant only for\nINSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.\n\n @param result The result object.\n @return The number of rows changed."]
    pub fn duckdb_arrow_rows_changed(result: duckdb_arrow) -> idx_t;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the error message contained within the result. The error is only set if `duckdb_query_arrow` returns\n`DuckDBError`.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.\n\n @param result The result object to fetch the error from.\n @return The error of the result."]
    pub fn duckdb_query_arrow_error(result: duckdb_arrow) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nCloses the result and de-allocates all memory allocated for the arrow result.\n\n @param result The result to destroy."]
    pub fn duckdb_destroy_arrow(result: *mut duckdb_arrow);
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReleases the arrow array stream and de-allocates its memory.\n\n @param stream_p The arrow array stream to destroy."]
    pub fn duckdb_destroy_arrow_stream(stream_p: *mut duckdb_arrow_stream);
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns an arrow query result.\nNote that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_execute_prepared_arrow(
        prepared_statement: duckdb_prepared_statement,
        out_result: *mut duckdb_arrow,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nScans the Arrow stream and creates a view with the given name.\n\n @param connection The connection on which to execute the scan.\n @param table_name Name of the temporary view to create.\n @param arrow Arrow stream wrapper.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_arrow_scan(
        connection: duckdb_connection,
        table_name: *const ::std::os::raw::c_char,
        arrow: duckdb_arrow_stream,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nScans the Arrow array and creates a view with the given name.\nNote that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream` must be called on the out stream.\n\n @param connection The connection on which to execute the scan.\n @param table_name Name of the temporary view to create.\n @param arrow_schema Arrow schema wrapper.\n @param arrow_array Arrow array wrapper.\n @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
    pub fn duckdb_arrow_array_scan(
        connection: duckdb_connection,
        table_name: *const ::std::os::raw::c_char,
        arrow_schema: duckdb_arrow_schema,
        arrow_array: duckdb_arrow_array,
        out_stream: *mut duckdb_arrow_stream,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Execute DuckDB tasks on this thread.\n\nWill return after `max_tasks` have been executed, or if there are no more tasks present.\n\n @param database The database object to execute tasks for\n @param max_tasks The maximum amount of tasks to execute"]
    pub fn duckdb_execute_tasks(database: duckdb_database, max_tasks: idx_t);
}
unsafe extern "C" {
    #[doc = "Creates a task state that can be used with duckdb_execute_tasks_state to execute tasks until\n`duckdb_finish_execution` is called on the state.\n\n`duckdb_destroy_state` must be called on the result.\n\n @param database The database object to create the task state for\n @return The task state that can be used with duckdb_execute_tasks_state."]
    pub fn duckdb_create_task_state(database: duckdb_database) -> duckdb_task_state;
}
unsafe extern "C" {
    #[doc = "Execute DuckDB tasks on this thread.\n\nThe thread will keep on executing tasks forever, until duckdb_finish_execution is called on the state.\nMultiple threads can share the same duckdb_task_state.\n\n @param state The task state of the executor"]
    pub fn duckdb_execute_tasks_state(state: duckdb_task_state);
}
unsafe extern "C" {
    #[doc = "Execute DuckDB tasks on this thread.\n\nThe thread will keep on executing tasks until either duckdb_finish_execution is called on the state,\nmax_tasks tasks have been executed or there are no more tasks to be executed.\n\nMultiple threads can share the same duckdb_task_state.\n\n @param state The task state of the executor\n @param max_tasks The maximum amount of tasks to execute\n @return The amount of tasks that have actually been executed"]
    pub fn duckdb_execute_n_tasks_state(state: duckdb_task_state, max_tasks: idx_t) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Finish execution on a specific task.\n\n @param state The task state to finish execution"]
    pub fn duckdb_finish_execution(state: duckdb_task_state);
}
unsafe extern "C" {
    #[doc = "Check if the provided duckdb_task_state has finished execution\n\n @param state The task state to inspect\n @return Whether or not duckdb_finish_execution has been called on the task state"]
    pub fn duckdb_task_state_is_finished(state: duckdb_task_state) -> bool;
}
unsafe extern "C" {
    #[doc = "Destroys the task state returned from duckdb_create_task_state.\n\nNote that this should not be called while there is an active duckdb_execute_tasks_state running\non the task state.\n\n @param state The task state to clean up"]
    pub fn duckdb_destroy_task_state(state: duckdb_task_state);
}
unsafe extern "C" {
    #[doc = "Returns true if the execution of the current query is finished.\n\n @param con The connection on which to check"]
    pub fn duckdb_execution_is_finished(con: duckdb_connection) -> bool;
}
unsafe extern "C" {
    #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetches a data chunk from the (streaming) duckdb_result. This function should be called repeatedly until the result is\nexhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nThis function can only be used on duckdb_results created with 'duckdb_pending_prepared_streaming'\n\nIf this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be\nmixed with the legacy result functions or the materialized result functions).\n\nIt is not known beforehand how many chunks will be returned by this result.\n\n @param result The result object to fetch the data chunk from.\n @return The resulting data chunk. Returns `NULL` if the result has an error."]
    pub fn duckdb_stream_fetch_chunk(result: duckdb_result) -> duckdb_data_chunk;
}
unsafe extern "C" {
    #[doc = "Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nIt is not known beforehand how many chunks will be returned by this result.\n\n @param result The result object to fetch the data chunk from.\n @return The resulting data chunk. Returns `NULL` if the result has an error."]
    pub fn duckdb_fetch_chunk(result: duckdb_result) -> duckdb_data_chunk;
}
unsafe extern "C" {
    #[doc = "Creates a new cast function object.\n\n @return The cast function object."]
    pub fn duckdb_create_cast_function() -> duckdb_cast_function;
}
unsafe extern "C" {
    #[doc = "Sets the source type of the cast function.\n\n @param cast_function The cast function object.\n @param source_type The source type to set."]
    pub fn duckdb_cast_function_set_source_type(cast_function: duckdb_cast_function, source_type: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Sets the target type of the cast function.\n\n @param cast_function The cast function object.\n @param target_type The target type to set."]
    pub fn duckdb_cast_function_set_target_type(cast_function: duckdb_cast_function, target_type: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Sets the \"cost\" of implicitly casting the source type to the target type using this function.\n\n @param cast_function The cast function object.\n @param cost The cost to set."]
    pub fn duckdb_cast_function_set_implicit_cast_cost(cast_function: duckdb_cast_function, cost: i64);
}
unsafe extern "C" {
    #[doc = "Sets the actual cast function to use.\n\n @param cast_function The cast function object.\n @param function The function to set."]
    pub fn duckdb_cast_function_set_function(cast_function: duckdb_cast_function, function: duckdb_cast_function_t);
}
unsafe extern "C" {
    #[doc = "Assigns extra information to the cast function that can be fetched during execution, etc.\n\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
    pub fn duckdb_cast_function_set_extra_info(
        cast_function: duckdb_cast_function,
        extra_info: *mut ::std::os::raw::c_void,
        destroy: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.\n\n @param info The info object.\n @return The extra info."]
    pub fn duckdb_cast_function_get_extra_info(info: duckdb_function_info) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Get the cast execution mode from the given function info.\n\n @param info The info object.\n @return The cast mode."]
    pub fn duckdb_cast_function_get_cast_mode(info: duckdb_function_info) -> duckdb_cast_mode;
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the cast function.\n\n @param info The info object.\n @param error The error message."]
    pub fn duckdb_cast_function_set_error(info: duckdb_function_info, error: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.\n\n @param info The info object.\n @param error The error message.\n @param row The index of the row within the output vector to set to NULL.\n @param output The output vector."]
    pub fn duckdb_cast_function_set_row_error(
        info: duckdb_function_info,
        error: *const ::std::os::raw::c_char,
        row: idx_t,
        output: duckdb_vector,
    );
}
unsafe extern "C" {
    #[doc = "Registers a cast function within the given connection.\n\n @param con The connection to use.\n @param cast_function The cast function to register.\n @return Whether or not the registration was successful."]
    pub fn duckdb_register_cast_function(con: duckdb_connection, cast_function: duckdb_cast_function) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroys the cast function object.\n\n @param cast_function The cast function object."]
    pub fn duckdb_destroy_cast_function(cast_function: *mut duckdb_cast_function);
}
unsafe extern "C" {
    #[doc = "Destroys the expression and de-allocates its memory.\n\n @param expr A pointer to the expression."]
    pub fn duckdb_destroy_expression(expr: *mut duckdb_expression);
}
unsafe extern "C" {
    #[doc = "Returns the return type of an expression.\n\n @param expr The expression.\n @return The return type. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_expression_return_type(expr: duckdb_expression) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Returns whether the expression is foldable into a value or not.\n\n @param expr The expression.\n @return True, if the expression is foldable, else false."]
    pub fn duckdb_expression_is_foldable(expr: duckdb_expression) -> bool;
}
unsafe extern "C" {
    #[doc = "Folds an expression creating a folded value.\n\n @param context The client context.\n @param expr The expression. Must be foldable.\n @param out_value The folded value, if folding was successful. Must be destroyed with `duckdb_destroy_value`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
    pub fn duckdb_expression_fold(
        context: duckdb_client_context,
        expr: duckdb_expression,
        out_value: *mut duckdb_value,
    ) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Get a file system instance associated with the given client context.\n\n @param context The client context.\n @return The resulting file system instance. Must be destroyed with `duckdb_destroy_file_system`."]
    pub fn duckdb_client_context_get_file_system(context: duckdb_client_context) -> duckdb_file_system;
}
unsafe extern "C" {
    #[doc = "Destroys the given file system instance.\n @param file_system The file system instance to destroy."]
    pub fn duckdb_destroy_file_system(file_system: *mut duckdb_file_system);
}
unsafe extern "C" {
    #[doc = "Retrieves the last error that occurred on the given file system instance.\n\n @param file_system The file system instance.\n @return The error data."]
    pub fn duckdb_file_system_error_data(file_system: duckdb_file_system) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Opens a file at the given path with the specified options.\n\n @param file_system The file system instance.\n @param path The path to the file.\n @param options The file open options specifying how to open the file.\n @param out_file The resulting file handle instance, or `nullptr` if the open failed. Must be destroyed with\n`duckdb_destroy_file_handle`.\n @return Whether the operation was successful. If not, the error data can be retrieved using\n`duckdb_file_system_error_data`."]
    pub fn duckdb_file_system_open(
        file_system: duckdb_file_system,
        path: *const ::std::os::raw::c_char,
        options: duckdb_file_open_options,
        out_file: *mut duckdb_file_handle,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates a new file open options instance with blank settings.\n\n @return The new file open options instance. Must be destroyed with `duckdb_destroy_file_open_options`."]
    pub fn duckdb_create_file_open_options() -> duckdb_file_open_options;
}
unsafe extern "C" {
    #[doc = "Sets a specific flag in the file open options.\n\n @param options The file open options instance.\n @param flag The flag to set (e.g., read, write).\n @param value If the flag is enabled or disabled.\n @return `DuckDBSuccess` on success or `DuckDBError` if the flag is unrecognized or unsupported by this version of\nDuckDB."]
    pub fn duckdb_file_open_options_set_flag(
        options: duckdb_file_open_options,
        flag: duckdb_file_flag,
        value: bool,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroys the given file open options instance.\n @param options The file open options instance to destroy."]
    pub fn duckdb_destroy_file_open_options(options: *mut duckdb_file_open_options);
}
unsafe extern "C" {
    #[doc = "Destroys the given file handle and deallocates all associated resources.\nThis will also close the file if it is still open.\n\n @param file_handle The file handle to destroy."]
    pub fn duckdb_destroy_file_handle(file_handle: *mut duckdb_file_handle);
}
unsafe extern "C" {
    #[doc = "Retrieves the last error that occurred on the given file handle.\n\n @param file_handle The file handle.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`"]
    pub fn duckdb_file_handle_error_data(file_handle: duckdb_file_handle) -> duckdb_error_data;
}
unsafe extern "C" {
    #[doc = "Reads data from the file into the buffer.\n\n @param file_handle The file handle to read from.\n @param buffer The buffer to read data into.\n @param size The number of bytes to read.\n @return The number of bytes actually read, or negative on error."]
    pub fn duckdb_file_handle_read(
        file_handle: duckdb_file_handle,
        buffer: *mut ::std::os::raw::c_void,
        size: i64,
    ) -> i64;
}
unsafe extern "C" {
    #[doc = "Writes data from the buffer to the file.\n\n @param file_handle The file handle to write to.\n @param buffer The buffer containing data to write.\n @param size The number of bytes to write.\n @return The number of bytes actually written, or negative on error."]
    pub fn duckdb_file_handle_write(
        file_handle: duckdb_file_handle,
        buffer: *const ::std::os::raw::c_void,
        size: i64,
    ) -> i64;
}
unsafe extern "C" {
    #[doc = "Tells the current position in the file.\n\n @param file_handle The file handle to tell the position of.\n @return The current position in the file, or negative on error."]
    pub fn duckdb_file_handle_tell(file_handle: duckdb_file_handle) -> i64;
}
unsafe extern "C" {
    #[doc = "Gets the size of the file.\n\n @param file_handle The file handle to get the size of.\n @return The size of the file in bytes, or negative on error."]
    pub fn duckdb_file_handle_size(file_handle: duckdb_file_handle) -> i64;
}
unsafe extern "C" {
    #[doc = "Seeks to a specific position in the file.\n\n @param file_handle The file handle to seek in.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
    pub fn duckdb_file_handle_seek(file_handle: duckdb_file_handle, position: i64) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Synchronizes the file's state with the underlying storage.\n\n @param file_handle The file handle to synchronize.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
    pub fn duckdb_file_handle_sync(file_handle: duckdb_file_handle) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Closes the given file handle.\n\n @param file_handle The file handle to close.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
    pub fn duckdb_file_handle_close(file_handle: duckdb_file_handle) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Creates a configuration option instance.\n\n @return The resulting configuration option instance. Must be destroyed with `duckdb_destroy_config_option`."]
    pub fn duckdb_create_config_option() -> duckdb_config_option;
}
unsafe extern "C" {
    #[doc = "Destroys the given configuration option instance.\n @param option The configuration option instance to destroy."]
    pub fn duckdb_destroy_config_option(option: *mut duckdb_config_option);
}
unsafe extern "C" {
    #[doc = "Sets the name of the configuration option.\n\n @param option The configuration option instance.\n @param name The name to set."]
    pub fn duckdb_config_option_set_name(option: duckdb_config_option, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Sets the type of the configuration option.\n\n @param option The configuration option instance.\n @param type The type to set."]
    pub fn duckdb_config_option_set_type(option: duckdb_config_option, type_: duckdb_logical_type);
}
unsafe extern "C" {
    #[doc = "Sets the default value of the configuration option.\nIf the type of this option has already been set with `duckdb_config_option_set_type`, the value is cast to the type.\nOtherwise, the type is inferred from the value.\n\n @param option The configuration option instance.\n @param default_value The default value to set."]
    pub fn duckdb_config_option_set_default_value(option: duckdb_config_option, default_value: duckdb_value);
}
unsafe extern "C" {
    #[doc = "Sets the default scope of the configuration option.\nIf not set, this defaults to `DUCKDB_CONFIG_OPTION_SCOPE_SESSION`.\n\n @param option The configuration option instance.\n @param default_scope The default scope to set."]
    pub fn duckdb_config_option_set_default_scope(
        option: duckdb_config_option,
        default_scope: duckdb_config_option_scope,
    );
}
unsafe extern "C" {
    #[doc = "Sets the description of the configuration option.\n\n @param option The configuration option instance.\n @param description The description to set."]
    pub fn duckdb_config_option_set_description(
        option: duckdb_config_option,
        description: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Registers the given configuration option on the specified connection.\n\n @param connection The connection to register the option on.\n @param option The configuration option instance to register.\n @return A duckdb_state indicating success or failure."]
    pub fn duckdb_register_config_option(connection: duckdb_connection, option: duckdb_config_option) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Retrieves the value of a configuration option by name from the given client context.\n\n @param context The client context.\n @param name The name of the configuration option to retrieve.\n @param out_scope Output parameter to optionally store the scope that the configuration option was retrieved from.\nIf this is `nullptr`, the scope is not returned.\nIf the requested option does not exist the scope is set to `DUCKDB_CONFIG_OPTION_SCOPE_INVALID`.\n @return The value of the configuration option. Returns `nullptr` if the option does not exist."]
    pub fn duckdb_client_context_get_config_option(
        context: duckdb_client_context,
        name: *const ::std::os::raw::c_char,
        out_scope: *mut duckdb_config_option_scope,
    ) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Creates a new empty copy function.\n\nThe return value must be destroyed with `duckdb_destroy_copy_function`.\n\n @return The copy function object."]
    pub fn duckdb_create_copy_function() -> duckdb_copy_function;
}
unsafe extern "C" {
    #[doc = "Sets the name of the copy function.\n\n @param copy_function The copy function\n @param name The name to set"]
    pub fn duckdb_copy_function_set_name(copy_function: duckdb_copy_function, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Sets the extra info pointer of the copy function, which can be used to store arbitrary data.\n\n @param copy_function The copy function\n @param extra_info The extra info pointer\n @param destructor  A destructor function to call to destroy the extra info"]
    pub fn duckdb_copy_function_set_extra_info(
        copy_function: duckdb_copy_function,
        extra_info: *mut ::std::os::raw::c_void,
        destructor: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Registers the given copy function on the database connection under the specified name.\n\n @param connection The database connection\n @param copy_function The copy function to register"]
    pub fn duckdb_register_copy_function(
        connection: duckdb_connection,
        copy_function: duckdb_copy_function,
    ) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Destroys the given copy function object.\n @param copy_function The copy function to destroy."]
    pub fn duckdb_destroy_copy_function(copy_function: *mut duckdb_copy_function);
}
unsafe extern "C" {
    #[doc = "Sets the bind function of the copy function, to use when binding `COPY ... TO`.\n\n @param bind The bind function"]
    pub fn duckdb_copy_function_set_bind(copy_function: duckdb_copy_function, bind: duckdb_copy_function_bind_t);
}
unsafe extern "C" {
    #[doc = "Report that an error occurred during the binding-phase of a `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @param error The error message"]
    pub fn duckdb_copy_function_bind_set_error(
        info: duckdb_copy_function_bind_info,
        error: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The bind info provided to the bind function\n @return The extra info pointer."]
    pub fn duckdb_copy_function_bind_get_extra_info(
        info: duckdb_copy_function_bind_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the current connection binding the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The bind info provided to the bind function\n @return The client context."]
    pub fn duckdb_copy_function_bind_get_client_context(info: duckdb_copy_function_bind_info) -> duckdb_client_context;
}
unsafe extern "C" {
    #[doc = "Retrieves the number of columns that will be provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @return The number of columns."]
    pub fn duckdb_copy_function_bind_get_column_count(info: duckdb_copy_function_bind_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the type of a column that will be provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the column to retrieve the type for\n @return The type of the column. Must be destroyed with `duckdb_destroy_logical_type`."]
    pub fn duckdb_copy_function_bind_get_column_type(
        info: duckdb_copy_function_bind_info,
        col_idx: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieves all values for the given options provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @return A STRUCT value containing all options as fields. Must be destroyed with `duckdb_destroy_value`."]
    pub fn duckdb_copy_function_bind_get_options(info: duckdb_copy_function_bind_info) -> duckdb_value;
}
unsafe extern "C" {
    #[doc = "Sets the bind data of the copy function, to be provided to the init, sink and finalize functions.\n\n @param info The bind info provided to the bind function\n @param bind_data The bind data pointer\n @param destructor  A destructor function to call to destroy the bind data"]
    pub fn duckdb_copy_function_bind_set_bind_data(
        info: duckdb_copy_function_bind_info,
        bind_data: *mut ::std::os::raw::c_void,
        destructor: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the initialization function of the copy function, called right before executing `COPY ... TO`.\n\n @param init The init function"]
    pub fn duckdb_copy_function_set_global_init(
        copy_function: duckdb_copy_function,
        init: duckdb_copy_function_global_init_t,
    );
}
unsafe extern "C" {
    #[doc = "Report that an error occurred during the initialization-phase of a `COPY ... TO` function.\n\n @param info The init info provided to the init function\n @param error The error message"]
    pub fn duckdb_copy_function_global_init_set_error(
        info: duckdb_copy_function_global_init_info,
        error: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The init info provided to the init function\n @return The extra info pointer."]
    pub fn duckdb_copy_function_global_init_get_extra_info(
        info: duckdb_copy_function_global_init_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the current connection initializing the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The init info provided to the init function\n @return The client context."]
    pub fn duckdb_copy_function_global_init_get_client_context(
        info: duckdb_copy_function_global_init_info,
    ) -> duckdb_client_context;
}
unsafe extern "C" {
    #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The init info provided to the init function\n @return The bind data pointer."]
    pub fn duckdb_copy_function_global_init_get_bind_data(
        info: duckdb_copy_function_global_init_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the file path provided to the `COPY ... TO` function.\n\nLives for the duration of the initialization callback, must not be destroyed.\n\n @param info The init info provided to the init function\n @return The file path."]
    pub fn duckdb_copy_function_global_init_get_file_path(
        info: duckdb_copy_function_global_init_info,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Sets the global state of the copy function, to be provided to all subsequent local init, sink and finalize functions.\n\n @param info The init info provided to the init function\n @param global_state The global state pointer\n @param destructor  A destructor function to call to destroy the global state"]
    pub fn duckdb_copy_function_global_init_set_global_state(
        info: duckdb_copy_function_global_init_info,
        global_state: *mut ::std::os::raw::c_void,
        destructor: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the sink function of the copy function, called during `COPY ... TO`.\n\n @param function The sink function"]
    pub fn duckdb_copy_function_set_sink(copy_function: duckdb_copy_function, function: duckdb_copy_function_sink_t);
}
unsafe extern "C" {
    #[doc = "Report that an error occurred during the sink-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @param error The error message"]
    pub fn duckdb_copy_function_sink_set_error(
        info: duckdb_copy_function_sink_info,
        error: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The sink info provided to the sink function\n @return The extra info pointer."]
    pub fn duckdb_copy_function_sink_get_extra_info(
        info: duckdb_copy_function_sink_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the current connection during the sink-phase of the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The sink info provided to the sink function\n @return The client context."]
    pub fn duckdb_copy_function_sink_get_client_context(info: duckdb_copy_function_sink_info) -> duckdb_client_context;
}
unsafe extern "C" {
    #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @return The bind data pointer."]
    pub fn duckdb_copy_function_sink_get_bind_data(info: duckdb_copy_function_sink_info)
    -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the global state provided during the init-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @return The global state pointer."]
    pub fn duckdb_copy_function_sink_get_global_state(
        info: duckdb_copy_function_sink_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Sets the finalize function of the copy function, called at the end of `COPY ... TO`.\n\n @param finalize The finalize function"]
    pub fn duckdb_copy_function_set_finalize(
        copy_function: duckdb_copy_function,
        finalize: duckdb_copy_function_finalize_t,
    );
}
unsafe extern "C" {
    #[doc = "Report that an error occurred during the finalize-phase of a `COPY ... TO` function\n\n @param info The finalize info provided to the finalize function\n @param error The error message"]
    pub fn duckdb_copy_function_finalize_set_error(
        info: duckdb_copy_function_finalize_info,
        error: *const ::std::os::raw::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The finalize info provided to the finalize function\n @return The extra info pointer."]
    pub fn duckdb_copy_function_finalize_get_extra_info(
        info: duckdb_copy_function_finalize_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the client context of the current connection during the finalize-phase of the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The finalize info provided to the finalize function\n @return The client context."]
    pub fn duckdb_copy_function_finalize_get_client_context(
        info: duckdb_copy_function_finalize_info,
    ) -> duckdb_client_context;
}
unsafe extern "C" {
    #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The finalize info provided to the finalize function\n @return The bind data pointer."]
    pub fn duckdb_copy_function_finalize_get_bind_data(
        info: duckdb_copy_function_finalize_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieves the global state provided during the init-phase of a `COPY ... TO` function.\n\n @param info The finalize info provided to the finalize function\n @return The global state pointer."]
    pub fn duckdb_copy_function_finalize_get_global_state(
        info: duckdb_copy_function_finalize_info,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    #[doc = "Sets the table function to use when executing a `COPY ... FROM (...)` statement with this copy function.\n\nThe table function must have a `duckdb_table_function_bind_t`, `duckdb_table_function_init_t` and\n`duckdb_table_function_t` set.\n\nThe table function must take a single VARCHAR parameter (the file path).\n\nOptions passed to the `COPY ... FROM (...)` statement are forwarded as named parameters to the table function.\n\nSince `COPY ... FROM` copies into an already existing table, the table function should not define its own result columns\nusing `duckdb_bind_add_result_column` when binding . Instead use `duckdb_table_function_bind_get_result_column_count`\nand related functions in the bind callback of the table function to retrieve the schema of the target table of the `COPY\n... FROM` statement.\n\n @param copy_function The copy function\n @param table_function The table function to use for `COPY ... FROM`"]
    pub fn duckdb_copy_function_set_copy_from_function(
        copy_function: duckdb_copy_function,
        table_function: duckdb_table_function,
    );
}
unsafe extern "C" {
    #[doc = "Retrieves the number of result columns of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the number of columns in the\ntarget table at the start of the bind callback.\n\n @param info The bind info provided to the bind function\n @return The number of result columns."]
    pub fn duckdb_table_function_bind_get_result_column_count(info: duckdb_bind_info) -> idx_t;
}
unsafe extern "C" {
    #[doc = "Retrieves the name of a result column of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the names of the columns in\nthe target table at the start of the bind callback.\n\nThe result is valid for the duration of the bind callback or until the next call to `duckdb_bind_add_result_column`, so\nit must not be destroyed.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the result column to retrieve the name for\n @return The name of the result column."]
    pub fn duckdb_table_function_bind_get_result_column_name(
        info: duckdb_bind_info,
        col_idx: idx_t,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Retrieves the type of a result column of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the types of the columns in\nthe target table at the start of the bind callback.\n\nThe result must be destroyed with `duckdb_destroy_logical_type`.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the result column to retrieve the type for\n @return The type of the result column."]
    pub fn duckdb_table_function_bind_get_result_column_type(
        info: duckdb_bind_info,
        col_idx: idx_t,
    ) -> duckdb_logical_type;
}
unsafe extern "C" {
    #[doc = "Retrieve a database catalog instance by name.\nThis function can only be called from within the context of an active transaction, e.g. during execution of a registered\nfunction callback. Otherwise returns `nullptr`.\n @param context The client context.\n @param catalog_name The name of the catalog.\n @return The resulting catalog instance, or `nullptr` if called from outside an active transaction or if a catalog with\nthe specified name does not exist. Must be destroyed with `duckdb_destroy_catalog`"]
    pub fn duckdb_client_context_get_catalog(
        context: duckdb_client_context,
        catalog_name: *const ::std::os::raw::c_char,
    ) -> duckdb_catalog;
}
unsafe extern "C" {
    #[doc = "Retrieve the \"type name\" of the given catalog.\nE.g. for a DuckDB database, this returns 'duckdb'.\nThe returned string is owned by the catalog and remains valid until the catalog is destroyed.\n\n @param catalog The catalog.\n @return The type name of the catalog."]
    pub fn duckdb_catalog_get_type_name(catalog: duckdb_catalog) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Retrieve a catalog entry from the given catalog by type, schema name and entry name.\nThe returned catalog entry remains valid for the duration of the current transaction.\n\n @param catalog The catalog.\n @param context The client context.\n @param entry_type The type of the catalog entry to retrieve.\n @param schema_name The schema name of the catalog entry.\n @param entry_name The name of the catalog entry.\n @return The resulting catalog entry, or `nullptr` if no such entry exists. Must be destroyed with\n`duckdb_destroy_catalog_entry`. Remains valid for the duration of the current transaction."]
    pub fn duckdb_catalog_get_entry(
        catalog: duckdb_catalog,
        context: duckdb_client_context,
        entry_type: duckdb_catalog_entry_type,
        schema_name: *const ::std::os::raw::c_char,
        entry_name: *const ::std::os::raw::c_char,
    ) -> duckdb_catalog_entry;
}
unsafe extern "C" {
    #[doc = "Destroys the given catalog instance.\n\nNote that this does not actually \"drop\" the contents of the catalog; it merely frees the C API handle.\n\n @param catalog The catalog instance to destroy."]
    pub fn duckdb_destroy_catalog(catalog: *mut duckdb_catalog);
}
unsafe extern "C" {
    #[doc = "Get the type of the given catalog entry.\n\n @param entry The catalog entry.\n @return The type of the catalog entry."]
    pub fn duckdb_catalog_entry_get_type(entry: duckdb_catalog_entry) -> duckdb_catalog_entry_type;
}
unsafe extern "C" {
    #[doc = "Get the name of the given catalog entry.\n\n @param entry The catalog entry.\n @return The name of the catalog entry. The returned string is owned by the catalog entry and remains valid until the\ncatalog entry is destroyed."]
    pub fn duckdb_catalog_entry_get_name(entry: duckdb_catalog_entry) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = "Destroys the given catalog entry instance.\n\nNote that this does not actually \"drop\" the catalog entry from the database catalog; it merely frees the C API handle.\n\n @param entry The catalog entry instance to destroy."]
    pub fn duckdb_destroy_catalog_entry(entry: *mut duckdb_catalog_entry);
}
unsafe extern "C" {
    #[doc = "Creates a new log storage object.\n\n @return A log storage object. Must be destroyed with `duckdb_destroy_log_storage`."]
    pub fn duckdb_create_log_storage() -> duckdb_log_storage;
}
unsafe extern "C" {
    #[doc = "Destroys a log storage object.\n\n @param log_storage The log storage object to destroy."]
    pub fn duckdb_destroy_log_storage(log_storage: *mut duckdb_log_storage);
}
unsafe extern "C" {
    #[doc = "Sets the callback function for writing log entries.\n\n @param log_storage The log storage object.\n @param function The function to call."]
    pub fn duckdb_log_storage_set_write_log_entry(
        log_storage: duckdb_log_storage,
        function: duckdb_logger_write_log_entry_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the extra data of the custom log storage.\n\n @param log_storage The log storage object.\n @param extra_data The extra data that is passed back into the callbacks.\n @param delete_callback The delete callback to call on the extra data, if any."]
    pub fn duckdb_log_storage_set_extra_data(
        log_storage: duckdb_log_storage,
        extra_data: *mut ::std::os::raw::c_void,
        delete_callback: duckdb_delete_callback_t,
    );
}
unsafe extern "C" {
    #[doc = "Sets the name of the log storage.\n\n @param log_storage The log storage object.\n @param name The name of the log storage."]
    pub fn duckdb_log_storage_set_name(log_storage: duckdb_log_storage, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
    #[doc = "Registers a custom log storage for the logger.\n\n @param database A database object.\n @param log_storage The log storage object.\n @return Whether the registration was successful."]
    pub fn duckdb_register_log_storage(database: duckdb_database, log_storage: duckdb_log_storage) -> duckdb_state;
}
unsafe extern "C" {
    #[doc = "Gets the CRS (Coordinate Reference System) of a GEOMETRY type.\nResult must be freed with `duckdb_free`.\n\n @param type The GEOMETRY type.\n @return The CRS of the GEOMETRY type, or NULL if the type is not a GEOMETRY type."]
    pub fn duckdb_geometry_type_get_crs(type_: duckdb_logical_type) -> *mut ::std::os::raw::c_char;
}