Example #1
0
        public override int Run(string[] args)
        {
            string schemaFileName = args[0];

            XmlTextReader xr = new XmlTextReader(schemaFileName);
            SchemaInfo schemaInfo = SchemaManager.ReadAndValidateSchema(xr, Path.GetDirectoryName(schemaFileName));

            SqlDataSource sds = new SqlDataSource(schemaInfo.GetDataSourceInfo("default"));
            //sds.SqlBuilder = new SqlServerBuilder();
            sds.GenerateDdlForSchema(schemaInfo, Console.Out);
            return 0;
        }
 protected string SoqlToSql(SoqlQueryExpression expr, SqlDataSource ds)
 {
     using (StringWriter sw1 = new StringWriter())
     {
         SoqlToSqlConverter converter = new SoqlToSqlConverter(sw1, this.DatabaseSchema, ds.SqlBuilder);
         log.Trace("Converting: {0}", expr);
         converter.ConvertQuery(expr);
         log.Trace("Converted: {0}", sw1);
         return sw1.ToString();
     }
 }