Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Merge master #1

Merged
merged 27 commits into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0c05cac
Added SourceID support throughout platforms (marshals to sqlite3_sour…
thornley-touchstar Apr 27, 2015
d467b26
Merge pull request #174 from kreuzhofer/master
oysteinkrog Apr 28, 2015
dd15dd4
* Fixed DLLImport reference for Win32.
thornley-touchstar May 4, 2015
bbda6b5
* Corrected DLLImport name usage (now consistently using DllName cons…
thornley-touchstar May 4, 2015
97c79c9
Adds (optional) ctor parameters from SQLiteConnection to SQLiteConnec…
May 9, 2015
d835e97
Merge pull request #179 from rheinspree/master
oysteinkrog May 13, 2015
4edaa44
Added support for OpenFlags in SQLiteConnectionString
May 7, 2015
f008229
Merge branch 'pr/177'
oysteinkrog May 13, 2015
3231d2d
Merge pull request #172 from TouchStar/master
oysteinkrog May 13, 2015
54225ca
* SourceID() is now marshalling API with PtrToStringAnsi(). The under…
thornley-touchstar May 19, 2015
e04722a
Merge pull request #180 from TouchStar/master
oysteinkrog Jun 6, 2015
b6ced91
Adds optional parameter nativeInteropSearchPath to SQLiteApiWin32() t…
Jun 9, 2015
d280b75
Added InsertOrIgnore and InsertOrIgnoreAll methods
Jul 1, 2015
d808bb9
Added InsertOrIgnoreAsync, InsertOrIgnoreAsync, and GetMappingAsync m…
Jul 1, 2015
ca30f86
InsertOrIgnoreAsync & InsertOrIgnoreAllAsync Unit Tests added
Jul 1, 2015
a93f000
InsertOrIgnore unit test added
Jul 1, 2015
e5712b4
Added Unit Test for GetMappingAsync<T>
Jul 1, 2015
a748ef4
Added OSX platform (included sqlite dylib version is 3.8.11.1 (300801…
tmarti Aug 1, 2015
27ec761
Split SQLite.Net so that other platforms can be created.
mattleibow Aug 24, 2015
762c17d
Merge pull request #208 from mattleibow/split-nuget
oysteinkrog Aug 24, 2015
a34a7a8
Merge pull request #189 from rheinspree/feature/Win32InteropPathDirec…
oysteinkrog Aug 24, 2015
584e8c5
Merge pull request #199 from tmarti/platform_osx
oysteinkrog Sep 3, 2015
371d23a
Merge pull request #193 from pkhandelwal-bluetube/master
oysteinkrog Sep 3, 2015
2ee41fa
Allow migrating a single entity #216
Sep 16, 2015
61557e0
Merge pull request #218 from molinch/mig-sig-entity3
oysteinkrog Sep 18, 2015
64f673a
Fix #222
Oct 2, 2015
6e8fd09
Merge pull request #223 from molinch/my-master
oysteinkrog Oct 15, 2015
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,376 changes: 746 additions & 630 deletions SQLite.Net.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nuget/SQLite.Net.Async.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<releaseNotes>https://github.com/oysteinkrog/SQLite.Net-PCL/commits</releaseNotes>
<tags>sqlite pcl sql database ios android windows metro winrt xamarin monotouch monodroid win32 windowsphone wp wp8 wp8.1</tags>
<dependencies>
<dependency id="SQLite.Net-PCL" version="3.0.5"/>
<dependency id="SQLite.Net.Core-PCL" version="3.0.5"/>
</dependencies>
</metadata>
<files>
Expand Down
25 changes: 25 additions & 0 deletions nuget/SQLite.Net.Core.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SQLite.Net.Core-PCL</id>
<version>3.0.5</version>
<title>SQLite.Net PCL</title>
<authors>Øystein Krog,Frank Krueger,Tim Heuer</authors>
<owners>Øystein Krog</owners>
<licenseUrl>https://raw.github.com/oysteinkrog/SQLite.Net-PCL/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/oysteinkrog/SQLite.Net-PCL</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SQLite.Net PCL is an open source, minimal library to allow .NET and Mono applications to store data in SQLite databases.
This is a fork of the original sqlite-net project, which aims to cleanup/improve the code and deliver the package as PCL assemblies with some additional platform-specific implementations.
This package is compatible with the following .net platforms: Xamarin.iOS (Classic), Xamarin.iOS (Unified), Xamarin.Android, Windows Phone 8.1, Windows Phone 8.0, Windows 8.1, Windows 8.0, Win32, Generic, PCL(net4+sl4+wp7+win8+monotouch+MonoAndroid)</description>
<summary>A .NET client library to access SQLite embedded database files in a LINQ manner.</summary>
<releaseNotes>https://github.com/oysteinkrog/SQLite.Net-PCL/commits</releaseNotes>
<tags>sqlite pcl sql database ios android windows metro winrt xamarin monotouch monodroid win32 windowsphone wp wp8 wp8.1</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<!-- PCL -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll" />
</files>
</package>
14 changes: 4 additions & 10 deletions nuget/SQLite.Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,40 @@
<group targetFramework="wp8">
<dependency id="sqlite-net-wp8" version="3.8.5"/>
</group>
<group>
<dependency id="SQLite.Net.Core-PCL" version="3.0.5"/>
</group>
</dependencies>
</metadata>
<files>
<!-- Xamarin.iOS (Classic)-->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\monotouch\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.XamarinIOS\SQLite.Net.Platform.XamarinIOS.dll" target="lib\monotouch\SQLite.Net.Platform.XamarinIOS.dll" />

<!-- Xamarin.iOS (Unified)-->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\Xamarin.iOS10\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.XamarinIOS.Unified\SQLite.Net.Platform.XamarinIOS.Unified.dll" target="lib\Xamarin.iOS10\SQLite.Net.Platform.XamarinIOS.Unified.dll" />

<!-- Xamarin.Android -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\MonoAndroid\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.XamarinAndroid\SQLite.Net.Platform.XamarinAndroid.dll" target="lib\MonoAndroid\SQLite.Net.Platform.XamarinAndroid.dll" />

<!-- Windows Phone & Windows 8.1 -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\portable-win81+wpa81\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.WinRT\SQLite.Net.Platform.WinRT.dll" target="lib\portable-win81+wpa81\SQLite.Net.Platform.WinRT.dll" />

<!-- Windows 8.0 -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\Windows8\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.WinRT\SQLite.Net.Platform.WinRT.dll" target="lib\Windows8\SQLite.Net.Platform.WinRT.dll" />

<!-- Windows Phone 8.0 (ARM) -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\windowsphone8\ARM\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.WindowsPhone8\ARM\SQLite.Net.Platform.WindowsPhone8.dll" target="lib\windowsphone8\ARM\SQLite.Net.Platform.WindowsPhone8.dll" />

<!-- Windows Phone 8.0 (x86) -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\windowsphone8\x86\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.WindowsPhone8\x86\SQLite.Net.Platform.WindowsPhone8.dll" target="lib\windowsphone8\x86\SQLite.Net.Platform.WindowsPhone8.dll" />

<!-- Win32 -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\net4\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.Win32\SQLite.Net.Platform.Win32.dll" target="lib\net4\SQLite.Net.Platform.Win32.dll" />

<!-- Generic -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\net40\SQLite.Net.dll" />
<file src="SQLite.Net.Platform.Generic\SQLite.Net.Platform.Generic.dll" target="lib\net40\SQLite.Net.Platform.Generic.dll"/>

<!-- PCL -->
<file src="SQLite.Net\SQLite.Net.dll" target="lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll" />
<file src="SQLite.Net\_._" target="lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\_._" />
</files>
</package>
1 change: 1 addition & 0 deletions nuget/build.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@mkdir output
..\.nuget\nuget pack SQLite.Net.Core.nuspec -o output
..\.nuget\nuget pack SQLite.Net.nuspec -o output
..\.nuget\nuget pack SQLite.Net.Async.nuspec -o output
1 change: 1 addition & 0 deletions nuget/prepare.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mkdir SQLite.Net
copy /y ..\src\SQLite.Net\bin\Release\SQLite.Net.dll SQLite.Net
type nul >SQLite.Net\_._

mkdir SQLite.Net.Async
copy /y ..\src\SQLite.Net.Async\bin\Release\SQLite.Net.Async.dll SQLite.Net.Async
Expand Down
1 change: 1 addition & 0 deletions nuget/upload.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
..\.nuget\nuget push output\SQLite.Net.Core-PCL.3.0.5.nupkg
..\.nuget\nuget push output\SQLite.Net-PCL.3.0.5.nupkg
..\.nuget\nuget push output\SQLite.Net.Async-PCL.3.0.5.nupkg
37 changes: 37 additions & 0 deletions src/SQLite.Net.Async/SQLiteAsyncConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,32 @@ public Task<CreateTablesResult> CreateTablesAsync([NotNull] params Type[] types)
}
}, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
}

[PublicAPI]
public Task<int> InsertOrIgnoreAsync (object item)
{
return Task.Factory.StartNew (() => {
SQLiteConnectionWithLock conn = GetConnection ();
using (conn.Lock ()) {
return conn.InsertOrIgnore (item);
}
});
}

[PublicAPI]
public Task<int> InsertOrIgnoreAllAsync (IEnumerable objects, CancellationToken cancellationToken = default (CancellationToken))
{
if (objects == null) {
throw new ArgumentNullException ("objects");
}

return Task.Factory.StartNew (() => {
SQLiteConnectionWithLock conn = GetConnection ();
using (conn.Lock ()) {
return conn.InsertOrIgnoreAll (objects);
}
}, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
}

[PublicAPI]
public Task<int> InsertOrReplaceAsync([NotNull] object item, CancellationToken cancellationToken = default (CancellationToken))
Expand Down Expand Up @@ -551,5 +577,16 @@ public Task<List<T>> QueryAsync<T>(CancellationToken cancellationToken, [NotNull
}
}, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
}

[PublicAPI]
public Task<TableMapping> GetMappingAsync<T> ()
{
return Task.Factory.StartNew (() => {
SQLiteConnectionWithLock conn = GetConnection ();
using (conn.Lock ()) {
return conn.GetMapping (typeof(T));
}
}, CancellationToken.None, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default);
}
}
}
5 changes: 5 additions & 0 deletions src/SQLite.Net.Platform.Generic/SQLiteApiGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public int LibVersionNumber()
return SQLiteApiGenericInternal.sqlite3_libversion_number();
}

