private string GetSqlFromModel(DbConnection connection) { var model = ModelBuilder.Build(connection); var sqliteSqlGenerator = new SqliteSqlGenerator(); return(sqliteSqlGenerator.Generate(model.StoreModel)); }
/// <summary> /// Creates the SQLite-Database. /// </summary> public void Create(Database db, DbModel model) { if (db == null) { throw new ArgumentNullException("db"); } if (model == null) { throw new ArgumentNullException("model"); } var sqliteSqlGenerator = new SqliteSqlGenerator(); string sql = sqliteSqlGenerator.Generate(model.StoreModel); Debug.Write(sql); db.ExecuteSqlCommand(TransactionalBehavior.EnsureTransaction, sql); }