Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-04-30 9f2ef60949ced4fab4d077a7e1c6d913f3620c9b
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
// <copyright file="ArrayHandler.cs" company="Brick Abode">
//
// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
//                      procedural languages (PL)
//
//
// Copyright (c) 2023 Brick Abode
//
// This code is subject to the terms of the PostgreSQL License.
// The full text of the license can be found in the LICENSE file
// at the top level of the pldotnet repository.
//
// </copyright>
 
using System;
using System.Runtime.InteropServices;
using NpgsqlTypes;
 
namespace PlDotNET.Handler
{
    /// <summary>
    /// A generic class for all type handlers which handle PostreSQL arrays.
    /// </summary>
    public static partial class ArrayHandler
    {
        public static int Maxdim = get_Maxdim();
 
        /// <summary>
        /// C function declared in pldotnet_conversions.h.
        /// See ::get_Maxdim().
        /// </summary>
        [LibraryImport("@PKG_LIBDIR/pldotnet.so")]
        public static partial int get_Maxdim();
 
        /// <summary>
        /// C function declared in pldotnet_conversions.h.
        /// See ::pldotnet_GetArrayAttributes().
        /// </summary>
        [LibraryImport("@PKG_LIBDIR/pldotnet.so")]
        public static unsafe partial void pldotnet_GetArrayAttributes(IntPtr datum, ref int typeId, ref int nDims, int[] dims, ref byte* nullmap);
 
        /// <summary>
        /// C function declared in pldotnet_conversions.h.
        /// See ::pldotnet_GetArrayDatum().
        /// </summary>
        [LibraryImport("@PKG_LIBDIR/pldotnet.so")]
        public static unsafe partial int pldotnet_GetArrayDatum(IntPtr arrayDatum, IntPtr[] results, int nElems, int typeId);
 
        /// <summary>
        /// C function declared in pldotnet_conversions.h.
        /// See ::pldotnet_CreateDatumArray().
        /// </summary>
        [LibraryImport("@PKG_LIBDIR/pldotnet.so")]
        public static partial IntPtr pldotnet_CreateDatumArray(int elementId, int dimNumber, int[] dimLengths, IntPtr[] datums, byte[] nullmap = null);
    }
}