views:

139

answers:

3

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 (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:

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.

A: 
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,

http://stackoverflow.com/questions/1130797/subsonic-postgresql-template http://stackoverflow.com/questions/1149459/postgresql-via-subsonic

Good luck.

Pino
Not known a shared host to offer SQLExpress... Microsoft even discourages its use (probably since people would use it rather than pay for SQL).
Sam
Will that SQLite code still work in SubSonic 3? Since it is a two year old article, I don't know if it will or not.
Sam
+1  A: 

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.
Adam
Perhaps this could be clarified on the 'Supported Databases' page: http://subsonicproject.com/docs/Supported_Databases ... i.e. have 't4 templates' link/text next to each database that has a template?
Sam
That sounds like a great idea, could you make the necessary changes?
Adam
A: 

In short, Subsonic only support few database only NOT ALL ( that what their claimed :( ). Try nHibernate, support most of the database.

mokth