A CodeSmith v3.x provider for the excellent VistaDB .Net database engine.History
Over the course of the last 12 months, I have been planning a single-user winforms application that requires a database for permanent data storage. Recently I noticed that VistaDB has a free version of their .Net database engine available for personal, not-for-profit use. I have been a fan of the VistaDB .Net database engine for a number of years now, and to my mind it enjoys a number of advantages over SQL Server Compact Ed (the other DB engine option), not least of which is the "zero-click" deployment.
As I am constantly using CodeSmith v3.x with the CSLA.Net templates for my day-job, when I decided to do an open-source development I thought I may as well use the CSLA objects for this too. In order to use CodeSmith to generate these I had 2 options - I could create my database in SQL Server & VistaDB concurrently, and generate my classes etc using the SQL Server provider, or I could find or write a provider for VistaDB. A quick search on the 'net revealed some mentions of a VistaDB provider along with links to it's source, however the links appeared to be dead. This left one option only - write a provider!
Luckily I had done some previous research into this task, including finding an slightly modifying a provider that was written for SQL Server CE which can be found here http://community.codesmithtools.com/forums/p/5921/30399.aspx
. As this took care of the basics for SQL CE, it was a simple job to take this code and create a VistaDB provider that gives table, field, primary key, identity and foreign key information.Current State
The provider currently has a number of CodeSmith options that are not supported, but it does supply table, field, primary key, identity and foreign key information for the connected database.
The code itself within the provider is a mixture of SQL and DDA code. The SQL code was the starting point, and as I went along adding required methods I found that more and more DDA code was required. This mix has lead to some rather inelegant code aroudn the database connection string as entered in CodeSmith to make both the SQL and DDA code function.Future Development
As mentioned above, there is currently a mixture of SQL and DDA code in the provider, and I would like to convert all of this to DDA. This will have the added benefit of cleaning up the required connection string, as it's currently a compromise between the needs of the two methodologies used.
On top of this, the additional CodeSmith provider options will be added as required, and the code will be cleaned up and commented in a more useful way.Installation
Instructions for installing the provider can be found on the Installation