예제 #1
0
		public void Write(Stream outputStream, object artifact)
		{
			SQLModel.Batch batch = artifact as SQLModel.Batch;
			if (artifact == null)
			{
				throw new ArgumentException("SQL Artifact Writer expects an object of type SQLModel.Batch");
			}

			// Emit using TSQLTextEmitter, though in theory we could emit using any emitter, the translator would have to be aware of the dialectic differences as well.
			// Easiest solution would probably be a translator per language type.
			var emitter = new TSQLTextEmitter();
			emitter.UseQuotedIdentifiers = true;

			using (var sw = new StreamWriter(outputStream))
			{
				sw.Write(emitter.Emit(batch));
			}
		}
예제 #2
0
        public void Write(Stream outputStream, object artifact)
        {
            SQLModel.Batch batch = artifact as SQLModel.Batch;
            if (artifact == null)
            {
                throw new ArgumentException("SQL Artifact Writer expects an object of type SQLModel.Batch");
            }

            // Emit using TSQLTextEmitter, though in theory we could emit using any emitter, the translator would have to be aware of the dialectic differences as well.
            // Easiest solution would probably be a translator per language type.
            var emitter = new TSQLTextEmitter();

            emitter.UseQuotedIdentifiers = true;

            using (var sw = new StreamWriter(outputStream))
            {
                sw.Write(emitter.Emit(batch));
            }
        }