Example #1
0
 public override unsafe void DuckdbDestroyResult(ref DuckdbResult result)
 {
     DuckdbResult.__Native result_ = default(DuckdbResult.__Native);
     result.__MarshalTo(ref result_);
     duckdb_destroy_result_(&result_);
     result.__MarshalFree(ref result_);
 }
Example #2
0
        public override unsafe DuckdbState DuckdbExecutePrepared(IntPtr reparedStatementRef, ref DuckdbResult outResult)
        {
            DuckdbResult.__Native outResult_ = default(DuckdbResult.__Native);
            DuckdbState           __result__;

            outResult.__MarshalTo(ref outResult_);
            __result__ = duckdb_execute_prepared_((void *)reparedStatementRef, &outResult_);
            outResult.__MarshalFree(ref outResult_);
            return(__result__);
        }
Example #3
0
        public override unsafe Double DuckdbValueDouble(ref DuckdbResult result, UInt64 col, UInt64 row)
        {
            DuckdbResult.__Native result_ = default(DuckdbResult.__Native);
            Double __result__;

            result.__MarshalTo(ref result_);
            __result__ = duckdb_value_double_(&result_, col, row);
            result.__MarshalFree(ref result_);
            return(__result__);
        }
Example #4
0
        public override unsafe String DuckdbColumnName(ref DuckdbResult result, UInt64 col)
        {
            DuckdbResult.__Native result_ = default(DuckdbResult.__Native);
            String __result__;
            IntPtr __result__native;

            result.__MarshalTo(ref result_);
            __result__native = duckdb_column_name_(&result_, col);
            __result__       = Encoder.NativeUtf8ToManagedString(__result__native);
            result.__MarshalFree(ref result_);
            return(__result__);
        }
Example #5
0
        public override unsafe String DuckdbValueVarchar(ref DuckdbResult result, UInt64 col, UInt64 row)
        {
            DuckdbResult.__Native result_ = default(DuckdbResult.__Native);
            String __result__;
            IntPtr __result__native;

            result.__MarshalTo(ref result_);
            __result__native = duckdb_value_varchar_(&result_, col, row);
            __result__       = Encoder.NativeUtf8ToManagedString(__result__native);
            result.__MarshalFree(ref result_);
            return(__result__);
        }
Example #6
0
        public override unsafe Boolean DuckdbValueBoolean(ref DuckdbResult result, UInt64 col, UInt64 row)
        {
            DuckdbResult.__Native result_ = default(DuckdbResult.__Native);
            Boolean __result__;
            Byte    __result__native;

            result.__MarshalTo(ref result_);
            __result__native = duckdb_value_boolean_(&result_, col, row);
            __result__       = __result__native != 0;
            result.__MarshalFree(ref result_);
            return(__result__);
        }
Example #7
0
        public override DuckdbState DuckdbQuery(IntPtr connection, String query, out DuckdbResult outResult)
        {
            DuckdbState __result__;

            outResult = new DuckdbResult();

            IntPtr query_ = Encoder.ManagedStringToNativeUtf8(query);

            DuckdbResult.__Native outResult_;
            __result__ = duckdb_query_(connection, query_, out outResult_);
            outResult.__MarshalFrom(ref outResult_);
            outResult.__MarshalFree(ref outResult_);

            Marshal.FreeHGlobal(query_);

            return(__result__);
        }