Search notes:

System.Data.SQLite (namespace)

PowerShell example

Creating a simple table …
add-type -path '.\System.Data.SQLite.dll'

$sqlite = new-object -typeName System.Data.SQLite.SQLiteConnection
$sqlite.ConnectionString = "Data Source=""$pwd\test.db"""
$sqlite.Open()

$sql = $sqlite.CreateCommand()
$sql.CommandText = 'create table tab (col_1, col_2, col_3)'
$null = $sql.ExecuteNonQuery()

$sql.Dispose()
$sqlite.Close()
Github repository .NET-API, path: /System/Data/SQLite/create-table.ps1
… then inserting some values …
$sqlite = new-object -typeName System.Data.SQLite.SQLiteConnection
$sqlite.ConnectionString = "Data Source=""$pwd\test.db"""
$sqlite.Open()

$cmd = $sqlite.CreateCommand()
$cmd.CommandText = "INSERT INTO tab (col_1, col_2, col_3) values(@A, @B, @C)";

$null = $cmd.Parameters.AddWithValue("@A",     42);
$null = $cmd.Parameters.AddWithValue("@B", 'Hello');
$null = $cmd.Parameters.AddWithValue("@C", 'World');
$null = $cmd.ExecuteNonQuery()

$null = $cmd.Parameters.AddWithValue("@A",     99);
$null = $cmd.Parameters.AddWithValue("@B", 'ninty');
$null = $cmd.Parameters.AddWithValue("@C", 'nine');
$null = $cmd.ExecuteNonQuery()

$cmd.Dispose()
$SQLite.Close()
Github repository .NET-API, path: /System/Data/SQLite/insert-data.ps1
… and finally selecting these values again.
add-type -path '.\System.Data.SQLite.dll'

$sqlite = new-object -typeName System.Data.SQLite.SQLiteConnection
$sqlite.ConnectionString = "Data Source=""$pwd\test.db"""
$sqlite.Open()

$sql = $sqlite.CreateCommand()
$sql.CommandText = 'select * from tab'

$adapter = New-Object -TypeName System.Data.SQLite.SQLiteDataAdapter $sql
$data = New-Object System.Data.DataSet
$null = $adapter.Fill($data)

foreach ($datarow in $data.Tables.rows) {
   write-host "$($datarow.col_1) $($datarow.col_2) $($datarow.col_3)"
}

$sql.Dispose()
$SQLite.Close()
Github repository .NET-API, path: /System/Data/SQLite/select-data.ps1

See also

This project is an attempt to access winsqlite3.dll with nothing but P/Invoke

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758198687, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/Data/SQLite/index(98): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78