Skip to content

Commit 1ad1f69

Browse files
committed
Merge branch 'master' of https://github.com/oysteinkrog/SQLite.Net-PCL into feature-composite-primary-keys
2 parents b7a5571 + d467b26 commit 1ad1f69

18 files changed

+1137
-86
lines changed

README.mdown

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ This project uses semantic versioning.
1515
# API Changes
1616

1717
As part of the cleanup there are now some API changes.
18-
1918
For the most part I hope these are self-explanatory, but here is a non-exhaustive list of changes.
2019

2120
## SQLiteConnection
2221
You now have to pass in an implementation of ISQlitePlatform in the SQLiteConnectionWithLock and SQLiteConnection constructors.
22+
The correct platform implementation is automatically added to the project.
2323

24-
I provide ready-made implementations of this class, please use one of these [nugets](https://www.nuget.org/profiles/oystein.krog/).
25-
26-
At the moment these platforms have nugets available:
24+
At the moment these platforms are supported:
2725
- Win32 (bundles sqlite binaries for windows, works on both x86 and x64 automatically) (very well tested)
2826
- XamarinIOS and XamarinIOS.Unified
2927
- XamarinAndroid
@@ -32,7 +30,7 @@ At the moment these platforms have nugets available:
3230
- Generic (net4 project without any sqlite3 binaries, requires sqlite installed in the OS) (contributed by James Ottaway)
3331

3432
Note:
35-
To use the WP8/WinRT platform you must install the "SQLite for Windows Phone"/"SQLite for Windows" VSIX extension.
33+
To use the WP8.1/WinRT platform you must install the "SQLite for Windows Phone"/"SQLite for Windows" VSIX extension.
3634
Then, in the project, add a reference to the extension (in the Extensions section of the Add Reference dialog)
3735
If you have problems with signed apps take a look here: https://github.com/oysteinkrog/SQLite.Net-PCL/issues/25
3836

@@ -46,6 +44,12 @@ new SQLiteAsyncConnection(()=>_sqliteConnectionWithLock);
4644
Please be aware that the Task.Run pattern used in SQLiteAsyncConnection can be considered an anti-pattern (libraries should not provide async methods unless they are truly async).
4745
This class is maintained for backwards compatability and for use-cases where async-isolation is handy.
4846

47+
## DateTime serialization
48+
49+
DateTime serialization is changed, in order to be consistent.
50+
When using the storeDateTimeAsTicks option, the DateTime is now serialized as Utc, and the returned DateTime is also in Utc.
51+
You can get the local time by using dateTime.ToLocalTime()
52+
4953
# SQLite.Net
5054

5155
SQLite.Net is an open source, minimal library to allow .NET and Mono applications to store data in [http://www.sqlite.org SQLite 3 databases]. It is written in C# and is meant to be simply compiled in with your projects. It was first designed to work with [MonoTouch](http://xamarin.com) on the iPhone, but has grown up to work on all the platforms (Mono for Android, .NET, Silverlight, WP7, WinRT, Azure, etc.).

nuget/SQLite.Net.Async.nuspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>SQLite.Net.Async-PCL</id>
5-
<version>3.0.4-beta</version>
5+
<version>3.0.5</version>
66
<title>SQLite.Net.Async PCL</title>
77
<authors>Øystein Krog,Frank Krueger,Tim Heuer</authors>
88
<owners>Øystein Krog</owners>
@@ -17,8 +17,7 @@
1717
<releaseNotes>https://github.com/oysteinkrog/SQLite.Net-PCL/commits</releaseNotes>
1818
<tags>sqlite pcl sql database ios android windows metro winrt xamarin monotouch monodroid win32 windowsphone wp wp8 wp8.1</tags>
1919
<dependencies>
20-
<dependency id="SQLite.Net-PCL" version="3.0.4-beta"/>
21-
<dependency id="JetBrains.Annotations" version="9.1.1"/>
20+
<dependency id="SQLite.Net-PCL" version="3.0.5"/>
2221
</dependencies>
2322
</metadata>
2423
<files>

nuget/SQLite.Net.nuspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>SQLite.Net-PCL</id>
5-
<version>3.0.4-beta</version>
5+
<version>3.0.5</version>
66
<title>SQLite.Net PCL</title>
77
<authors>Øystein Krog,Frank Krueger,Tim Heuer</authors>
88
<owners>Øystein Krog</owners>
@@ -16,7 +16,9 @@
1616
<releaseNotes>https://github.com/oysteinkrog/SQLite.Net-PCL/commits</releaseNotes>
1717
<tags>sqlite pcl sql database ios android windows metro winrt xamarin monotouch monodroid win32 windowsphone wp wp8 wp8.1</tags>
1818
<dependencies>
19-
<dependency id="JetBrains.Annotations" version="9.1.1"/>
19+
<group targetFramework="wp8">
20+
<dependency id="sqlite-net-wp8" version="3.8.5"/>
21+
</group>
2022
</dependencies>
2123
</metadata>
2224
<files>

nuget/upload.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
..\.nuget\nuget push output\SQLite.Net-PCL.3.0.4-beta.nupkg
2-
..\.nuget\nuget push output\SQLite.Net.Async-PCL.3.0.4-beta.nupkg
1+
..\.nuget\nuget push output\SQLite.Net-PCL.3.0.5.nupkg
2+
..\.nuget\nuget push output\SQLite.Net.Async-PCL.3.0.5.nupkg

src/GlobalAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// by using the '*' as shown below:
1212
// [assembly: AssemblyVersion("1.0.*")]
1313

14-
[assembly: AssemblyVersion("3.0.2.0")]
15-
[assembly: AssemblyFileVersion("3.0.2.0")]
14+
[assembly: AssemblyVersion("3.0.5.0")]
15+
[assembly: AssemblyFileVersion("3.0.5.0")]

src/SQLite.Net.Async/SQLite.Net.Async.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
<WarningLevel>4</WarningLevel>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="JetBrains.Annotations.PCL328">
44-
<HintPath>..\..\packages\JetBrains.Annotations.8.0.5.0\lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\JetBrains.Annotations.PCL328.dll</HintPath>
45-
</Reference>
4643
<Reference Include="System" />
4744
<Reference Include="System.Core" />
4845
<Reference Include="System.Xml" />
@@ -61,9 +58,6 @@
6158
<Name>SQLite.Net</Name>
6259
</ProjectReference>
6360
</ItemGroup>
64-
<ItemGroup>
65-
<None Include="packages.config" />
66-
</ItemGroup>
6761
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
6862
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
6963
Other similar extension points exist, see Microsoft.Common.targets.
@@ -72,4 +66,4 @@
7266
<Target Name="AfterBuild">
7367
</Target>
7468
-->
75-
</Project>
69+
</Project>

src/SQLite.Net.Async/SQLiteAsyncConnection.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,19 @@ public Task<CreateTablesResult> CreateTablesAsync([NotNull] params Type[] types)
141141
[PublicAPI]
142142
public Task<int> DropTableAsync<T>(CancellationToken cancellationToken = default (CancellationToken))
143143
where T : class
144+
{
145+
return DropTableAsync(typeof (T), cancellationToken);
146+
}
147+
148+
[PublicAPI]
149+
public Task<int> DropTableAsync(Type t, CancellationToken cancellationToken = default (CancellationToken))
144150
{
145151
return Task.Factory.StartNew(() =>
146152
{
147153
var conn = GetConnection();
148154
using (conn.Lock())
149155
{
150-
return conn.DropTable<T>();
156+
return conn.DropTable(t);
151157
}
152158
}, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
153159
}
@@ -222,13 +228,19 @@ public Task<CreateTablesResult> CreateTablesAsync([NotNull] params Type[] types)
222228

223229
[PublicAPI]
224230
public Task<int> DeleteAllAsync<T>(CancellationToken cancellationToken = default (CancellationToken))
231+
{
232+
return DeleteAllAsync(typeof(T), cancellationToken);
233+
}
234+
235+
[PublicAPI]
236+
public Task<int> DeleteAllAsync(Type t, CancellationToken cancellationToken = default (CancellationToken))
225237
{
226238
return Task.Factory.StartNew(() =>
227239
{
228240
var conn = GetConnection();
229241
using (conn.Lock())
230242
{
231-
return conn.DeleteAll<T>();
243+
return conn.DeleteAll(t);
232244
}
233245
}, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
234246
}

src/SQLite.Net.Async/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/SQLite.Net.Platform.WindowsPhone8/SQLite.Net.Platform.WindowsPhone8.csproj

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.props" Condition="Exists('..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.props')" />
34
<PropertyGroup>
45
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
56
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -20,6 +21,7 @@
2021
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
2122
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
2223
<RestorePackages>true</RestorePackages>
24+
<NuGetPackageImportStamp>568df22d</NuGetPackageImportStamp>
2325
</PropertyGroup>
2426
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2527
<DebugSymbols>true</DebugSymbols>
@@ -100,15 +102,28 @@
100102
<Project>{ABF3D656-3D1C-45D1-B6FD-41B088E5A533}</Project>
101103
<Name>SQLite.Net</Name>
102104
</ProjectReference>
103-
<Reference Include="Sqlite">
104-
<HintPath>..\..\packages\sqlite-net-wp8.3.8.3\lib\windowsphone8\Sqlite.winmd</HintPath>
105+
</ItemGroup>
106+
<ItemGroup>
107+
<Reference Include="Sqlite, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
108+
<HintPath>..\..\packages\sqlite-net-wp8.3.8.5\lib\windowsphone8\Sqlite.winmd</HintPath>
109+
<Private>True</Private>
105110
</Reference>
106111
</ItemGroup>
112+
<ItemGroup>
113+
<None Include="packages.config" />
114+
</ItemGroup>
107115
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
108116
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
109117
<ProjectExtensions />
110118
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
111-
<Import Project="..\..\packages\sqlite-net-wp8.3.8.3\build\windowsphone8\sqlite-net-wp8.targets" Condition="Exists('..\..\packages\sqlite-net-wp8.3.8.3\build\windowsphone8\sqlite-net-wp8.targets')" />
119+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
120+
<PropertyGroup>
121+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
122+
</PropertyGroup>
123+
<Error Condition="!Exists('..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.props'))" />
124+
<Error Condition="!Exists('..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.targets'))" />
125+
</Target>
126+
<Import Project="..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.targets" Condition="Exists('..\..\packages\sqlite-net-wp8.3.8.5\build\windowsphone8\sqlite-net-wp8.targets')" />
112127
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
113128
Other similar extension points exist, see Microsoft.Common.targets.
114129
<Target Name="BeforeBuild">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="sqlite-net-wp8" version="3.8.3" targetFramework="wp80" />
3+
<package id="sqlite-net-wp8" version="3.8.5" targetFramework="wp8" userInstalled="true" />
44
</packages>

0 commit comments

Comments
 (0)