Skip to content

Commit 21e92f4

Browse files
authored
Merge pull request #1098 from yuguoqiang/master
fix #1097 SqlDriver: Database type mssql is not supported
2 parents 5d1c1c1 + c80e8ca commit 21e92f4

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Plugins/BotSharp.Plugin.SqlDriver/Functions/ExecuteQueryFn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3333
var results = dbType.ToLower() switch
3434
{
3535
"mysql" => RunQueryInMySql(args.SqlStatements),
36-
"sqlserver" => RunQueryInSqlServer(args.SqlStatements),
36+
"sqlserver" or "mssql" => RunQueryInSqlServer(args.SqlStatements),
3737
"redshift" => RunQueryInRedshift(args.SqlStatements),
3838
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
3939
};

src/Plugins/BotSharp.Plugin.SqlDriver/Functions/GetTableDefinitionFn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3737
var tableDdls = dbType switch
3838
{
3939
"mysql" => GetDdlFromMySql(tables),
40-
"sqlserver" => GetDdlFromSqlServer(tables),
40+
"sqlserver" or "mssql" => GetDdlFromSqlServer(tables),
4141
"redshift" => GetDdlFromRedshift(tables),
4242
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
4343
};

src/Plugins/BotSharp.Plugin.SqlDriver/Functions/SqlSelect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3232
var result = dbType switch
3333
{
3434
"mysql" => RunQueryInMySql(args),
35-
"sqlserver" => RunQueryInSqlServer(args),
35+
"sqlserver" or "mssql" => RunQueryInSqlServer(args),
3636
"redshift" => RunQueryInRedshift(args),
3737
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
3838
};

src/Plugins/BotSharp.Plugin.SqlDriver/Functions/SqlValidateFn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3434
var validateSql = dbType.ToLower() switch
3535
{
3636
"mysql" => $"EXPLAIN\r\n{sql.Replace("SET ", "-- SET ", StringComparison.InvariantCultureIgnoreCase).Replace(";", "; EXPLAIN ").TrimEnd("EXPLAIN ".ToCharArray())}",
37-
"sqlserver" => $"SET PARSEONLY ON;\r\n{sql}\r\nSET PARSEONLY OFF;",
37+
"sqlserver" or "mssql" => $"SET PARSEONLY ON;\r\n{sql}\r\nSET PARSEONLY OFF;",
3838
"redshift" => $"explain\r\n{sql}",
3939
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
4040
};

src/Plugins/BotSharp.Plugin.SqlDriver/UtilFunctions/GetTableDefinitionFn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3131
var tableDdls = dbType switch
3232
{
3333
"mysql" => GetDdlFromMySql(tables),
34-
"sqlserver" => GetDdlFromSqlServer(tables),
34+
"sqlserver" or "mssql" => GetDdlFromSqlServer(tables),
3535
"redshift" => GetDdlFromRedshift(tables,schema),
3636
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
3737
};

src/Plugins/BotSharp.Plugin.SqlDriver/UtilFunctions/SqlSelect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task<bool> Execute(RoleDialogModel message)
3030
var result = dbType switch
3131
{
3232
"mysql" => RunQueryInMySql(args),
33-
"sqlserver" => RunQueryInSqlServer(args),
33+
"sqlserver" or "mssql" => RunQueryInSqlServer(args),
3434
"redshift" => RunQueryInRedshift(args),
3535
_ => throw new NotImplementedException($"Database type {dbType} is not supported.")
3636
};

0 commit comments

Comments
 (0)