Skip to content

Commit

Permalink
Added support for enabling SQLite extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
NimaAra committed Jul 7, 2019
1 parent f8ca41b commit 7fa7b9c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Easy.Storage.SQLite/Connections/SqliteConnectionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,28 @@ public void BindFunction(SQLiteFunctionBase function)
Connection.BindFunction(funcAttr, function);
}

/// <summary>
/// Enables <c>Full Text Search</c> support.
/// </summary>
public void EnableFTS5() => LoadExtension("SQLite.Interop.dll", "sqlite3_fts5_init");

/// <summary>
/// Enables <c>JSON</c> support.
/// </summary>
public void EnableJSON() => LoadExtension("SQLite.Interop.dll", "sqlite3_json_init");

/// <summary>
/// Loads a SQLite extension library from the named dynamic link library file.
/// </summary>
/// <param name="fileName">
/// The name of the dynamic link library file containing the extension.
/// </param>
/// <param name="procName">
/// The name of the exported function used to initialize the extension.
/// If null, the default <c>sqlite3_extension_init</c> will be used.
/// </param>
public void LoadExtension(string fileName, string procName) => Connection.LoadExtension(fileName, procName);

/// <summary>
/// Disposes and finalizes the connection, if applicable.
/// </summary>
Expand Down

0 comments on commit 7fa7b9c

Please sign in to comment.