Example #1
0
        public void DropAll(
            [Option(LongName = "connectionString", ShortName = "c")]
            string connectionString,
            [Option(LongName = "sqlType", ShortName = "t")]
            string sqlType
            )
        {
            var version = SqlEngineVersions.GetVersion(sqlType);

            var connString = new NamedConnectionString("", version.ProviderName, connectionString, version.VersionString);

            var context = CreateContext(version);

            var generator = SqlGeneratorFactory.CreateGenerator(version, context);

            var executer = SqlExecuterFactory.CreateSqlExecuter(connString, generator);
            var dc       = new DatabaseCreator(null, executer);

            dc.DropAllViews();
            dc.DropAllForeignKeys();
            dc.DropAllTables();
            // TODO needs databasedefinition
            // dc.DropAllSchemas();
        }