GithubHelp home page GithubHelp logo

sqlbuilder's Introduction

SqlBuilder

一个通过链式方法编写Sql语句的类库,本项目的目标是:一次编写生成各种数据库方言。

例子

普通查询

代码:

SqlBuilder.Database(Dialect.SqlServer2005).Select.All.Form("table1").As("t1");

SQL:

select * form table1 as t1

Where查询

代码:

SqlBuilder.Database(Dialect.SqlServer2005).
Select.All.Form("table1").As("t1").Where("t1.id>10").And("t1.id<100").Or("1=2");

SQL:

select * form table1 as t1 where t1.id>10 and t1.id<100 or 1=2

表链接

SqlBuilder.Database(Dialect.SqlServer2005).
Select.All.Form("table1").As("t1").Form("table2 as t2")
select * form table1 as t1,table2 as t2
SqlBuilder.Database(Dialect.SqlServer2005).
Select.All.Form("table1").As("t1").InnerJoin("table2").As("t2").On("t1.id=t2.tId");
select * form table1 as t1 inner join table2 as t2 on t1.id=t2.tId
SqlBuilder.Database(Dialect.SqlServer2005).
Select.All.Form("table1").As("t1").LeftJoin("table2").As("t2").On("t1.id=t2.tId");
select * form table1 as t1 left join table2 as t2 on t1.id=t2.tId
SqlBuilder.Database(Dialect.SqlServer2005).
Select.All.Form("table1").As("t1").RightJoin("table2").As("t2").On("t1.id=t2.tId");
select * form table1 as t1 right join table2 as t2 on t1.id=t2.tId

sqlbuilder's People

Contributors

wuyou331 avatar

Stargazers

Wayde.Fei avatar

Watchers

Soundararajan Karunagaran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.