Skip to content

Commit

Permalink
yessql.db -> OrchardCore.db (OrchardCMS#7446)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Jan 19, 2024
1 parent 1e9a278 commit 43a7a2d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ public class SqliteOptions
/// <see href="https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/connection-strings#pooling" />
/// </summary>
public bool UseConnectionPooling { get; set; }

/// <summary>
/// Gets or sets the database name. Defaults to <c>OrchardCore.db</c>.
/// </summary>
public string DatabaseName { get; set; } = "OrchardCore.db";
}
}
2 changes: 1 addition & 1 deletion src/OrchardCore/OrchardCore.Data.YesSql/SqliteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class SqliteHelper
public static string GetConnectionString(SqliteOptions sqliteOptions, string databaseFolder) =>
new SqliteConnectionStringBuilder
{
DataSource = Path.Combine(databaseFolder, "yessql.db"),
DataSource = Path.Combine(databaseFolder, sqliteOptions.DatabaseName),
Cache = SqliteCacheMode.Shared,
Pooling = sqliteOptions.UseConnectionPooling
}
Expand Down
5 changes: 5 additions & 0 deletions src/docs/reference/core/Data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Most database configuration is handled automatically, but there are limited opti

### Sqlite

#### `DatabaseName` (string)

By default, "OrchardCore.db" is used as the name for the SQLite database. This property allows you to use a database name of your choice. For backward compatibility with Orchard Core 1.8 and earlier, configure `"yessql.db"`.

#### `UseConnectionPooling` (boolean)

By default in `.NET 6`, `Microsoft.Data.Sqlite` pools connections to the database. It achieves this by putting locking the database file and leaving connections open to be reused. If the lock is preventing tasks like backups, this functionality can be disabled.
Expand All @@ -19,6 +23,7 @@ See the [`Microsoft.Data.Sqlite` documentation](https://docs.microsoft.com/en-us
```json
{
"OrchardCore_Data_Sqlite": {
"DatabaseName": "yessql.db",
"UseConnectionPooling": false
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/docs/releases/1.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Additionally, if you needed to enable indexing for text file with `.txt`, `.md`

If you needed to enable indexing for other extensions like (`.docx`, or `.pptx`), you'll needed `OrchardCore.Media.Indexing.OpenXML` feature.

### Data Access

Previously, the `yessql.db` file was used as a default SQLite database for newly created tenants. Now `OrchardCore.db` is used instead, but you can configure the database name using `SqliteOptions.Database`.

!!! warning
For backward compatibility, you should use `yessql.db` as the database name in the `OrchardCore_Data_Sqlite` configuration. For more info read the [Data (`OrchardCore.Data`) documentation](../reference/core/Data/README.md).

### SMS Module

In the past, we utilized the injection of `ISmsProvider`for sending SMS messages. However, in this release, it is now necessary to inject `ISmsService` instead.
Expand Down

0 comments on commit 43a7a2d

Please sign in to comment.