private string GetSqlFromModel(DbConnection connection)
        {
            var model = ModelBuilder.Build(connection);
            var sqliteSqlGenerator = new SqliteSqlGenerator(DefaultCollation);

            return(sqliteSqlGenerator.Generate(model.StoreModel));
        }
Ejemplo n.º 2
0
        /// <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);

            db.ExecuteSqlCommand(TransactionalBehavior.EnsureTransaction, sql);
        }
 /// <summary>
 /// Creates the SQLite-Database.
 /// </summary>
 public void Create(Database db, DbModel model)
 {
     var sqliteSqlGenerator = new SqliteSqlGenerator();
     string sql = sqliteSqlGenerator.Generate(model.StoreModel);
     db.ExecuteSqlCommand(TransactionalBehavior.EnsureTransaction, sql);
 }