Skip to content

Commit

Permalink
Update Core to 2.26. (#464)
Browse files Browse the repository at this point in the history
* Regenerate bindings for 2.26.

* Bump Core to 2.26.0.

* Run nightly builds on release-2.26.

* Bump version to 5.16.0.

* Support dumping schema objects to strings and add tests.

* Fix formatting.
  • Loading branch information
teo-tsirpanis authored Sep 11, 2024
1 parent f74ffeb commit 85afde9
Show file tree
Hide file tree
Showing 14 changed files with 306 additions and 200 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- os: windows-latest
platform: windows-x86_64
- tag: dev
tag: [release-2.25, dev]
tag: [release-2.26, dev]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout TileDB
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tag: [release-2.25, dev]
tag: [release-2.26, dev]
runs-on: ubuntu-latest
steps:
- name: Checkout TileDB-CSharp
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
tag: [release-2.25, dev]
tag: [release-2.26, dev]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout TileDB-CSharp
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<TileDBNativePackageName>TileDB.Native</TileDBNativePackageName>
<TileDBNativeVersionMajor>2</TileDBNativeVersionMajor>
<TileDBNativeVersionMinor>25</TileDBNativeVersionMinor>
<TileDBNativeVersionMinor>26</TileDBNativeVersionMinor>
<TileDBNativePackageVersion>[$(TileDBNativeVersionMajor).$(TileDBNativeVersionMinor).0,$(TileDBNativeVersionMajor).$([MSBuild]::Add($(TileDBNativeVersionMinor), 1)).0)</TileDBNativePackageVersion>

<!-- The DevelopmentBuild property switches to the locally built native packages.
Expand Down
11 changes: 11 additions & 0 deletions sources/TileDB.CSharp/ArraySchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using FilterListHandle = TileDB.CSharp.Marshalling.SafeHandles.FilterListHandle;
using DomainHandle = TileDB.CSharp.Marshalling.SafeHandles.DomainHandle;
using AttributeHandle = TileDB.CSharp.Marshalling.SafeHandles.AttributeHandle;
using TileDB.CSharp.Marshalling;

namespace TileDB.CSharp;

Expand Down Expand Up @@ -595,4 +596,14 @@ public bool IsVarSize(string name)

return false;
}

/// <inheritdoc/>
public override string ToString()
{
using var ctx = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
using var strPtr = new StringHandleHolder();
_ctx.handle_error(Methods.tiledb_array_schema_dump_str(ctx, handle, &strPtr._handle));
return strPtr.ToString();
}
}
10 changes: 10 additions & 0 deletions sources/TileDB.CSharp/Attribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,14 @@ public static Attribute Create<T>(Context ctx, string name)
var datatype = EnumUtil.TypeToDataType(typeof(T));
return new Attribute(ctx, name, datatype);
}

/// <inheritdoc/>
public override string ToString()
{
using var ctx = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
using var strPtr = new StringHandleHolder();
_ctx.handle_error(Methods.tiledb_attribute_dump_str(ctx, handle, &strPtr._handle));
return strPtr.ToString();
}
}
10 changes: 10 additions & 0 deletions sources/TileDB.CSharp/Dimension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,14 @@ public static Dimension CreateString(Context ctx, string name)
var str_dim_handle = DimensionHandle.Create(ctx, name, tiledb_datatype_t.TILEDB_STRING_ASCII, null, null);
return new Dimension(ctx, str_dim_handle);
}

/// <inheritdoc/>
public override string ToString()
{
using var ctx = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
using var strPtr = new StringHandleHolder();
_ctx.handle_error(Methods.tiledb_dimension_dump_str(ctx, handle, &strPtr._handle));
return strPtr.ToString();
}
}
12 changes: 12 additions & 0 deletions sources/TileDB.CSharp/Domain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using TileDB.Interop;
using DomainHandle = TileDB.CSharp.Marshalling.SafeHandles.DomainHandle;
using DimensionHandle = TileDB.CSharp.Marshalling.SafeHandles.DimensionHandle;
using TileDB.CSharp.Marshalling;

namespace TileDB.CSharp;

Expand Down Expand Up @@ -176,5 +177,16 @@ public bool HasDimension(string name)
_ctx.handle_error(Methods.tiledb_domain_has_dimension(ctxHandle, handle, ms_name, &has_dim));
return has_dim > 0;
}


/// <inheritdoc/>
public override string ToString()
{
using var ctx = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
using var strPtr = new StringHandleHolder();
_ctx.handle_error(Methods.tiledb_domain_dump_str(ctx, handle, &strPtr._handle));
return strPtr.ToString();
}
#endregion
}
10 changes: 10 additions & 0 deletions sources/TileDB.CSharp/Enumeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,14 @@ public ulong[] GetRawOffsets()
_ctx.handle_error(Methods.tiledb_enumeration_get_offsets(ctxHandle, handle, &data, &dataSize));
return new ReadOnlySpan<ulong>(data, checked((int)(dataSize / sizeof(ulong)))).ToArray();
}

/// <inheritdoc/>
public override string ToString()
{
using var ctx = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
using var strPtr = new StringHandleHolder();
_ctx.handle_error(Methods.tiledb_enumeration_dump_str(ctx, handle, &strPtr._handle));
return strPtr.ToString();
}
}
40 changes: 36 additions & 4 deletions sources/TileDB.CSharp/Interop/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("int32_t")]
public static extern int tiledb_attribute_get_cell_size(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_attribute_t *")] tiledb_attribute_t* attr, [NativeTypeName("uint64_t *")] ulong* cell_size);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_attribute_dump_str(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_attribute_t *")] tiledb_attribute_t* attr, tiledb_string_t** @out);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_attribute_set_fill_value(tiledb_ctx_t* ctx, tiledb_attribute_t* attr, [NativeTypeName("const void *")] void* value, [NativeTypeName("uint64_t")] ulong size);
Expand Down Expand Up @@ -350,6 +354,10 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("int32_t")]
public static extern int tiledb_dimension_get_tile_extent(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_dimension_t *")] tiledb_dimension_t* dim, [NativeTypeName("const void **")] void** tile_extent);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_dimension_dump_str(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_dimension_t *")] tiledb_dimension_t* dimension, tiledb_string_t** @out);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_domain_alloc(tiledb_ctx_t* ctx, tiledb_domain_t** domain);
Expand Down Expand Up @@ -381,6 +389,10 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("int32_t")]
public static extern int tiledb_domain_has_dimension(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_domain_t *")] tiledb_domain_t* domain, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("int32_t *")] int* has_dim);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_domain_dump_str(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_domain_t *")] tiledb_domain_t* domain, tiledb_string_t** @out);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_object_type_to_str(tiledb_object_t object_type, [NativeTypeName("const char **")] sbyte** str);
Expand Down Expand Up @@ -788,6 +800,10 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("int32_t")]
public static extern int tiledb_array_schema_has_attribute(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_array_schema_t *")] tiledb_array_schema_t* array_schema, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("int32_t *")] int* has_attr);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_array_schema_dump_str(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_array_schema_t *")] tiledb_array_schema_t* array_schema, tiledb_string_t** @out);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_query_alloc(tiledb_ctx_t* ctx, tiledb_array_t* array, tiledb_query_type_t query_type, tiledb_query_t** query);
Expand Down Expand Up @@ -1351,6 +1367,18 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_ndrectangle_set_range(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr, [NativeTypeName("uint32_t")] uint idx, tiledb_range_t* range);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_ndrectangle_get_dtype(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr, [NativeTypeName("uint32_t")] uint idx, tiledb_datatype_t* type);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_ndrectangle_get_dtype_from_name(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr, [NativeTypeName("const char *")] sbyte* name, tiledb_datatype_t* type);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_ndrectangle_get_dim_num(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr, [NativeTypeName("uint32_t *")] uint* ndim);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_current_domain_create(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_current_domain_t **")] tiledb_current_domain_handle_t** current_domain);
Expand All @@ -1361,19 +1389,19 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_current_domain_set_ndrectangle([NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr);
public static extern int tiledb_current_domain_set_ndrectangle(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("tiledb_ndrectangle_t *")] tiledb_ndrectangle_handle_t* ndr);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_current_domain_get_ndrectangle([NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("tiledb_ndrectangle_t **")] tiledb_ndrectangle_handle_t** ndr);
public static extern int tiledb_current_domain_get_ndrectangle(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("tiledb_ndrectangle_t **")] tiledb_ndrectangle_handle_t** ndr);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_current_domain_get_is_empty([NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("uint32_t *")] uint* is_empty);
public static extern int tiledb_current_domain_get_is_empty(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, [NativeTypeName("uint32_t *")] uint* is_empty);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_current_domain_get_type([NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, tiledb_current_domain_type_t* type);
public static extern int tiledb_current_domain_get_type(tiledb_ctx_t* ctx, [NativeTypeName("tiledb_current_domain_t *")] tiledb_current_domain_handle_t* current_domain, tiledb_current_domain_type_t* type);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("capi_return_t")]
Expand Down Expand Up @@ -1410,6 +1438,10 @@ public static int tiledb_status([NativeTypeName("capi_return_t")] int x)
[return: NativeTypeName("capi_return_t")]
public static extern int tiledb_enumeration_get_offsets(tiledb_ctx_t* ctx, tiledb_enumeration_t* enumeration, [NativeTypeName("const void **")] void** offsets, [NativeTypeName("uint64_t *")] ulong* offsets_size);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_enumeration_dump_str(tiledb_ctx_t* ctx, tiledb_enumeration_t* enumeration, tiledb_string_t** @out);

[DllImport("tiledb", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("int32_t")]
public static extern int tiledb_channel_operator_sum_get(tiledb_ctx_t* ctx, [NativeTypeName("const tiledb_channel_operator_t **")] tiledb_channel_operator_t** op);
Expand Down
4 changes: 2 additions & 2 deletions sources/TileDB.CSharp/TileDB.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<RootNamespace>TileDB.CSharp</RootNamespace>
<Version>5.15.0</Version>
<Version>5.16.0</Version>
<Description>C# wrapper of the TileDB Embedded universal data engine.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>5.14.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>5.15.0</PackageValidationBaselineVersion>
<NoWarn>$(NoWarn);TILEDB0012;TILEDB0013;TILEDB0014</NoWarn>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 85afde9

Please sign in to comment.