• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / SchemaSaurus / 25437460438

06 May 2026 01:13PM UTC coverage: 87.024% (-0.09%) from 87.11%
25437460438

push

github

pwelter34
Replace SchemaQualifiedName with QualifiedName

1076 of 1424 branches covered (75.56%)

Branch coverage included in aggregate %.

71 of 95 new or added lines in 34 files covered. (74.74%)

5691 of 6352 relevant lines covered (89.59%)

223.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/SchemaSaurus.Metadata/UserDefinedType.cs
1
using System.Diagnostics;
2

3
using SchemaSaurus.Metadata.Converters;
4

5
namespace SchemaSaurus.Metadata;
6

7
/// <summary>
8
/// Represents a user-defined type (UDT) in the database.
9
/// </summary>
10
/// <remarks>
11
/// The <see cref="Kind"/> property determines the structural category of the type and
12
/// which additional members are populated:
13
/// <list type="bullet">
14
///   <item><see cref="UserDefinedTypeKind.TableType"/> — <see cref="Columns"/> describes the table structure.</item>
15
///   <item><see cref="UserDefinedTypeKind.Enum"/> — <see cref="EnumLabels"/> lists the allowed values.</item>
16
///   <item><see cref="UserDefinedTypeKind.Alias"/> — the inherited <see cref="TypeMapping"/> facets describe the underlying system type.</item>
17
/// </list>
18
/// Inherits base-type facets (e.g. <see cref="TypeMapping.MaxLength"/>,
19
/// <see cref="TypeMapping.Precision"/>) from <see cref="TypeMapping"/>.
20
/// </remarks>
21
[Equatable]
22
[DebuggerDisplay("{QualifiedName} ({Kind})")]
23
public sealed partial class UserDefinedType : TypeMapping, IAnnotatable, IQualifiedName
24
{
25
    /// <summary>
26
    /// Schema-qualified name of the user-defined type.
27
    /// </summary>
28
    [JsonPropertyName("qualifiedName")]
29
    public required SchemaQualifiedName QualifiedName { get; init; }
30

31
    /// <summary>
32
    /// Gets the unqualified name component of the object.
33
    /// </summary>
34
    [JsonIgnore]
35
    [IgnoreEquality]
NEW
36
    public string Name => QualifiedName.Name;
×
37

38
    /// <summary>
39
    /// Gets the schema component of the qualified name, if available.
40
    /// </summary>
41
    [JsonIgnore]
42
    [IgnoreEquality]
NEW
43
    public string? Schema => QualifiedName.Schema;
×
44

45
    /// <summary>
46
    /// Structural kind of this user-defined type.
47
    /// </summary>
48
    /// <remarks>
49
    /// See <see cref="UserDefinedTypeKind"/> for the supported categories
50
    /// (e.g. <see cref="UserDefinedTypeKind.Alias"/>,
51
    /// <see cref="UserDefinedTypeKind.TableType"/>,
52
    /// <see cref="UserDefinedTypeKind.Enum"/>).
53
    /// </remarks>
54
    [JsonPropertyName("kind")]
55
    public UserDefinedTypeKind Kind { get; init; }
56

57
    /// <summary>
58
    /// Column descriptors for table-valued parameter types
59
    /// (<see cref="UserDefinedTypeKind.TableType"/>).
60
    /// </summary>
61
    /// <remarks>
62
    /// <see langword="null"/> for other <see cref="Kind"/> values.
63
    /// Note that <see cref="Column.Parent"/> will be <see langword="null"/> for these
64
    /// columns because they do not belong to a <see cref="Table"/> or <see cref="View"/>.
65
    /// </remarks>
66
    [SequenceEquality]
67
    [JsonPropertyName("columns")]
68
    public IReadOnlyList<Column>? Columns { get; init; }
69

70
    /// <summary>
71
    /// Ordered list of label strings for PostgreSQL enum types
72
    /// (<see cref="UserDefinedTypeKind.Enum"/>).
73
    /// </summary>
74
    /// <remarks>
75
    /// <see langword="null"/> for other <see cref="Kind"/> values.
76
    /// Labels are returned in the declaration order defined by
77
    /// <c>CREATE TYPE … AS ENUM (…)</c>.
78
    /// </remarks>
79
    [SequenceEquality]
80
    [JsonPropertyName("enumLabels")]
81
    public IReadOnlyList<string>? EnumLabels { get; init; }
82

83
    /// <inheritdoc />
84
    [DictionaryEquality]
85
    [JsonPropertyName("annotations")]
86
    [JsonConverter(typeof(ReadOnlyDictionaryConverter<string, object?>))]
87
    public IReadOnlyDictionary<string, object?> Annotations { get; init; } = new Dictionary<string, object?>();
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc