UtilityPack.SqlBuilder 1.1.3

dotnet add package UtilityPack.SqlBuilder --version 1.1.3                
NuGet\Install-Package UtilityPack.SqlBuilder -Version 1.1.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UtilityPack.SqlBuilder" Version="1.1.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UtilityPack.SqlBuilder --version 1.1.3                
#r "nuget: UtilityPack.SqlBuilder, 1.1.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UtilityPack.SqlBuilder as a Cake Addin
#addin nuget:?package=UtilityPack.SqlBuilder&version=1.1.3

// Install UtilityPack.SqlBuilder as a Cake Tool
#tool nuget:?package=UtilityPack.SqlBuilder&version=1.1.3                

SqlBuilder

Enum SqlFactoryType

  • MANUAL
    A totally manual command, the only supported operation is 'SetParam()' that works like a string.replace()
  • INSERT
    An insert command structured like 'INSERT INTO table_name (...) VALUES (...);'
  • SELECT
    A select command structured like 'SELECT .. FROM table_name;'
  • UPDATE
    An update command structured like 'UPDATE table_name SET ...;'
  • DELETE
    A delete command structured like 'DELETE FROM table_name ...;'

Enum SqlFactoryParam

  • NULL
    When a parameter should be set exactly as the value passed (param = values)
  • PLUS
    When a parameter should be set as an addition of the value passed (param += value)
  • MINUS
    When a parameter should be set as a subtraction of the value passed (param -= value)

Enum SqlFactoryJoin

  • INNER
    An inner join to attach to a command

Class Database

Methods

  • CreateManual( string text ) : SqlFactory
    Create and return from zero a SqlFactory

  • CreateSelect( string tableName) : SqlFactory
    Create and return a SqlFactory with a SELECT template

  • CreateInsert( string tableName) : SqlFactory
    Create and return a SqlFactory with an INSERT template

  • CreateUpdate( string tableName) : SqlFactory
    Create and return a SqlFactory with an UPDATE template

  • CreateDelete( string tableName) : SqlFactory
    Create and return a SqlFactory with a DELETE template

  • GetCommand( ) : string
    Returns the command clean of all temporary constructs and ready to be inserted into a database

  • SetSelect( string index ) : SqlFactory
    Set a select option inside the command, valid for SELECT type

  • SetParam( string index, object value, SqlFactoryParam type) : SqlFactory
    Set a parameter inside the command, valid for MANUAL, INSERT and UPDATE type

  • SetWhere( string index, object value) : SqlFactory
    Set where conditions inside the command, valid for SELECT, UPDATE and DELETE type

  • SetJoin( SqlFactoryJoin joinType, string tableName, string columnSX, string columnDX) : SqlFactory
    Set a JOIN inside the command, valid for SELECT type

Example

    // Create a new update on table USERS
    SqlFactory sql = SqlFactory.CreateUpdate("users");

    // Set all the parameters "param = value,"
    sql.SetParam("nome",    "mario");
    sql.SetParam("cognome", "rossi");
    sql.SetParam("anni",    30);

    // Set a WHERE
    sql.SetWhere("id",      106);

    // Get the final command 
    // "UPDATE users SET nome='mario', cognome='rossi', anni=30 WHERE id=106;"
    string command = sql.GetCommand();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 460 5/16/2022
1.1.2 426 3/29/2022
1.1.1 425 2/4/2022
1.1.0 436 2/4/2022
1.0.2 298 11/23/2021
1.0.1 278 11/17/2021
1.0.0 282 11/17/2021