Skip to content

Commit cb649fd

Browse files
committed
Connection parser now returns :memory: instead of null when fulluri=:memory: is used.
1 parent 7c96bce commit cb649fd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

SQLite.CodeFirst/Internal/Utility/ConnectionStringParser.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@ internal static class ConnectionStringParser
1717

1818
public static string GetDataSource(string connectionString)
1919
{
20-
// Check if the datasource token exists and return Null if it doesn't.
21-
// This will allow connection strings with FullUri to work.
20+
// If the datasource token does not exists this is a FullUri connection string.
2221
IDictionary<string, string> strings = ParseConnectionString(connectionString);
2322
if (strings.ContainsKey(DataSourceToken))
2423
{
2524
var path = ExpandDataDirectory(ParseConnectionString(connectionString)[DataSourceToken]);
2625
// remove quotation mark if exists
27-
path = path.Trim('"');
28-
return path;
26+
return path.Trim('"');
27+
}
28+
// TODO: Implement FullUri parsing.
29+
if (connectionString.Contains(":memory:"))
30+
{
31+
return ":memory:";
2932
}
30-
return null;
33+
throw new NotSupportedException("FullUri format is currently only supported for :memory:.");
3134
}
3235

3336
[SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "ToUppercase makes no sense.")]

0 commit comments

Comments
 (0)