понедельник, 12 июля 2010 г.

Macro T-SQL project published (en)

More than 10 years i'm working with MS SQL



Something was upgraded during this years, and MS SQL 2005 is exactly good server for many and many projects that we develop and support.



But working with PostGres, system programming on C#, Boo and others give as not very good thing to think about. It's that T-SQL is not so good language as we want it to be... Not much readable, with some ugly constructions and everyday 'snippets' to do some simple stuff.



We were'nt want to live with this forever and wait MS to give as something fantastic in SQL 2016, but:



  1. T-SQL is what it is - well complicated, but not extensible, not-declarational language and we cannot avoid it.
  2. I hate any code-preparing utils that you MUST to call if you want to apply some DSL - what if i want to call SQL from APP - i must to supply it with very_good_utility.exe? and call it ?
  3. Schema generator programs is far more ugly thing even than codegenerators...
  4. Using of .NET assemblies looks mo prety, but... it's hard to support too and cause it's own problems
  5. We like to solve problem in MS SQL 2005 itself and with T-SQL itself
In a moment we have 'evrica!'





Module we wrote is not a part of comercial order, is not selfish product, so I decide to publish it as open source.

Go to  http://code.google.com/p/macrotsql/.
Discussion at:





By using special stored procedures and DDL triggers (without any .NET assembly or custom tool) you'll get folloing framework:

  1. embeded XML documentation as in C#
  2. declarative attribute programming (inspired by C# and Boo mete-attributes)
  3. stored procedures and function SQL extensible preprocessor framework
  4. object-oriented support for table schema definition (very wanted after POSTGRE, inspired by prototype.js :) - we define some set (with inheritance) of 'interfaces' that then are applyed to target table (extends it)
  5. prepared set of preprocessors for some every day tasks:
  • tracing of proc enter and leave
  • wrapping procedure body in transaction
  • explicite (in text) line numbering (for quick finding place of error from error comment)
  • support fo  foreach macro block instead of ugly native  work with cursors (maybe worst thing in T-SQL)
Look at project, try it, send me feedback and patches. Wish that project will be usefull for you and you will be usefull for project :)

Комментариев нет: