Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Deterministic>true</Deterministic>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SQLitePCLRawVersion>3.0.1</SQLitePCLRawVersion>
</PropertyGroup>
<ItemGroup>
<None Include="..\Logo-low.png" Pack="true" PackagePath=""/>
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ PACKAGES_OUT=$(abspath PackagesOut)

all: nuget

nuget: pclnuget basenuget sqlciphernuget staticnuget
nuget: pclnuget basenuget staticnuget

pclnuget: nuget/SQLite-net-std/SQLite-net-std.csproj $(SRC)
dotnet pack -c Release -o $(PACKAGES_OUT) $<

basenuget: nuget/SQLite-net-base/SQLite-net-base.csproj $(SRC)
dotnet pack -c Release -o $(PACKAGES_OUT) $<

sqlciphernuget: nuget/SQLite-net-sqlcipher/SQLite-net-sqlcipher.csproj $(SRC)
dotnet pack -c Release -o $(PACKAGES_OUT) $<

staticnuget: nuget/SQLite-net-static/SQLite-net-static.csproj $(SRC)
dotnet pack -c Release -o $(PACKAGES_OUT) $<

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Use one of these packages:
| Version | Package | Description |
| ------- | ------- | ----------- |
| [![NuGet Package](https://img.shields.io/nuget/v/sqlite-net-pcl.svg)](https://www.nuget.org/packages/sqlite-net-pcl) | [sqlite-net-pcl](https://www.nuget.org/packages/sqlite-net-pcl) | .NET Standard Library |
| [![NuGet Package with Encryption](https://img.shields.io/nuget/v/sqlite-net-sqlcipher.svg)](https://www.nuget.org/packages/sqlite-net-sqlcipher) | [sqlite-net-sqlcipher](https://www.nuget.org/packages/sqlite-net-sqlcipher) | With Encryption Support |
| [![NuGet Package using P/Invoke](https://img.shields.io/nuget/v/sqlite-net-static.svg)](https://www.nuget.org/packages/sqlite-net-static) | [sqlite-net-static](https://www.nuget.org/packages/sqlite-net-static) | Special version that uses P/Invokes to platform-provided sqlite3 |
| [![NuGet Package without a SQLitePCLRaw bundle](https://img.shields.io/nuget/v/sqlite-net-base.svg)](https://www.nuget.org/packages/sqlite-net-base) | [sqlite-net-base](https://www.nuget.org/packages/sqlite-net-base) | without a SQLitePCLRaw bundle so you can choose your own provider |

Expand Down Expand Up @@ -204,9 +203,9 @@ db.Execute ("insert into Stock(Symbol) values (?)", "MSFT");
var stocks = db.Query<Stock> ("select * from Stock");
```

## Using SQLCipher
## Using encryption

You can use an encrypted database by using the [sqlite-net-sqlcipher NuGet package](https://www.nuget.org/packages/sqlite-net-sqlcipher).
If you are using a native SQLite instance which supports encryption:

The database key is set in the `SqliteConnectionString` passed to the connection constructor:

Expand Down
14 changes: 0 additions & 14 deletions SQLite.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDiff", "tests\ApiDiff\Ap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-base", "nuget\SQLite-net-base\SQLite-net-base.csproj", "{53D1953C-3641-47D0-BE08-14DB853CC576}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-static", "nuget\SQLite-net-static\SQLite-net-static.csproj", "{7CD60DAE-D505-4C2E-80B3-296556CE711E}"
Expand Down Expand Up @@ -67,18 +65,6 @@ Global
{53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.Build.0 = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.Build.0 = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.ActiveCfg = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.Build.0 = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion nuget/SQLite-net-base/SQLite-net-base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.2" />
<PackageReference Include="SQLitePCLRaw.core" Version="$(SQLitePCLRawVersion)" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\src\SQLite.cs">
Expand Down
38 changes: 0 additions & 38 deletions nuget/SQLite-net-sqlcipher/SQLite-net-sqlcipher.csproj

This file was deleted.

32 changes: 30 additions & 2 deletions nuget/SQLite-net-std/SQLite-net-std.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0;net8.0-ios</TargetFrameworks>
<AssemblyName>SQLite-net</AssemblyName>
<PackageId>sqlite-net-pcl</PackageId>
<AssemblyTitle>SQLite-net Official .NET Standard Library</AssemblyTitle>
Expand All @@ -10,6 +10,7 @@
This version uses SQLitePCLRaw to provide platform independent versions of SQLite.
</Description>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
<IsIOS>$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-ios'))</IsIOS>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand All @@ -22,8 +23,35 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.2" />
<PackageReference Include="SQLitePCLRaw.core" Version="$(SQLitePCLRawVersion)" />
</ItemGroup>

<!--
The following items use the IsIOS property to configure things such that we
use the system-provided SQLite library on iOS, and
use e_sqlite3 everywhere else.

Previously, this was implemented by depending on SQLitePCLRaw.bundle_green,
but that bundle package was deprecated in SQLitePCLRaw 3.0.
-->

<ItemGroup Condition="$(IsIOS)">
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="$(SQLitePCLRawVersion)" />
</ItemGroup>

<ItemGroup Condition="!$(IsIOS)">
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="$(SQLitePCLRawVersion)" />
<PackageReference Include="SourceGear.sqlite3" Version="3.50.3" />
</ItemGroup>

<PropertyGroup Condition="$(IsIOS)">
<DefineConstants>$(DefineConstants);PROVIDER_sqlite3</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="!$(IsIOS)">
<DefineConstants>$(DefineConstants);PROVIDER_e_sqlite3</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\src\SQLite.cs">
<Link>SQLite.cs</Link>
Expand Down
20 changes: 20 additions & 0 deletions nuget/SQLite-net-std/batteries_v2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

using System;

namespace SQLitePCL
{
internal static class Batteries_V2
{
public static void Init()
{
#if PROVIDER_sqlite3
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
#elif PROVIDER_e_sqlite3
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_e_sqlite3());
#else
#error batteries_v2.cs built with nothing specified
#endif
}
}
}

Loading