FarNet.SQLite 0.4.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package FarNet.SQLite --version 0.4.0                
NuGet\Install-Package FarNet.SQLite -Version 0.4.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FarNet.SQLite" Version="0.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FarNet.SQLite --version 0.4.0                
#r "nuget: FarNet.SQLite, 0.4.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FarNet.SQLite as a Cake Addin
#addin nuget:?package=FarNet.SQLite&version=0.4.0

// Install FarNet.SQLite as a Cake Tool
#tool nuget:?package=FarNet.SQLite&version=0.4.0                

FarNet.SQLite

System.Data.SQLite package for FarNet and PowerShell.

Package

The package is designed for FarNet. To install FarNet and FarNet.SQLite, follow these steps.

The NuGet package FarNet.SQLite is installed to %FARHOME%\FarNet\Lib\FarNet.SQLite.

Included assets:

  • System.Data.SQLite.dll

    The original .NET API from the SQLite team.

  • FarNet.SQLite.dll

    Helper methods to simplify typical tasks routine coding.
    They are designed for C# and F# and used in PowerShell.

  • FarNet.SQLite.psd1, ...

    The PowerShell module with FarNet.SQLite.dll helpers.
    Consider using the module in scripts, this way is much easier.

  • FarNet.SQLite.ini

    The configuration file for F# scripts (FarNet.FSharpFar).

Sample scripts

PowerShell module

The installed package includes the PowerShell module. Its cmdlets make work with FarNet.SQLite in PowerShell easier, especially in interactive sessions.

The module may be used right out of the box, i.e. imported as:

Import-Module $env:FARHOME\FarNet\Lib\FarNet.SQLite

But it is better to install this module in PowerShell, so that you can:

Import-Module FarNet.SQLite

This is not just about the shorter command:

  • For scripts outside Far Manager, this way does not need the variable FARHOME defined.
  • In many cases you do not need to import the module, PowerShell discovers module commands.

Install the module

Use the steps below to "install" the module as a symbolic link or junction.

(1) Choose one of the module directories, see $env:PSModulePath. For example:

  • C:\Program Files\WindowsPowerShell\Modules

    This folder is used by PowerShell Core and Windows PowerShell. If you have rights, this is the recommended location.

  • C:\Users\<user>\Documents\PowerShell\Modules

    This folder is used by PowerShell Core.

  • C:\Users\<user>\Documents\WindowsPowerShell\Modules

    This folder is used by Windows PowerShell.

(2) Change to the selected directory, and create the symbolic link FarNet.SQLite to the original FarNet.SQLite folder:

New-Item -Path FarNet.SQLite -ItemType SymbolicLink -Value $env:FARHOME\FarNet\Lib\FarNet.SQLite

Ensure you have the environment variable FARHOME defined or adjust the above command.

Alternatively, you may manually create the similar folder junction point in Far Manager using AltF6.

Now you have the PowerShell module installed. You may update the FarNet package as usual. The symbolic link or junction do not have to be updated, they point to the same location.

Explore commands

# import the module
Import-Module FarNet.SQLite

# get its commands
Get-Command -Module FarNet.SQLite

# see command help
help Open-SQLite

Typical scripts

Reading data

Import-Module FarNet.SQLite
Open-SQLite db.sqlite -ReadOnly
try {
    # work with Get-SQLite
    ...
}
finally {
    Close-SQLite
}

Writing data

Import-Module FarNet.SQLite
Open-SQLite db.sqlite -Transaction
try {
    # work with Get-SQLite and Set-SQLite
    ...
    # commit work
    Complete-SQLite
}
finally {
    Close-SQLite
}

See also

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.0 359 12/27/2023
0.4.3 137 12/23/2023
0.4.2 556 1/1/2023
0.4.1 330 12/19/2022
0.4.0 289 12/16/2022
0.3.2 302 12/15/2022
0.3.1 293 12/11/2022
0.3.0 304 12/8/2022
0.2.0 346 12/5/2022
0.1.0 318 12/3/2022
0.0.2 313 11/29/2022
0.0.1 352 11/27/2022