Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate SQL from a user's visual interaction?

I am planning a C# SQL Query Builder application. Basically, users should be able to generate SQL code by using a visual, form-based, user-friendly wizard. All the user has to do is select which fields s/he would like, as well as impose some conditions.

I have looked into a number of applications which accomplish something similar, however none of them seem to explain exactly how the SQL code is generated.

What approaches could be taken to convert the user's interactions with the application, to SQL code?

EDIT: Just to add some more details. The application could be used with any SQL Server database.

like image 944
Dot NET Avatar asked Oct 06 '22 14:10

Dot NET


1 Answers

It depends on what can your user do . As the question is very general, the answer that I can give is:

Try to map your flow-chart to LINQ-SQL code, and the real SQL translation leave to LINQ driver. In this way you get

  • scallability : can map to different SQL databases, to XML, to ...X
  • reliability
like image 138
Tigran Avatar answered Oct 10 '22 04:10

Tigran