Evolve db with code
(Automatically adding template at the end of the page.)
(Updated Edited template to July 12, 2025.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
You can use the MDriven Framework to do the evolve-database operation from within VisualStudio:
You can use the MDriven Framework to do the evolve-database operation from within VisualStudio:
[[File:2019-10-06 14h29 19.png|none|thumb|623x623px]]
[[File:2019-10-06 14h29 19.png|none|thumb|623x623px]]
Line 24: Line 25:
   
   
  [[Category:Database]]
  [[Category:Database]]
{{Edited|July|12|2024}}
{{Edited|July|12|2025}}

Latest revision as of 05:49, 20 January 2025

This page was created by Hans.karlsen@mdriven.net on 2019-10-06. Last edited by Edgar on 2025-01-20.

You can use the MDriven Framework to do the evolve-database operation from within VisualStudio:

2019-10-06 14h29 19.png

You can also do these operations in runtime:

PersistenceMapperAdo2 pmapp        
var systemservice = YourEcoSpace.GetTypeSystemService();        
string[] ExecutedStatements;        
string result;          
IDBEvolutor evolutor = pmapp.GetEvolutor(systemservice);          
evolutor.CalculateScript();          
evolutor.GenerateDbScript();          
evolutor.GenerateMappingScript();          
evolutor.GenerateWarnings();          
evolutor.GenerateErrors();          
evolutor.ExecuteScript();          
result = "Evolve success\r\n";          
ExecutedStatements = evolutor.GenerateExecutedStatements();        
foreach (string s in ExecutedStatements)          
  result += s + "\r\n"; 

To fill a database with schema information the first time:

PersistenceMapperAdo2 pmapp
pmapp.CreateDatabaseSchema(YourEcoSpace.GetTypeSystemService(), new DefaultCleanPsConfig(true));