API to parse/split GO statements into batches
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
まず、issue に記載されている既存の Microsoft.SqlServer.Management.Common.ExecuteBatch と GetStatements の使用方法、および issue 4 にリンクされた議論を確認します。GO 20、コメント、複数行文字列を含め、T-SQL をバッチに分割するためにサポートされるパブリック API を定義し、その結果が想定される SQL Management Studio の動作と一致することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Per comment on another issue I am opening this to ask for an API in similar effect to this wrapped function:
/// <summary>
/// Split/Parse a TSQL string into batches by the "GO" statement.
/// Mirrors SQL Management Studio's parsing (because it is the same)
/// </summary>
public static List<string> ParseSQLBatches(string tsql)
{
var batchParser = new Microsoft.SqlServer.Management.Common.ExecuteBatch();
var ret = batchParser.GetStatements(tsql);
return ret.Cast<string>().ToList();
}
The reasoning behind this is that we have scripts written by us for schema/data migrations that commonly utilize GO statements in many ways. We can't easily rely on a simplified "Split on bare GO statements outside of comments" due to sometimes having GO 20 or other such fun things, or multi-line strings etc that might have GO in them for unrelated reasons. Although we could write a parser, that SMO provided one that out of the box (as far as we noticed) was identical to SSMS's was very convenient for us. It seems that this exposed class/api that we were relying on was an implementation detail/surface that is going away in an upcoming release. So the ask here is to facilitate at least this minimal API of "given TSQL string, here it is split-and-duplicated-etc into individual batches".
- 主要言語
- C#
- スター
- 143
- フォーク
- 28
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/sqlmanagementobjects のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 74/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/sqlmanagementobjects の issue をすべて見る
似ている issue
-
untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
newrelic/newrelic-dotnet-agent#3850 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
LuckyPennySoftware/AutoMapper#4660 ·