public string SourceID()
{
return Marshal.PtrToStringAnsi(SQLiteApiGenericInternal.sqlite3_sourceid());
}

public Result EnableLoadExtension(IDbHandle db, int onoff)
{
var internalDbHandle = (DbHandle) db;
Expand Down
3 changes: 3 additions & 0 deletions src/SQLite.Net.Platform.Generic/SQLiteApiGenericInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ public static extern Result sqlite3_prepare_v2(IntPtr db,
[DllImport("sqlite3", EntryPoint = "sqlite3_libversion_number", CallingConvention = CallingConvention.Cdecl)]
public static extern int sqlite3_libversion_number();

[DllImport("sqlite3", EntryPoint = "sqlite3_sourceid", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr sqlite3_sourceid();

#region Backup

[DllImport("sqlite3", EntryPoint = "sqlite3_backup_init", CallingConvention = CallingConvention.Cdecl)]
Expand Down
25 changes: 25 additions & 0 deletions src/SQLite.Net.Platform.OSX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("SQLite.Net.Platform.OSX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Øystein Krog")]
[assembly: AssemblyProduct("SQLite.Net.Platform.OSX")]
[assembly: AssemblyCopyright("Copyright © Øystein Krog")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("4f906778-2564-403a-81d7-1b8ba8c2cee6")]
31 changes: 31 additions & 0 deletions src/SQLite.Net.Platform.OSX/ReflectionServiceOSX.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
using SQLite.Net.Interop;

namespace SQLite.Net.Platform.OSX
{
public class ReflectionServiceOSX : IReflectionService
{
public IEnumerable<PropertyInfo> GetPublicInstanceProperties(Type mappedType)
{
return mappedType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty);
}

public object GetMemberValue(object obj, Expression expr, MemberInfo member)
{
if (member.MemberType == MemberTypes.Property)
{
var m = (PropertyInfo) member;
return m.GetValue(obj, null);
}
if (member.MemberType == MemberTypes.Field)
{
var m = (FieldInfo) member;
return m.GetValue(obj);
}
throw new NotSupportedException("MemberExpr: " + member.MemberType);
}
}
}
84 changes: 84 additions & 0 deletions src/SQLite.Net.Platform.OSX/SQLite.Net.Platform.OSX.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{03799AD1-9FCF-48CB-8E6E-B233DF583B11}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SQLite.Net.Platform.OSX</RootNamespace>
<AssemblyName>SQLite.Net.Platform.OSX</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReflectionServiceOSX.cs" />
<Compile Include="SQLiteApiOSX.cs" />
<Compile Include="SQLiteApiOSXInternal.cs" />
<Compile Include="SQLitePlatformOSX.cs" />
<Compile Include="StopwatchFactoryOSX.cs" />
<Compile Include="VolatileServiceOSX.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<Folder Include="i386\" />
<Folder Include="x86_64\" />
</ItemGroup>
<ItemGroup>
<None Include="i386\libsqlite3_for_net.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="x86_64\libsqlite3_for_net.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SQLite.Net.Platform.OSX.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SQLite.Net\SQLite.Net.csproj">
<Project>{4971D437-0694-4297-A8CC-146CE08C3BD9}</Project>
<Name>SQLite.Net</Name>
</ProjectReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<configuration>
<dllmap dll="libsqlite3_for_net" wordsize="32" target="i386/libsqlite3_for_net.dylib"/>
<dllmap dll="libsqlite3_for_net" wordsize="64" target="x86_64/libsqlite3_for_net.dylib"/>
</configuration>
Loading