-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support shared in-memory databases (#88)
* support shared in-memory databases * support connection duplication for isolated in-memory database * fix it's creating on-disk databases when using 'DataSource=:memory:?cache=shared' connection string
- Loading branch information
Showing
6 changed files
with
203 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
|
||
namespace DuckDB.NET.Data.Internal | ||
{ | ||
internal static class InMemoryDataSource | ||
{ | ||
public static readonly string Default = string.Empty; | ||
public static readonly string CacheShared = Guid.NewGuid().ToString(); | ||
|
||
public static bool IsInMemoryDataSource(string dataSource) | ||
{ | ||
return IsDefault(dataSource) || IsCacheShared(dataSource); | ||
} | ||
|
||
public static bool IsDefault(string dataSource) | ||
{ | ||
return dataSource == Default; | ||
} | ||
|
||
public static bool IsCacheShared(string dataSource) | ||
{ | ||
return string.Equals(dataSource, CacheShared, StringComparison.OrdinalIgnoreCase); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters