Skip to content

Generates INSERT, UPDATE and DELETE statements for the query currently edited in the Active Query Builder .NET v3

License

Notifications You must be signed in to change notification settings

ActiveDbSoft/active-query-builder-3-net-dml-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

active-query-builder-3-net-dml-generator

This repository demonstrates how to generate INSERT, UPDATE and DELETE statements for a given SELECT query. It uses the API of the Active Query Builder for .NET v.3 to analyze the query.

There are 2 main entities:

  • ISqlSyntaxOverride - interface to describe SQL syntax and database client specific features. There are 2 implementations of this inteface in the demo: CommonSqlSyntaxOverride - for base features and MsSqlSyntaxOverride - for the standard MS SQL Sever client library (System.Data.SqlClient). You can add other overrides by analogy.
  • DmlSqlGenerator - the DML statements generator itself.

Usage:

var dmlGen = new DmlSqlGenerator(queryBuilder1, new MsSqlSyntaxOverride());
MessageBox.Show(dmlGen.GenerateInsertSql(), "Insert");
MessageBox.Show(dmlGen.GenerateAllFieldsUpdateSql(), "All fields update");
MessageBox.Show(dmlGen.GenerateSingleFieldUpdateSql(), "Single field update");
MessageBox.Show(dmlGen.GenerateDeleteSql(), "Delete");

About

Generates INSERT, UPDATE and DELETE statements for the query currently edited in the Active Query Builder .NET v3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages