Path: redb/redb.Core/Providers/Base/ObjectStorageProviderExtensions.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Providers/Base/ObjectStorageProviderExtensions.cs
----
using redb.Core.Data;
using redb.Core.Utils;
using System.Text.Json.Serialization;
using System.Reflection;
namespace redb.Core.Providers.Base
{
///
/// Extensions for PostgresObjectStorageProvider under the new saving paradigm
///
public static class ObjectStorageProviderExtensions
{
// ===== NEW METHODS FOR FIELD PROCESSING UNDER THE NEW PARADIGM =====
///
/// Determine if a record should be created in _values based on value and _store_null
///
internal static bool ShouldCreateValueRecord(object? rawValue, bool storeNull)
{
// If the value is not NULL - always create a record
if (rawValue != null) return true;
// If the value is NULL - create a record only if _store_null = true
return storeNull;
}
///
/// Check if the type is a Class type (business class, not a primitive)
///
internal static bool IsClassType(string typeSemantic)
{
// FIXED: Class type has Type1 = "Object" (looking at TypeSemantic from _types._type)
// Business classes are mapped to type "Class" with _type="Object"
return typeSemantic == "Object";
}
///
/// Check if the type is a RedbObject<> reference
///
internal static bool IsRedbObjectReference(string typeSemantic)
{
return typeSemantic == "RedbObjectRow";
}
}
}