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

curt / Viae / 19527137380

20 Nov 2025 05:53AM UTC coverage: 51.56%. First build
19527137380

push

github

web-flow
feat: provide minimal locus and vestigium views (#1)

62 of 109 branches covered (56.88%)

Branch coverage included in aggregate %.

500 of 981 new or added lines in 61 files covered. (50.97%)

500 of 981 relevant lines covered (50.97%)

19.89 hits per line

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

0.0
/endpoint/src/Viae.Persistence/PostgresConfiguration.cs
1
// Copyright © 2025 Curt Gilman
2
// SPDX-License-Identifier: AGPL-3.0-only
3
// Viae: A geo-centric, journey-focused, federated blog platform
4

5
using System.Globalization;
6

7
namespace Viae.Persistence;
8

9
/// <summary>
10
/// Configuration options for PostgreSQL database connection.
11
/// </summary>
12
public sealed class PostgresConfiguration
13
{
14
    /// <summary>
15
    /// The configuration section name.
16
    /// </summary>
17
    public const string SectionName = "Postgres";
18

19
    /// <summary>
20
    /// Gets or sets the database host.
21
    /// </summary>
22
    public string Host { get; set; } = "localhost";
23

24
    /// <summary>
25
    /// Gets or sets the database port.
26
    /// </summary>
27
    public int Port { get; set; } = 5432;
28

29
    /// <summary>
30
    /// Gets or sets the database name.
31
    /// </summary>
32
    public string Database { get; set; } = string.Empty;
33

34
    /// <summary>
35
    /// Gets or sets the database username.
36
    /// </summary>
37
    public string Username { get; set; } = string.Empty;
38

39
    /// <summary>
40
    /// Gets or sets the database password.
41
    /// </summary>
42
    public string Password { get; set; } = string.Empty;
43

44
    /// <summary>
45
    /// Gets or sets the minimum pool size.
46
    /// </summary>
47
    public int MinPoolSize { get; set; }
48

49
    /// <summary>
50
    /// Gets or sets the maximum pool size.
51
    /// </summary>
52
    public int MaxPoolSize { get; set; } = 100;
53

54
    /// <summary>
55
    /// Gets or sets the connection timeout in seconds.
56
    /// </summary>
57
    public int ConnectionTimeout { get; set; } = 15;
58

59
    /// <summary>
60
    /// Gets or sets whether to include error details in exceptions.
61
    /// </summary>
62
    public bool IncludeErrorDetail { get; set; }
63

64
    /// <summary>
65
    /// Builds a Npgsql connection string from the configuration values.
66
    /// </summary>
67
    /// <returns>A PostgreSQL connection string.</returns>
68
    public string BuildConnectionString()
69
    {
NEW
70
        var builder = new System.Text.StringBuilder();
×
71

NEW
72
        builder.Append(CultureInfo.InvariantCulture, $"Host={Host}");
×
NEW
73
        builder.Append(CultureInfo.InvariantCulture, $";Port={Port}");
×
NEW
74
        builder.Append(CultureInfo.InvariantCulture, $";Database={Database}");
×
NEW
75
        builder.Append(CultureInfo.InvariantCulture, $";Username={Username}");
×
NEW
76
        builder.Append(CultureInfo.InvariantCulture, $";Password={Password}");
×
NEW
77
        builder.Append(CultureInfo.InvariantCulture, $";Minimum Pool Size={MinPoolSize}");
×
NEW
78
        builder.Append(CultureInfo.InvariantCulture, $";Maximum Pool Size={MaxPoolSize}");
×
NEW
79
        builder.Append(CultureInfo.InvariantCulture, $";Timeout={ConnectionTimeout}");
×
NEW
80
        builder.Append(CultureInfo.InvariantCulture, $";Include Error Detail={IncludeErrorDetail}");
×
81

NEW
82
        return builder.ToString();
×
83
    }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc