Daikoz.SQLWrapper 2.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Daikoz.SQLWrapper --version 2.0.0
NuGet\Install-Package Daikoz.SQLWrapper -Version 2.0.0
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="Daikoz.SQLWrapper" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Daikoz.SQLWrapper --version 2.0.0
#r "nuget: Daikoz.SQLWrapper, 2.0.0"
#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 Daikoz.SQLWrapper as a Cake Addin
#addin nuget:?package=Daikoz.SQLWrapper&version=2.0.0

// Install Daikoz.SQLWrapper as a Cake Tool
#tool nuget:?package=Daikoz.SQLWrapper&version=2.0.0

SQLWrapper makes it easier to create code wrappers for SQL queries. It's a powerful tool that helps speed up development by reducing the need for manual coding. It works with databases various SQL database (MySQL, MariaDB, ...), checking the syntax and performance of SQL queries before you execute them.

It's important to note that SQLWrapper isn't like other tools that map objects to database tables (ORMs). Instead, it directly generates code from your SQL queries and database structure, which performs better than tools like LINQ, EntityFramework, dapper, ... and doesn't have the same limitations.

One feature is that it can look at your database's structure to check if your SQL queries are correct, and it can create an XML file listing all the data your queries need and return. Then, you can use XSLT templates to turn that XML into code in languages like C#, and more.

Overall, SQLWrapper is a handy tool for making SQL code easier to work with, saving time, and helping you write better code.

Getting started with package NuGet Daikoz.SQLWrapper

Video of demonstration:

Watch the video

The .NET package NuGet Daikoz.SQLWrapper integrate SQLWrapper in build process of our .NET project.

  1. Create your .NET project
  2. Add package NuGet Daikoz.SQLWrapper.

.NET CLI:

dotnet add package Daikoz.SQLWrapper

or use [Manage NuGet Packages...] in Visual Studio

  1. The first build create on your project root, the configuration file sqlwrapper.conf
{
    "Verbose": false,
    "Database": [
        {
            "Name": "Name of this database. Should be contain only characters: a-z A-Z 0-9 _ -",
            "ConnectionString": ".NET connection string to connect to database. If empty, use FilePath to get cached database previously generated.",
            "FilePath": "File path of cached database. If empty, store it in obj of project"
        }
    ],
    "Helper": [
        {
            "Database": "Name of database defined in Database section",
            "Namespace": "Namespace in generated source. If empty, take the default namespace of project",
            "XLST": "Provide your own XLST to generate a helper. If empty, use default XLST provided by SQLWrapper",
            "OutputFilePath": "File path of helper"
        }
    ],
    "Wrapper": [
        {
            "Database": "Name of database defined in Database section",
            "Namespace": "Namespace in generated source. If empty, take the default namespace of project",
            "XLST": "Provide your own XLST to generate the wrapper. If empty, use default XLST provided by SQLWrapper",
            "Path": "Absolute or relative path where to search sql file pattern. If empty, use path of project",
            "FilePattern": "SQL file to wrap. If empty, use \"*.sql\""
        }
    ]
}

To start, follow a minimal configuration file. Modify HOSTNAME, USERID, PASSWORD and DATABASENAME

{
    "Database": [
        {
            "Name": "MyDatabase",
            "ConnectionString": "server=HOSTNAME;user id=USERID;password='PASSWORD';database=DATABASENAME"
        }
    ],
    "Helper": [
        {
            "Database": "MyDatabase",
            "OutputFilePath": "MyDataseHelper.cs"
        }
    ],
    "Wrapper": [
        {
            "Database": "MyDatabase"
        }
    ]
}
  1. Add your database query in files .sql in your project
  2. Build you project
  • Your database structure is cached in obj
  • A database helper if generate in file MyDataseHelper.cs
  • For each *.sql, a wrapper is generated

Getting started with command line SQLWrapper

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.

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
2.0.1 90 4/12/2024
2.0.0 87 4/1/2024
1.2.2 325 1/1/2024

Version 2.0.0:
- increase performance to generate code from sql query
- Add MariaDB database
- Genere code under each sql file