SqlKata - Dynamic Sql query builder for dotnet | Product Hunt

🎉 SqlKata is now on Product Hunt

Please upvote to support the product development

Query Execution

SqlKata provide an easy way to execute your queries, by using the famous package Dapper.

Installing Database Providers

In order to execute the queries, you need to install the needed Drivers for each Database Provider.

Sql Server

For Sql Server install System.Data.SqlClient package

dotnet add package System.Data.SqlClient

Postgre Sql

For Postgre Sql install Npgsql package

dotnet add package Npgsql

MySql

For MySql install MySql.Data package

dotnet add package MySql.Data
var host = "local";
var user = "sa";
var database = "healthnbeautyapp";
var password = "secret";

var cs = $"server={host};user={user};database={dbName};password={password}";

var connection = new MySqlConnection(cs);

var db = new QueryFactory(connection, new MySqlCompiler());

SQLite

For SQLite install System.Data.SQLite.Core package

dotnet add package System.Data.SQLite.Core

check this link for more information about the SQLite ADO provider https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/?tabs=netcore-cli

var cs = $"Data Source=file:mydatabase.db";

var connection = new SqliteConnection(cs);

var db = new QueryFactory(connection, new SqliteCompiler());

or if you want to use in-memory database for testing purposes

var cs = $"Data Source=file::memory:;Cache=Shared";

var connection = new SqliteConnection(cs);

var db = new QueryFactory(connection, new SqliteCompiler());
Heap apparel

THE APPAREL BRAND FOR DEVELOPERS

one email per month about tips & tricks, new features, and maybe community feedback