📜 ⬆️ ⬇️

DigestSDK - automation of working with MSSQL to Delphi

Introduction


A few years ago I had to implement working with the MSSQL server database tables. After writing a certain amount of actually the same type of code, the idea came to automate these "routine" actions.
Agree that the writing of the same code, which differs only in the structure of the database tables, cannot inspire anyone. In addition, if the number of tables, with which you have to work, passes for a dozen, then the occupation from the category of boring - goes into the category of labor-intensive.
Search on the Internet at that time did not give results, so the implementation had to take over. .
As a result, a set of modules was created (hereinafter DigestSDK ) in the Delphi language, allowing the programmer to save from writing the “standard” code for working with the database and focus on the logic of the application itself. .
Demo examples, source codes and video on working with DigestSDK posted on SourceForge (maybe someone else will come in handy, at the same time we will check the effect again :-)) ..

So, DigestSDK allows you to display the contents of the MSSQL server tables (further implementation is planned for other popular databases) and automatically provides the following features:

List of standard features


After creation, the directory automatically contains the following functions:

Additional features


The above features can be extended by the programmer with the following features:

The presented list of functions and features is far from complete and can be expanded by a programmer by redefining and / or writing your own additional functions.
Let me give you a fragment of the code for creating a reference book with a sample of data from the Production.Product table (from the demo database AdventureWorks to MSSQL 2005).
In this example, the constructor of the TSimpleDigest class is called, to which the sql query is sent, the name of the table in the database (to which add, change and delete operations will be applied), the usual ADO connection string, an indication of where to create a reference (TWinControl or nil if on a new form) and the operator identifier - a certain integer - the code under which the directory will save its last state.

Example of use with demonstration of results.


Example creation program:
//   DigestProducts := TSimpleDigestR.Create( 'select top 10 * from Production.Product',//  'Production.Product',//    ConnectionString, //  nil, //   0 //  (  ) ); //  DigestProducts.Open(); DigestProducts.ShowModal; 

')
Result of performance:
DigestSDKDemo

A small clip to create a directory


An example of how to connect files to a project and write the simplest code to display the contents of the cars database (located in the Demos \ Cars \ DataBase folder ")


Video demonstrating the main features of DigestSDK


Shows the use of various operations (add, delete, search, sort, save the last state well, etc.)


Source codes examples and demo database (cars) can be downloaded here

Other video examples of work here.

Simply create the necessary and the work of all functions, as well as the translation of the names of the tables and fields will be made automatically.

DigestSDK supports with MSSQL 2005, 2008, 2008 R2.
Performance tested for Delphi 7, 2007, XE2
More information: http://sourceforge.net/projects/digestsdk/

Source: https://habr.com/ru/post/134901/


All Articles