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

loresoft / SchemaSaurus / 25437854443

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

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/RelationBase.cs
1
using System.Diagnostics;
2

3
using SchemaSaurus.Metadata.Converters;
4

5
namespace SchemaSaurus.Metadata;
6

7
/// <summary>
8
/// Abstract base class for column-bearing database objects (<see cref="Table"/> and <see cref="View"/>).
9
/// </summary>
10
/// <remarks>
11
/// Encapsulates the structural members shared by all relations — columns, indexes, triggers,
12
/// and provider annotations — so that generic code can operate on any relation without
13
/// knowing its concrete type.
14
/// </remarks>
15
[Equatable]
16
[DebuggerDisplay("{QualifiedName}")]
17
public abstract partial class RelationBase : IAnnotatable, IQualifiedName
18
{
19
    /// <summary>
20
    /// Schema-qualified name that uniquely identifies this relation within the database.
21
    /// </summary>
22
    [JsonPropertyName("qualifiedName")]
23
    public required SchemaQualifiedName QualifiedName { get; init; }
24

25
    /// <summary>
26
    /// Gets the unqualified name component of the object.
27
    /// </summary>
28
    [JsonIgnore]
29
    [IgnoreEquality]
NEW
30
    public string Name => QualifiedName.Name;
×
31

32
    /// <summary>
33
    /// Gets the schema component of the qualified name, if available.
34
    /// </summary>
35
    [JsonIgnore]
36
    [IgnoreEquality]
NEW
37
    public string? Schema => QualifiedName.Schema;
×
38

39
    /// <summary>
40
    /// Back-reference to the owning <see cref="DatabaseModel"/>.
41
    /// Populated after deserialization during model fixup; excluded from JSON serialization
42
    /// and equality comparison.
43
    /// </summary>
44
    [JsonIgnore]
45
    [IgnoreEquality]
46
    public DatabaseModel Database { get; internal set; } = null!;
47

48
    /// <summary>
49
    /// Columns belonging to this relation, ordered by <see cref="Column.OrdinalPosition"/>.
50
    /// Defaults to an empty collection.
51
    /// </summary>
52
    [SequenceEquality]
53
    [JsonPropertyName("columns")]
54
    public IReadOnlyList<Column> Columns { get; init; } = [];
55

56
    /// <summary>
57
    /// Indexes (clustered, non-clustered, filtered, etc.) defined on this relation.
58
    /// Defaults to an empty collection.
59
    /// </summary>
60
    [SequenceEquality]
61
    [JsonPropertyName("indexes")]
62
    public IReadOnlyList<Index> Indexes { get; init; } = [];
63

64
    /// <summary>
65
    /// DML triggers (INSERT, UPDATE, DELETE) defined on this relation.
66
    /// Defaults to an empty collection.
67
    /// </summary>
68
    [SequenceEquality]
69
    [JsonPropertyName("triggers")]
70
    public IReadOnlyList<Trigger> Triggers { get; init; } = [];
71

72
    /// <summary>
73
    /// Human-readable description or comment attached to this relation.
74
    /// Sourced from <c>MS_Description</c> extended properties (SQL Server) or
75
    /// <c>COMMENT ON TABLE</c> / <c>COMMENT ON VIEW</c> (PostgreSQL / MySQL / Oracle).
76
    /// <see langword="null"/> when no description has been set.
77
    /// </summary>
78
    [JsonPropertyName("description")]
79
    public string? Description { get; init; }
80

81
    /// <inheritdoc />
82
    [DictionaryEquality]
83
    [JsonPropertyName("annotations")]
84
    [JsonConverter(typeof(ReadOnlyDictionaryConverter<string, object?>))]
85
    public IReadOnlyDictionary<string, object?> Annotations { get; init; } = new Dictionary<string, object?>();
86
}
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