@@ -31,6 +31,7 @@ public class SqliteConnectionStringBuilder : DbConnectionStringBuilder
3131 private const string DefaultTimeoutKeyword = "Default Timeout" ;
3232 private const string CommandTimeoutKeyword = "Command Timeout" ;
3333 private const string PoolingKeyword = "Pooling" ;
34+ private const string VfsKeyword = "Vfs" ;
3435
3536 private enum Keywords
3637 {
@@ -41,7 +42,8 @@ private enum Keywords
4142 ForeignKeys ,
4243 RecursiveTriggers ,
4344 DefaultTimeout ,
44- Pooling
45+ Pooling ,
46+ Vfs ,
4547 }
4648
4749 private static readonly IReadOnlyList < string > _validKeywords ;
@@ -55,10 +57,11 @@ private enum Keywords
5557 private bool _recursiveTriggers ;
5658 private int _defaultTimeout = 30 ;
5759 private bool _pooling = true ;
60+ private string ? _vfs = string . Empty ;
5861
5962 static SqliteConnectionStringBuilder ( )
6063 {
61- var validKeywords = new string [ 8 ] ;
64+ var validKeywords = new string [ 9 ] ;
6265 validKeywords [ ( int ) Keywords . DataSource ] = DataSourceKeyword ;
6366 validKeywords [ ( int ) Keywords . Mode ] = ModeKeyword ;
6467 validKeywords [ ( int ) Keywords . Cache ] = CacheKeyword ;
@@ -67,9 +70,10 @@ static SqliteConnectionStringBuilder()
6770 validKeywords [ ( int ) Keywords . RecursiveTriggers ] = RecursiveTriggersKeyword ;
6871 validKeywords [ ( int ) Keywords . DefaultTimeout ] = DefaultTimeoutKeyword ;
6972 validKeywords [ ( int ) Keywords . Pooling ] = PoolingKeyword ;
73+ validKeywords [ ( int ) Keywords . Vfs ] = VfsKeyword ;
7074 _validKeywords = validKeywords ;
7175
72- _keywords = new Dictionary < string , Keywords > ( 11 , StringComparer . OrdinalIgnoreCase )
76+ _keywords = new Dictionary < string , Keywords > ( 12 , StringComparer . OrdinalIgnoreCase )
7377 {
7478 [ DataSourceKeyword ] = Keywords . DataSource ,
7579 [ ModeKeyword ] = Keywords . Mode ,
@@ -79,6 +83,7 @@ static SqliteConnectionStringBuilder()
7983 [ RecursiveTriggersKeyword ] = Keywords . RecursiveTriggers ,
8084 [ DefaultTimeoutKeyword ] = Keywords . DefaultTimeout ,
8185 [ PoolingKeyword ] = Keywords . Pooling ,
86+ [ VfsKeyword ] = Keywords . Vfs ,
8287
8388 // aliases
8489 [ FilenameKeyword ] = Keywords . DataSource ,
@@ -217,6 +222,17 @@ public bool Pooling
217222 set => base [ PoolingKeyword ] = _pooling = value ;
218223 }
219224
225+ /// <summary>
226+ /// Gets or sets the SQLite VFS used by the connection.
227+ /// </summary>
228+ /// <value>The SQLite VFS used by the connection.</value>
229+ /// <seealso href="https://www.sqlite.org/vfs.html">SQLite VFS</seealso>
230+ public string ? Vfs
231+ {
232+ get => _vfs ;
233+ set => base [ VfsKeyword ] = _vfs = value ;
234+ }
235+
220236 /// <summary>
221237 /// Gets or sets the value associated with the specified key.
222238 /// </summary>
@@ -269,6 +285,9 @@ public override object? this[string keyword]
269285 case Keywords . Pooling :
270286 Pooling = Convert . ToBoolean ( value , CultureInfo . InvariantCulture ) ;
271287 return ;
288+ case Keywords . Vfs :
289+ Vfs = Convert . ToString ( value , CultureInfo . InvariantCulture ) ; ;
290+ return ;
272291
273292 default :
274293 Debug . Fail ( "Unexpected keyword: " + keyword ) ;
@@ -458,6 +477,9 @@ private void Reset(Keywords index)
458477 case Keywords . Pooling :
459478 _pooling = true ;
460479 return ;
480+ case Keywords . Vfs :
481+ _vfs = string . Empty ;
482+ return ;
461483
462484 default :
463485 Debug . Fail ( "Unexpected keyword: " + index ) ;
0 commit comments