In Tea Commerce we use PetaPoco as the database ORM. Normally we do new PetaPoco("umbracoDbDSN") which is the name of the connection string in the web.config. Then PetaPoco figures out if its a sql server, SQLCE etc.
I just pulled an Umbraco Uaas project (Umbraco 7.5.4) and installed Tea Commerce. The problem is that the "umbracoDbDSN" connection is to a SQL CE DB, but somehow UaaS does magic that connects to the dev sql environment on UaaS.
Question is: how can we do a new PetaPoco and have it connect to the right "magic" Uaas DB?
It's not an option to switch to the PetaPoco integrated into Umbraco as we want the Tea Commerce core to work without a reference to Umbraco.
Yes, it's crucial to how Umbraco Cloud (UaaS) works that you never connect the local website directly to the databases on the environments. On Umbraco Cloud each environment - also local - is always isolated to ensure that you don't corrupt databases (or end up in cache coherency issues) due to multiple people connecting different codebases to same db. Hence by default your db locally will be a created and sync'ed sql ce (but you could use a local sql server as well).
The connection string name is the exact same on Umbraco Cloud, it just make sure it's always updated correctly (and automatically). On the Connection Details page of your project you can always see the details to connect the SQL Azure of the different environments as well as open the firewall. That way you can connect to SQL management studio and update any TeaCommerce related tables if you need to.
Export SQL CE database to SQL Server (easiest from WebMatrix). Update your connection string. Done. :)
Whenever you deploy to Umbraco Cloud (UaaS) we ignore the connection string in your web.config and overrule it so it doesn't matter what you put in there.
A word of warning though: you can not share that connection string with your colleagues so they all connect to the same SQL database on a central server. This will lead to corrupted data and will prevent you from deploying and using your Umbraco Cloud site effectively.
And to emphasize it means that what you're trying with initializing Petapoco withnew PetaPoco("umbracoDbDSN") will "just work" when you deploy (i.e. automatically use sqlce locally and the sql azure db when deployed :)
Thanks for the reply. Makes a lot of sense now that I know it.
Is there some kind of info graphic that shows or explains from a developers point of view, how all these local, environments, content, media, files, etc is pushed between environments when you do a push command. Could be amazing to have some kind of "walk through" that shows what happens when content is edited (courier saves file to disk, file is commited, on app start the websites sees if courier files is there and executed the commands), or what happens when you save a doc type.
Getting connection string?
In Tea Commerce we use PetaPoco as the database ORM. Normally we do new PetaPoco("umbracoDbDSN") which is the name of the connection string in the web.config. Then PetaPoco figures out if its a sql server, SQLCE etc.
I just pulled an Umbraco Uaas project (Umbraco 7.5.4) and installed Tea Commerce. The problem is that the "umbracoDbDSN" connection is to a SQL CE DB, but somehow UaaS does magic that connects to the dev sql environment on UaaS.
Question is: how can we do a new PetaPoco and have it connect to the right "magic" Uaas DB?
It's not an option to switch to the PetaPoco integrated into Umbraco as we want the Tea Commerce core to work without a reference to Umbraco.
Kind regards
Anders
Yes, it's crucial to how Umbraco Cloud (UaaS) works that you never connect the local website directly to the databases on the environments. On Umbraco Cloud each environment - also local - is always isolated to ensure that you don't corrupt databases (or end up in cache coherency issues) due to multiple people connecting different codebases to same db. Hence by default your db locally will be a created and sync'ed sql ce (but you could use a local sql server as well).
The connection string name is the exact same on Umbraco Cloud, it just make sure it's always updated correctly (and automatically). On the Connection Details page of your project you can always see the details to connect the SQL Azure of the different environments as well as open the firewall. That way you can connect to SQL management studio and update any TeaCommerce related tables if you need to.
Hope this helps!
Any docs on how to use local sql server instead? Is it just by updating web.config? (and wont that be overwritten when pulling changes?)
Export SQL CE database to SQL Server (easiest from WebMatrix). Update your connection string. Done. :)
Whenever you deploy to Umbraco Cloud (UaaS) we ignore the connection string in your web.config and overrule it so it doesn't matter what you put in there.
A word of warning though: you can not share that connection string with your colleagues so they all connect to the same SQL database on a central server. This will lead to corrupted data and will prevent you from deploying and using your Umbraco Cloud site effectively.
And to emphasize it means that what you're trying with initializing Petapoco with
new PetaPoco("umbracoDbDSN")
will "just work" when you deploy (i.e. automatically use sqlce locally and the sql azure db when deployed :)Hi Niels
Thanks for the reply. Makes a lot of sense now that I know it.
Is there some kind of info graphic that shows or explains from a developers point of view, how all these local, environments, content, media, files, etc is pushed between environments when you do a push command. Could be amazing to have some kind of "walk through" that shows what happens when content is edited (courier saves file to disk, file is commited, on app start the websites sees if courier files is there and executed the commands), or what happens when you save a doc type.
Just an idea :)
Have a great one.
Kind regards
Anders
is working on a reply...