With the widespread support of Microsoft’s .NET Framework for C#, Visual Basic, F#, PowerShell, etc.., I’ve been wondering why there hasn’t been any similar database development frameworks created (I haven’t been able to find any at least).
This lead me to consider developing my own framework, but I can’t help but think that if it there was a significant need for something like this, that surely someone would have started a project like this already, either commercially or as an open source project.
My preliminary thoughts about the technical aspects are:
- The framework would be modeled after the Microsoft .NET Framework as much as possible. Personally, I’m somewhat biased towards .NET & T-SQL, but I think that by providing similar functionality to .NET would help ease the learning curve for new developers too.
- There would be an installer of some type with the option to deploy the framework objects in a separate, dedicated database, or include the objects in another database’s schema. Also, with an option to simply generate the scripts to create the objects.
- Ability to select which objects to install (similar to how jQuery UI lets you choose which components you want in your custom download package) to keep databases from becoming bloated.
- Support for strict ANSI SQL, as well as vendor-specific versions (e.g. SQL Server, Oracle, MySQL).
I guess what I’m really looking for is:
- Has anyone has come across anything like this that has already been developed?
- Do you have any pertinent insight as to why this would be good or bad idea, either generally speaking or in regards to the things I mentioned here?
Edit
Basically, I’m envisioning the framework as providing a common set of helper functions/procedures, tally/number tables, etc…
A prime example would be a function to format a date into a string that could be used with SQL Server pre-2012 versions (SQL Server 2012 introduced this as a built-in function).
And, by framework, I’m thinking along the lines of development within the database (i.e. programming functions, stored procedures, ad-hoc scripts, etc…) vs. interacting with or connecting to the database externally (e.g. Ling2Sql, ORM’s).
Assuming these objects/helpers exist in the database rather than some kind of .Net library, yes there are a lot of these database helper functions floating around and it would certainly be of assistance to gather them up into one consistent library.
I think the biggest issue is performance though. For performance reasons it is sometimes necessary for example to use some hideous inline expression rather than wrapping it nicely up into a UDF. Or it might be beneficial to optimise your SQL code because you know a certain table has a lot of rows or not many rows, or a certain field is selective or not.
This along with security concerns might mean that your average DBA will not want to install your helper functions because they don’t know the performance or security repercussions. This is along the same lines that DBA’s don’t like to install CLR functions.
But I certainly have never come across a central installable library of SQL helper functions, I guess you could take a look on Codeplex or one of the many other open source code libraries to see if such a thing exists.
Go for it!