Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #245 Drop SqlCE support.

  • Loading branch information...
commit d68a0b386bd9518efaf882dac1e7387ebcedf006 1 parent 38900ad
@damianh damianh authored
View
128 src/NEventStore.Persistence.SqlCe.Tests/NEventStore.Persistence.SqlCe.Tests.csproj
@@ -1,128 +0,0 @@
-<?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>{1A0C56B7-0186-4E2B-89FA-6B14FED37A75}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>NEventStore.Persistence.AcceptanceTests</RootNamespace>
- <AssemblyName>NEventStore.Persistence.SqlCe.Tests</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- <TargetFrameworkProfile />
- </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>
- <Prefer32Bit>false</Prefer32Bit>
- </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>
- <Prefer32Bit>false</Prefer32Bit>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data" />
- <Reference Include="System.Transactions" />
- <Reference Include="xunit, Version=1.9.1.1600, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\xunit.1.9.1\lib\net20\xunit.dll</HintPath>
- </Reference>
- <Reference Include="xunit.should, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\xunit.should.1.1\lib\net35\xunit.should.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\GlobalAssemblyInfo.cs">
- <Link>Properties\GlobalAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="..\VersionAssemblyInfo.cs">
- <Link>Properties\VersionAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="..\NEventStore.Persistence.AcceptanceTests\PersistenceTests.cs">
- <Link>PersistenceTests.cs</Link>
- </Compile>
- <Compile Include="PersistenceEngineFixture.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- <DependentUpon>Settings.settings</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\NEventStore\NEventStore.csproj">
- <Project>{03946843-f343-419c-88ef-3e446d08dfa6}</Project>
- <Name>NEventStore</Name>
- </ProjectReference>
- <ProjectReference Include="..\NEventStore.Persistence.AcceptanceTests\NEventStore.Persistence.AcceptanceTests.csproj">
- <Project>{3fe594fe-16ff-4405-97d5-5a58fb12520b}</Project>
- <Name>NEventStore.Persistence.AcceptanceTests</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- <None Include="packages.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- </ItemGroup>
- <ItemGroup>
- <Content Include="NEventStore.sdf">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include=".NETFramework,Version=v4.0">
- <Visible>False</Visible>
- <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.SQL.Server.Compact.4.0">
- <Visible>False</Visible>
- <ProductName>SQL Server Compact 4.0 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
- <Visible>False</Visible>
- <ProductName>Windows Installer 4.5</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </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>
- -->
-</Project>
View
BIN  src/NEventStore.Persistence.SqlCe.Tests/NEventStore.sdf
Binary file not shown
View
18 src/NEventStore.Persistence.SqlCe.Tests/PersistenceEngineFixture.cs
@@ -1,18 +0,0 @@
-namespace NEventStore.Persistence.AcceptanceTests
-{
- using NEventStore.Persistence.Sql;
- using NEventStore.Persistence.Sql.SqlDialects;
- using NEventStore.Serialization;
-
- public partial class PersistenceEngineFixture
- {
- public PersistenceEngineFixture()
- {
- _createPersistence = () =>
- new SqlPersistenceFactory(
- new ConfigurationConnectionFactory("NEventStore.Persistence.AcceptanceTests.Properties.Settings.SQLCE"),
- new BinarySerializer(),
- new SqlCeDialect()).Build();
- }
- }
-}
View
4 src/NEventStore.Persistence.SqlCe.Tests/Properties/AssemblyInfo.cs
@@ -1,4 +0,0 @@
-using System.Reflection;
-
-[assembly: AssemblyTitle("NEventStore.Persistence.SqlCe.Tests")]
-[assembly: AssemblyDescription("")]
View
36 src/NEventStore.Persistence.SqlCe.Tests/Properties/Settings.Designer.cs
@@ -1,36 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18051
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace NEventStore.Persistence.AcceptanceTests.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
- [global::System.Configuration.DefaultSettingValueAttribute("Data Source=NEventStore.sdf;Persist Security Info=False;")]
- public string SQLCE {
- get {
- return ((string)(this["SQLCE"]));
- }
- }
- }
-}
View
14 src/NEventStore.Persistence.SqlCe.Tests/Properties/Settings.settings
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="NEventStore.Persistence.AcceptanceTests.Properties" GeneratedClassName="Settings">
- <Profiles />
- <Settings>
- <Setting Name="SQLCE" Type="(Connection string)" Scope="Application">
- <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
- &lt;ConnectionString&gt;Data Source=NEventStore.sdf;Persist Security Info=False;&lt;/ConnectionString&gt;
- &lt;ProviderName&gt;System.Data.SqlServerCe.4.0&lt;/ProviderName&gt;
-&lt;/SerializableConnectionString&gt;</DesignTimeValue>
- <Value Profile="(Default)">Data Source=NEventStore.sdf;Persist Security Info=False;</Value>
- </Setting>
- </Settings>
-</SettingsFile>
View
8 src/NEventStore.Persistence.SqlCe.Tests/app.config
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
- <configSections>
- </configSections>
- <connectionStrings>
- <add name="NEventStore.Persistence.AcceptanceTests.Properties.Settings.SQLCE" connectionString="Data Source=NEventStore.sdf;Persist Security Info=False;" providerName="System.Data.SqlServerCe.4.0"/>
- </connectionStrings>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
View
5 src/NEventStore.Persistence.SqlCe.Tests/packages.config
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="xunit" version="1.9.1" targetFramework="net45" />
- <package id="xunit.should" version="1.1" targetFramework="net45" />
-</packages>
View
7 src/NEventStore.sln
@@ -42,8 +42,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Persistence.Ora
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Persistence.PostgreSql.Tests", "NEventStore.Persistence.PostgreSql.Tests\NEventStore.Persistence.PostgreSql.Tests.csproj", "{770FE444-6CC3-44D0-950E-EAF6B7CF7382}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Persistence.SqlCe.Tests", "NEventStore.Persistence.SqlCe.Tests\NEventStore.Persistence.SqlCe.Tests.csproj", "{1A0C56B7-0186-4E2B-89FA-6B14FED37A75}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Persistence.Sqlite.Tests", "NEventStore.Persistence.Sqlite.Tests\NEventStore.Persistence.Sqlite.Tests.csproj", "{DE2428C7-5F47-4541-9727-B3AACB14DCD6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "persistence.mongo", "persistence.mongo", "{154F4778-2DE9-4A1E-94AF-411FD10BA8E5}"
@@ -112,10 +110,6 @@ Global
{770FE444-6CC3-44D0-950E-EAF6B7CF7382}.Debug|Any CPU.Build.0 = Debug|Any CPU
{770FE444-6CC3-44D0-950E-EAF6B7CF7382}.Release|Any CPU.ActiveCfg = Release|Any CPU
{770FE444-6CC3-44D0-950E-EAF6B7CF7382}.Release|Any CPU.Build.0 = Release|Any CPU
- {1A0C56B7-0186-4E2B-89FA-6B14FED37A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1A0C56B7-0186-4E2B-89FA-6B14FED37A75}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1A0C56B7-0186-4E2B-89FA-6B14FED37A75}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1A0C56B7-0186-4E2B-89FA-6B14FED37A75}.Release|Any CPU.Build.0 = Release|Any CPU
{DE2428C7-5F47-4541-9727-B3AACB14DCD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE2428C7-5F47-4541-9727-B3AACB14DCD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE2428C7-5F47-4541-9727-B3AACB14DCD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -173,7 +167,6 @@ Global
{6073E59E-589B-4DC1-8073-0B3E462E825A} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
{860604D7-63EA-4F57-815B-57DF4830F212} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
{770FE444-6CC3-44D0-950E-EAF6B7CF7382} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
- {1A0C56B7-0186-4E2B-89FA-6B14FED37A75} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
{DE2428C7-5F47-4541-9727-B3AACB14DCD6} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
{79D255F6-B001-425E-B3BF-CBF1E9A884B9} = {302E416E-456F-49D4-A1A4-42323FCD38AD}
EndGlobalSection
View
10 src/NEventStore/NEventStore.csproj
@@ -162,12 +162,6 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
- <Compile Include="Persistence\Sql\SqlDialects\SqlCeDialect.cs" />
- <Compile Include="Persistence\Sql\SqlDialects\SqlCeStatements.Designer.cs">
- <DependentUpon>SqlCeStatements.resx</DependentUpon>
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- </Compile>
<Compile Include="Persistence\Sql\SqlDialects\SqliteDialect.cs" />
<Compile Include="Persistence\Sql\SqlDialects\SqliteStatements.Designer.cs">
<DependentUpon>SqliteStatements.resx</DependentUpon>
@@ -295,10 +289,6 @@
<LastGenOutput>PostgreSqlStatements.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Persistence\Sql\SqlDialects\SqlCeStatements.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>SqlCeStatements.Designer.cs</LastGenOutput>
- </EmbeddedResource>
<EmbeddedResource Include="Persistence\Sql\SqlDialects\SqliteStatements.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>SqliteStatements.Designer.cs</LastGenOutput>
View
106 src/NEventStore/Persistence/Sql/SqlDialects/SqlCeDialect.cs
@@ -1,106 +0,0 @@
-namespace NEventStore.Persistence.Sql.SqlDialects
-{
- using System;
- using System.Data;
- using System.Reflection;
- using System.Transactions;
- using NEventStore.Persistence.Sql;
-
- public class SqlCeDialect : CommonSqlDialect
- {
- public override string InitializeStorage
- {
- get { return SqlCeStatements.InitializeStorage; }
- }
-
- public override string GetSnapshot
- {
- get { return base.GetSnapshot.Replace("SELECT *", "SELECT TOP(1) *").Replace("LIMIT 1", string.Empty); }
- }
-
- public override string GetCommitsFromStartingRevision
- {
- get { return RemovePaging(base.GetCommitsFromStartingRevision); }
- }
-
- public override string GetCommitsFromInstant
- {
- get { return RemovePaging(base.GetCommitsFromInstant); }
- }
-
- public override string GetCommitsFromToInstant
- {
- get { return RemovePaging(base.GetCommitsFromToInstant); }
- }
-
- public override string PersistCommit
- {
- get { return SqlCeStatements.PersistCommit; }
- }
-
- public override string GetCommitsFromCheckpoint
- {
- get { return RemovePaging(base.GetCommitsFromCheckpoint); }
- }
-
- public override string GetStreamsRequiringSnapshots
- {
- get { return RemovePaging(base.GetStreamsRequiringSnapshots); }
- }
-
- public override string GetUndispatchedCommits
- {
- get { return RemovePaging(base.GetUndispatchedCommits); }
- }
-
- public override bool CanPage
- {
- get { return false; }
- }
-
- private static string RemovePaging(string query)
- {
- return query
- .Replace("\n LIMIT @Limit OFFSET @Skip;", ";")
- .Replace("\n LIMIT @Limit;", ";");
- }
-
- public override bool IsDuplicate(Exception exception)
- {
- // using reflection to avoid a direct dependency on SQL CE assemblies
- string message = exception.Message.ToUpperInvariant();
- return message.Contains("DUPLICATE") || message.Contains("UNIQUE");
- }
-
- public override IDbStatement BuildStatement(
- TransactionScope scope, IDbConnection connection, IDbTransaction transaction)
- {
- return new SqlCeDbStatement(this, scope, connection, transaction);
- }
-
- private class SqlCeDbStatement : DelimitedDbStatement
- {
- public SqlCeDbStatement(
- ISqlDialect dialect,
- TransactionScope scope,
- IDbConnection connection,
- IDbTransaction transaction)
- : base(dialect, scope, connection, transaction)
- {}
-
- protected override void SetParameterValue(IDataParameter param, object value, DbType? type)
- {
- base.SetParameterValue(param, value, null);
-
- // SQL CE Binary has a size limit of 8000. We have to explicitely set the type of the parameter to SqlDbType.Image
- // to be able to support a larger payload.
- if (param.DbType == DbType.Binary)
- {
- param.GetType().InvokeMember("SqlDbType",
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty,
- Type.DefaultBinder, param, new object[] {SqlDbType.Image});
- }
- }
- }
- }
-}
View
98 src/NEventStore/Persistence/Sql/SqlDialects/SqlCeStatements.Designer.cs
@@ -1,98 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18051
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace NEventStore.Persistence.Sql.SqlDialects {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class SqlCeStatements {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal SqlCeStatements() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NEventStore.Persistence.Sql.SqlDialects.SqlCeStatements", typeof(SqlCeStatements).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to CREATE TABLE Commits
- ///(
- /// BucketId nvarchar(40) NOT NULL,
- /// StreamId nchar(40) NOT NULL,
- /// StreamIdOriginal nvarchar(1000) NOT NULL,
- /// StreamRevision int NOT NULL,
- /// Items tinyint NOT NULL,
- /// CommitId uniqueidentifier NOT NULL,
- /// CommitSequence int NOT NULL,
- /// CommitStamp datetime NOT NULL,
- /// CheckpointNumber bigint IDENTITY NOT NULL,
- /// Dispatched bit NOT NULL DEFAULT 0,
- /// Headers image NULL,
- /// Payload image NOT NULL,
- /// CONSTRAINT PK_Commits PRIMARY KEY (BucketId, Stre [rest of string was truncated]&quot;;.
- /// </summary>
- internal static string InitializeStorage {
- get {
- return ResourceManager.GetString("InitializeStorage", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to INSERT
- /// INTO Commits
- /// ( BucketId, StreamId, StreamIdOriginal, CommitId, CommitSequence, StreamRevision, Items, CommitStamp, Headers, Payload )
- ///VALUES (@BucketId, @StreamId, @StreamIdOriginal, @CommitId, @CommitSequence, @StreamRevision, @Items, @CommitStamp, @Headers, @Payload);.
- /// </summary>
- internal static string PersistCommit {
- get {
- return ResourceManager.GetString("PersistCommit", resourceCulture);
- }
- }
- }
-}
View
157 src/NEventStore/Persistence/Sql/SqlDialects/SqlCeStatements.resx
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="InitializeStorage" xml:space="preserve">
- <value>CREATE TABLE Commits
-(
- BucketId nvarchar(40) NOT NULL,
- StreamId nchar(40) NOT NULL,
- StreamIdOriginal nvarchar(1000) NOT NULL,
- StreamRevision int NOT NULL,
- Items tinyint NOT NULL,
- CommitId uniqueidentifier NOT NULL,
- CommitSequence int NOT NULL,
- CommitStamp datetime NOT NULL,
- CheckpointNumber bigint IDENTITY NOT NULL,
- Dispatched bit NOT NULL DEFAULT 0,
- Headers image NULL,
- Payload image NOT NULL,
- CONSTRAINT PK_Commits PRIMARY KEY (BucketId, StreamId, CommitSequence)
-);
-CREATE UNIQUE INDEX IX_Commits ON Commits (BucketId, StreamId, CommitId);
-CREATE UNIQUE INDEX IX_Commits_Revisions ON Commits (BucketId, StreamId, StreamRevision, Items);
-CREATE INDEX IX_Commits_Dispatched ON Commits (Dispatched);
-CREATE INDEX IX_Commits_Stamp ON Commits (CommitStamp);
-
-CREATE TABLE Snapshots
-(
- BucketId nchar(40) NOT NULL,
- StreamId nchar(40) NOT NULL,
- StreamRevision int NOT NULL,
- Payload image NOT NULL,
- CONSTRAINT PK_Snapshots PRIMARY KEY (BucketId, StreamId, StreamRevision)
-);</value>
- </data>
- <data name="PersistCommit" xml:space="preserve">
- <value>INSERT
- INTO Commits
- ( BucketId, StreamId, StreamIdOriginal, CommitId, CommitSequence, StreamRevision, Items, CommitStamp, Headers, Payload )
-VALUES (@BucketId, @StreamId, @StreamIdOriginal, @CommitId, @CommitSequence, @StreamRevision, @Items, @CommitStamp, @Headers, @Payload);</value>
- </data>
-</root>
View
20 src/NEventStore/Persistence/Sql/SqlPersistenceFactory.cs
@@ -14,27 +14,19 @@ public class SqlPersistenceFactory : IPersistenceFactory
private readonly TransactionScopeOption _scopeOption;
private readonly ISerialize _serializer;
- public SqlPersistenceFactory(string connectionName, ISerialize serializer)
- : this(connectionName, serializer, null)
- {}
-
- public SqlPersistenceFactory(string connectionName, ISerialize serializer, ISqlDialect dialect)
+ public SqlPersistenceFactory(string connectionName, ISerialize serializer, ISqlDialect dialect = null)
: this(serializer, TransactionScopeOption.Suppress, DefaultPageSize)
{
_connectionFactory = new ConfigurationConnectionFactory(connectionName);
_dialect = dialect ?? ResolveDialect(new ConfigurationConnectionFactory(connectionName).Settings);
}
- public SqlPersistenceFactory(IConnectionFactory factory, ISerialize serializer, ISqlDialect dialect)
- : this(factory, serializer, dialect, TransactionScopeOption.Suppress, DefaultPageSize)
- {}
-
public SqlPersistenceFactory(
IConnectionFactory factory,
ISerialize serializer,
ISqlDialect dialect,
- TransactionScopeOption scopeOption,
- int pageSize)
+ TransactionScopeOption scopeOption = TransactionScopeOption.Suppress,
+ int pageSize = DefaultPageSize)
: this(serializer, scopeOption, pageSize)
{
if (dialect == null)
@@ -79,7 +71,6 @@ public virtual IPersistStreams Build()
protected static ISqlDialect ResolveDialect(ConnectionStringSettings settings)
{
- string connectionString = settings.ConnectionString.ToUpperInvariant();
string providerName = settings.ProviderName.ToUpperInvariant();
if (providerName.Contains("MYSQL"))
@@ -92,11 +83,6 @@ protected static ISqlDialect ResolveDialect(ConnectionStringSettings settings)
return new SqliteDialect();
}
- if (providerName.Contains("SQLSERVERCE") || connectionString.Contains(".SDF"))
- {
- return new SqlCeDialect();
- }
-
if (providerName.Contains("POSTGRES") || providerName.Contains("NPGSQL"))
{
return new PostgreSqlDialect();
Please sign in to comment.
Something went wrong with that request. Please try again.