Setting up SubSonic with Databases other than SQL Server
I am currently using SubSonic (2.2 and 3) for some ASP.NET projects and have managed to get them working with SQL Server (using ActiveRecord). However, I also want to know how to set it up with other开发者_JS百科 (open source) databases, e.g. PostgreSQL and SQLite. This is so I can use it on a web host without SQL Server on. The providers I have found are:
- PostgreSQL: Npgsql
- SQLite: System.Data.SQLite or Mono.Data.SqliteClient (if it works with Microsoft.NET)
Anyone have any experience with SubSonic know how to do this (some sample demo would be good - just a basic primer on querying would be fine)? Non-ASP.NET MVC though (not got into it yet). I have only basic knowledge of SQLite (basically using SQLite Manager in Firefox and querying it via PHP Data Objects) and have not used Postgresql, but assume it would be more scalable than SQLite.
For version 3
PostgreSQL: There aren't any templates for postgres at the moment so you'd need to create the templates yourself
SQLite - The steps should be as follows:
- Add a reference to System.Data.SQLite
- Look in the TemplateProviders folder you'll find a SQLite.ttinclude which you'll need to drop into your project instead of SQLServer.ttinclude.
- Change the .tt files that reference SQLServer.ttinclude to reference SQLite.ttinclude instead.
This is so I can use it on a web host without SQL Server on.
With the release of SQLExpress dont all hosts offer this? (I only use dedicated server so I have no direct experiance with this)
In response to your question.
SQLite - http://codefornothing.wordpress.com/2007/07/19/sqlite-data-provider-for-subsonic-part-2/
Postgre: Doesnt look as simple,
Subsonic postgreSQL Template PostgreSQL via subsonic
Good luck.
In short, Subsonic only support few database only NOT ALL ( that what their claimed :( ). Try nHibernate, support most of the database.
精彩评论