-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathNpgsqlDatabaseConfig.cs
More file actions
65 lines (57 loc) · 1.84 KB
/
NpgsqlDatabaseConfig.cs
File metadata and controls
65 lines (57 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2026 Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Moryx.Configuration;
using Moryx.Model.Attributes;
namespace Moryx.Model.PostgreSQL;
/// <summary>
/// Database config for the Npgsql databases
/// </summary>
[DataContract]
public class NpgsqlDatabaseConfig : DatabaseConfig
{
/// <inheritdoc />
public override string ConfiguratorType => typeof(NpgsqlModelConfigurator).AssemblyQualifiedName;
/// <summary>
/// Name of the database to connect to
/// </summary>
[Required]
[DefaultValue("<DatabaseName>")]
[Description("Name of the database to connect to")]
[ConnectionStringKey("Database")]
public string Database { get; set; }
/// <summary>
/// Username used to connect to the database
/// </summary>
[Required]
[DefaultValue("postgres")]
[Description("Username used to connect to the database")]
[ConnectionStringKey("Username")]
public string Username { get; set; }
/// <summary>
/// Password used to connect to the database
/// </summary>
[Required, Password]
[DefaultValue("postgres")]
[Description("Password used to connect to the database")]
[ConnectionStringKey("Password")]
public string Password { get; set; }
/// <summary>
/// Hostname of the database server
/// </summary>
[Required]
[DefaultValue("localhost")]
[Description("Hostname of the database server")]
[ConnectionStringKey("Host")]
public string Host { get; set; }
/// <summary>
/// Port of the database server
/// </summary>
[Required]
[DefaultValue(5432)]
[Description("Port of the database server")]
[ConnectionStringKey("Port")]
public int Port { get; set; }
}