Giter VIP home page Giter VIP logo

querybuilder's Introduction

SqlKata Query Builder

Build status

SqlKata on Nuget

SqlKata Query Builder is a powerful Sql Query Builder written in C#.

it's secure and framework agnostic. Inspired by the top Query Builders available, like Laravel Query Builder, and Knex.

SqlKata has an expressive API. it follows a clean naming convention, which is very similar to the SQL syntax.

It make writing SQL queries easy and funny, with no need to read long pages of documentations.

It provides a level of abstraction over the supported database engines, that allows you to work with multiple databases with the same unified API.

SqlKata supports complex queries, such as nested conditions, selection from SubQuery, filtering over SubQueries, Conditional Statements, Deep Joins and others. Currently it has built-in compilers for SqlServer 2008 and above, MySql and PostgreSql.

Some fresh code

var compiler = new SqlServerCompiler();

var withSportCars = Config.get('IncludeSportsCar');

var fastCarsQuery = new Query("Cars")
    .Where("Speed", ">", 120);

if(withSportCars) 
{
    fastCarsQuery.OrWhere("IsSportCar", true);
}

string sql = compiler.Compile(fastCarsQuery).Sql;

Check out the docs for other examples SqlKata docs

Why do I need a Query Builder ?

I've started building this Query Builder, when I was developing big applications that have complex dashboards, and reports.

before I've used to write my SQL queries in strings, and things get worse quickly when you have some dynamic conditions, and even when you are working with multiple database providers, like SqlServer and PostgreSql with the same code base.

Installation

SqlKata is supported on both dotnet standard and net framework 4.5.*.

To install it check the installation guide from the Installing SqlKata

What Next ?

While SqlKata is still in beta, I've stopped adding new major features until I get a stable release.

But to give you an idea about my priorities, I will add the support to Execute Queries, Caching mechanism and to support more native features across available compilers.

Contributions

I don't have a strict contribution guide till the moment, but you can contribute with ideas, bug fixing, or add more test cases.

One simple note to keep in mind, that there is no room for complex or unclean features.

A big thanks for all contributors, for making SqlKata an awesome library

querybuilder's People

Contributors

ahmad-moussawi avatar ceastwood avatar cubrisrrose avatar csantero avatar pejmannik avatar hey-red avatar

Watchers

 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.