Fix:支持 SQL Server 新增字段设置自增 (#2254)
Co-authored-by: staff <staff@qimaos-MacBook-Pro.local>
This commit is contained in:
1 parent
16a1d4b1dd
commit
ea2b5d1bfd
6 files changed
+170
-20
No files matched your search
@@ -37,4 +37,13 @@ describe("jdbc dialect inference", () => {
|
||||
}),
|
||||
).toBe("iris");
|
||||
});
|
||||
|
||||
it("uses JDBC driver profiles when inferring dialect", () => {
|
||||
expect(
|
||||
inferJdbcDialect({
|
||||
db_type: "jdbc",
|
||||
driver_profile: "sqlserver",
|
||||
}),
|
||||
).toBe("sqlserver");
|
||||
});
|
||||
});
|
||||
@@ -23,7 +23,7 @@ const JDBC_DIALECT_MATCHERS: Array<{ type: DatabaseType; patterns: RegExp[] }> =
|
||||
|
||||
export function inferJdbcDialect(connection?: JdbcDialectConnection): DatabaseType | undefined {
|
||||
if (!connection || connection.db_type !== "jdbc") return undefined;
|
||||
const haystack = [connection.connection_string, connection.jdbc_driver_class, ...(connection.jdbc_driver_paths ?? [])].filter(Boolean).join("\n");
|
||||
const haystack = [connection.driver_profile, connection.connection_string, connection.jdbc_driver_class, ...(connection.jdbc_driver_paths ?? [])].filter(Boolean).join("\n");
|
||||
if (!haystack) return undefined;
|
||||
return JDBC_DIALECT_MATCHERS.find((matcher) => matcher.patterns.some((pattern) => pattern.test(haystack)))?.type;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user