Update Sqlite

This commit is contained in:
sunkaixuan 2017-07-08 22:22:41 +08:00
parent 4ce9c9c0cf
commit ae90fb7618
4 changed files with 66 additions and 5 deletions

View File

@ -6,16 +6,18 @@ namespace SqlSugar
{ {
public class MySqlBuilder : SqlBuilderProvider public class MySqlBuilder : SqlBuilderProvider
{ {
public override string GetTranslationTableName(string name) public override string GetTranslationTableName(string name)
{ {
if (name.Contains("`")) return name;
Check.ArgumentNullException(name, string.Format(ErrorMessage.ObjNotExist, "Table Name")); Check.ArgumentNullException(name, string.Format(ErrorMessage.ObjNotExist, "Table Name"));
var context = this.Context; var context = this.Context;
var mappingInfo = context var mappingInfo = context
.MappingTables .MappingTables
.FirstOrDefault(it => it.EntityName.Equals(name, StringComparison.CurrentCultureIgnoreCase)); .FirstOrDefault(it => it.EntityName.Equals(name, StringComparison.CurrentCultureIgnoreCase));
return "`" + (mappingInfo == null ? name : mappingInfo.DbTableName) + "`"; name = (mappingInfo == null ? name : mappingInfo.DbTableName);
if (name.Contains("`"))
return name;
else
return "`" + name + "`";
} }
public override string GetTranslationColumnName(string entityName, string propertyName) public override string GetTranslationColumnName(string entityName, string propertyName)
{ {

View File

@ -1,6 +1,6 @@
namespace SqlSugar namespace SqlSugar
{ {
public class MySqlDeleteBuilder : DeleteBuilder public class SqliteDeleteBuilder : DeleteBuilder
{ {
} }

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Linq.Expressions;
using SqlSugar;
//using OrmTest.Models;
//using System.Data.SqlClient;
//using OrmTest.UnitTest;
//using OrmTest.PerformanceTesting;
namespace OrmTest
{
class Program
{
static void Main(string[] args)
{
////// /***Unit Test***/
//new Field(1).Init();
//new Where(1).Init();
//new Method(1).Init();
//new JoinQuery(1).Init();
//new SingleQuery(1).Init();
//new SelectQuery(1).Init();
//new AutoClose(1).Init();
//new Insert(1).Init();
//new Delete(1).Init();
//new Update(1).Init();
//new Mapping(1).Init();
//new DataTest(1).Init();
//// /***Performance Test***/
//// new SqlSugarPerformance(100).Select();
///***Demo***/
//OrmTest.Demo.Query.Init();
//OrmTest.Demo.Insert.Init();
//OrmTest.Demo.Delete.Init();
//OrmTest.Demo.Update.Init();
//OrmTest.Demo.DbFirst.Init();
//OrmTest.Demo.JoinSql.Init();
//OrmTest.Demo.Filter.Init();
//OrmTest.Demo.ComplexModel.Init();
//OrmTest.Demo.CodeFirst.Init();
}
}
}

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D48622B3-F4CD-45CD-B1C9-868083037ECD}</ProjectGuid> <ProjectGuid>{D48622B3-F4CD-45CD-B1C9-868083037ECD}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SqliteTest</RootNamespace> <RootNamespace>SqliteTest</RootNamespace>
<AssemblyName>SqliteTest</AssemblyName> <AssemblyName>SqliteTest</AssemblyName>
@ -29,6 +29,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -41,6 +44,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -54,6 +58,12 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SqlSugar\SqlSugar.csproj">
<Project>{489bb790-226c-4fad-8d1e-51d72a7ff8e5}</Project>
<Name>SqlSugar</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.