Skip to content
Open
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
22 changes: 12 additions & 10 deletions src/Simple.Data.Sqlite/Simple.Data.Sqlite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>Simple.Data.Sqlite</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -40,8 +42,8 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.91.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Reference Include="System.Data.SQLite, Version=1.0.105.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.105.2\lib\net40\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand All @@ -58,6 +60,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqliteConnectionProvider.cs" />
<Compile Include="SqliteConnectionStringConnectionProvider.cs" />
<Compile Include="SqliteInMemoryDbCommand.cs" />
<Compile Include="SqliteInMemoryDbConnection.cs" />
<Compile Include="SqliteQueryPager.cs" />
<Compile Include="SqliteSchemaProvider.cs" />
Expand All @@ -67,15 +70,14 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="x86\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- 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">
Expand Down
95 changes: 95 additions & 0 deletions src/Simple.Data.Sqlite/SqliteInMemoryDbCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using System.Data;

namespace Simple.Data.Sqlite
{
public class SqliteInMemoryDbCommand : IDbCommand
{
private readonly IDbCommand innerCommand;

public SqliteInMemoryDbCommand(IDbCommand innerCommand)
{
this.innerCommand = innerCommand;
}

public void Dispose()
{
innerCommand.Dispose();
}

public void Prepare()
{
innerCommand.Prepare();
}

public void Cancel()
{
innerCommand.Cancel();
}

public IDbDataParameter CreateParameter()
{
return innerCommand.CreateParameter();
}

public int ExecuteNonQuery()
{
return innerCommand.ExecuteNonQuery();
}

public IDataReader ExecuteReader()
{
return innerCommand.ExecuteReader();
}

public IDataReader ExecuteReader(CommandBehavior behavior)
{
return innerCommand.ExecuteReader(behavior);
}

public object ExecuteScalar()
{
return innerCommand.ExecuteScalar();
}

public IDbConnection Connection
{
get { return innerCommand.Connection; }
set { innerCommand.Connection = value; }
}

public IDbTransaction Transaction
{
get { return innerCommand.Transaction; }
set { innerCommand.Transaction = value; }
}

public string CommandText
{
get { return innerCommand.CommandText; }
set { innerCommand.CommandText = value; }
}

public int CommandTimeout
{
get { return innerCommand.CommandTimeout; }
set { innerCommand.CommandTimeout = value; }
}

public CommandType CommandType
{
get { return innerCommand.CommandType; }
set { innerCommand.CommandType = value; }
}

public IDataParameterCollection Parameters
{
get { return innerCommand.Parameters; }
}

public UpdateRowSource UpdatedRowSource
{
get { return innerCommand.UpdatedRowSource; }
set { innerCommand.UpdatedRowSource = value; }
}
}
}
4 changes: 4 additions & 0 deletions src/Simple.Data.Sqlite/SqliteInMemoryDbConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ public void Destroy()
DelegatedConnection.Close();
}

public override IDbCommand CreateCommand()
{
return new SqliteInMemoryDbCommand(base.CreateCommand());
}
}
}
2 changes: 1 addition & 1 deletion src/Simple.Data.Sqlite/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Simple.Data.Ado" version="0.18.3.1" targetFramework="net40" />
<package id="Simple.Data.Core" version="0.18.3.1" targetFramework="net40" />
<package id="System.Data.SQLite.Core" version="1.0.91.0" targetFramework="net40" />
<package id="System.Data.SQLite.Core" version="1.0.105.2" targetFramework="net40" />
</packages>
Binary file removed src/Simple.Data.Sqlite/x64/SQLite.Interop.dll
Binary file not shown.
Binary file removed src/Simple.Data.Sqlite/x86/SQLite.Interop.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Simple.Data.SqliteTests/InMemoryUsageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void CanCreateInMemoryDatabase()
Assert.Pass();
}

[Test, Ignore("sqlite bug")]
[Test]
public void CanQueryInMemoryDatabase()
{
var employees = db.Employees.All();
Expand Down
19 changes: 11 additions & 8 deletions src/Simple.Data.SqliteTests/Simple.Data.SqliteTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>Simple.Data.SqliteTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -51,8 +53,8 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.91.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Reference Include="System.Data.SQLite, Version=1.0.105.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.105.2\lib\net40\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down Expand Up @@ -92,12 +94,6 @@
<Link>Northwind.db</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="x86\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
Expand All @@ -112,6 +108,13 @@
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- 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">
Expand Down
2 changes: 1 addition & 1 deletion src/Simple.Data.SqliteTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<package id="Simple.Data.Ado" version="0.18.3.1" targetFramework="net40" />
<package id="Simple.Data.Core" version="0.18.3.1" targetFramework="net40" />
<package id="Simple.Data.Mocking" version="0.18.3.1" targetFramework="net40" />
<package id="System.Data.SQLite.Core" version="1.0.91.0" targetFramework="net40" />
<package id="System.Data.SQLite.Core" version="1.0.105.2" targetFramework="net40" />
</packages>
Binary file removed src/Simple.Data.SqliteTests/x64/SQLite.Interop.dll
Binary file not shown.
Binary file removed src/Simple.Data.SqliteTests/x86/SQLite.Interop.dll
Binary file not shown.