feat: Add connection strings parameters for databases
Allows specifying complete connection strings for SQLite, MySQL, and Postgres, overriding individual host and credential properties when specified, to provide more flexible database configuration.
This commit is contained in:
parent
7ea4e1ed3e
commit
f2e88cbedc
1 changed files with 35 additions and 0 deletions
|
|
@ -532,10 +532,31 @@ namespace TShockAPI.Configuration
|
||||||
[Description("The type of database to use when storing data (either \"sqlite\", \"mysql\" or \"postgres\").")]
|
[Description("The type of database to use when storing data (either \"sqlite\", \"mysql\" or \"postgres\").")]
|
||||||
public string StorageType = "sqlite";
|
public string StorageType = "sqlite";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The connection string to use when connecting to a SQLite database.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>This property will override the <see cref="SqliteDBPath"/> property, if used.</remarks>
|
||||||
|
[Description("The connection string to use when connecting to a SQLite database. This property will override the SqliteDBPath property, if used.")]
|
||||||
|
public string SqliteConnectionString = "";
|
||||||
|
|
||||||
/// <summary>The path of sqlite db.</summary>
|
/// <summary>The path of sqlite db.</summary>
|
||||||
[Description("The path of sqlite db.")]
|
[Description("The path of sqlite db.")]
|
||||||
public string SqliteDBPath = "tshock.sqlite";
|
public string SqliteDBPath = "tshock.sqlite";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The connection string to use when connecting to a MySQL database.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property will override the
|
||||||
|
/// <see cref="MySqlHost"/>,
|
||||||
|
/// <see cref="MySqlDbName"/>,
|
||||||
|
/// <see cref="MySqlUsername"/>,
|
||||||
|
/// and <see cref="MySqlPassword"/> properties, if used.
|
||||||
|
/// </remarks>
|
||||||
|
[Description("The connection string to use when connecting to a MySQL database. " +
|
||||||
|
"This property will override the MySqlHost, MySqlDbName, MySqlUsername and MySqlPassword properties, if used.")]
|
||||||
|
public string MySqlConnectionString = "";
|
||||||
|
|
||||||
/// <summary>The MySQL hostname and port to direct connections to.</summary>
|
/// <summary>The MySQL hostname and port to direct connections to.</summary>
|
||||||
[Description("The MySQL hostname and port to direct connections to.")]
|
[Description("The MySQL hostname and port to direct connections to.")]
|
||||||
public string MySqlHost = "localhost:3306";
|
public string MySqlHost = "localhost:3306";
|
||||||
|
|
@ -552,6 +573,20 @@ namespace TShockAPI.Configuration
|
||||||
[Description("The password used when connecting to a MySQL database.")]
|
[Description("The password used when connecting to a MySQL database.")]
|
||||||
public string MySqlPassword = "";
|
public string MySqlPassword = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The connection string to use when connecting to a Postgres database.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property will override the
|
||||||
|
/// <see cref="PostgresHost"/>,
|
||||||
|
/// <see cref="PostgresDbName"/>,
|
||||||
|
/// <see cref="PostgresUsername"/>,
|
||||||
|
/// and <see cref="PostgresPassword"/> properties, if used.
|
||||||
|
/// </remarks>
|
||||||
|
[Description("The connection string to use when connecting to a Postgres database. " +
|
||||||
|
"This property will override the PostgresHost, PostgresDbName, PostgresUsername and PostgresPassword properties, if used.")]
|
||||||
|
public string PostgresConnectionString = "";
|
||||||
|
|
||||||
///<summary>The Postgres hostname and port to direct connections to.</summary>
|
///<summary>The Postgres hostname and port to direct connections to.</summary>
|
||||||
[Description("The Postgres hostname and port to direct connections to.")]
|
[Description("The Postgres hostname and port to direct connections to.")]
|
||||||
public string PostgresHost = "";
|
public string PostgresHost = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue