1+ using System . Runtime . InteropServices ;
2+ using System ;
3+
4+ namespace DuckDB . NET . Native ;
5+
6+ public partial class NativeMethods
7+ {
8+ public static class TableFunction
9+ {
10+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_create_tableFunction" ) ]
11+ public static extern IntPtr DuckDBCreateTableFunction ( ) ;
12+
13+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_destroy_tableFunction" ) ]
14+ public static extern void DuckDBDestroyTableFunction ( out IntPtr tableFunction ) ;
15+
16+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_table_function_set_name" ) ]
17+ public static extern void DuckDBTableFunctionSetName ( IntPtr tableFunction , SafeUnmanagedMemoryHandle name ) ;
18+
19+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_table_function_add_parameter" ) ]
20+ public static extern void DuckDBTableFunctionAddParameter ( IntPtr tableFunction , DuckDBLogicalType type ) ;
21+
22+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_table_function_set_extra_info" ) ]
23+ public static extern unsafe void DuckDBTableFunctionSetExtraInfo ( IntPtr tableFunction , IntPtr extraInfo , delegate * unmanaged[ Cdecl] < IntPtr , void > destroy ) ;
24+
25+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_table_function_set_bind" ) ]
26+ public static extern unsafe void DuckDBTableFunctionSetBind ( IntPtr tableFunction , delegate * unmanaged[ Cdecl] < IntPtr , void > bind ) ;
27+
28+ //[DllImport(DuckDbLibrary, CallingConvention = CallingConvention.Cdecl, EntryPoint = "duckdb_table_function_set_init")]
29+ //public static extern unsafe void DuckDBTableFunctionSetInit(IntPtr tableFunction, duckdb_tableFunction_init_t init);
30+
31+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_table_function_set_function" ) ]
32+ public static extern unsafe void DuckDBTableFunctionSetFunction ( IntPtr tableFunction , delegate * unmanaged[ Cdecl] < IntPtr , IntPtr , IntPtr , void > callback ) ;
33+
34+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_register_table_function" ) ]
35+ public static extern DuckDBState DuckDBRegisterTableFunction ( DuckDBNativeConnection con , IntPtr tableFunction ) ;
36+
37+ #region TableFunctionBind
38+
39+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_bind_add_result_column" ) ]
40+ public static extern unsafe void DuckDBBindAddResultColumn ( IntPtr info , SafeUnmanagedMemoryHandle name , DuckDBLogicalType type ) ;
41+
42+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_bind_get_parameter_count" ) ]
43+ public static extern unsafe ulong DuckDBBindGetParameterCount ( IntPtr info ) ;
44+
45+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_bind_get_parameter" ) ]
46+ public static extern unsafe DuckDBValue DuckDBBindGetParameter ( IntPtr info , ulong index ) ;
47+
48+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_bind_set_bind_data" ) ]
49+ public static extern unsafe void DuckDBBindSetBindData ( IntPtr info , IntPtr bindData , delegate * unmanaged[ Cdecl] < IntPtr , void > destroy ) ;
50+
51+ #endregion
52+
53+ #region TableFunction
54+
55+ [ DllImport ( DuckDbLibrary , CallingConvention = CallingConvention . Cdecl , EntryPoint = "duckdb_function_get_bind_data" ) ]
56+ public static extern unsafe void * duckdb_function_get_bind_data ( IntPtr info ) ;
57+
58+ #endregion
59+ }
60+ }
0 commit comments