дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
feat(db): add Microsoft SQL Server driver support (#276)
The database tool window can connect to Microsoft SQL Server (tiberius over rustls with a bb8 pool): browse schema objects, edit table data, run queries and view plans; SQL Server dialect, object dialogs and icons in the UI. Values are rendered by column type: exact decimal/numeric, money with four decimals, tinyint, uniqueidentifier, date/time/datetime/datetime2/smalldatetime/datetimeoffset in ISO form, xml and binary. Multi-statement edits roll back on any failure and discard the connection rather than returning it to the pool mid-transaction; connect-time errors (login, database) are reported; result pagination reports more rows; cancelling a query stops reading and drops the stream. The sqlx drivers keep the shared with_pool! path. Co-authored-by: dimassfeb-09 <[email protected]>
Цей коміт міститься в:
1 джерело
d1f84ef364
коміт
3a1e47d872
20 files changed
+974
-43
No files matched your search
@@ -154,6 +154,29 @@ export const DATA_TYPES: Record<DbDriver, string[]> = {
|
||||
"BOOLEAN",
|
||||
"ENUM",
|
||||
],
|
||||
sqlServer: [
|
||||
"INT",
|
||||
"BIGINT",
|
||||
"SMALLINT",
|
||||
"TINYINT",
|
||||
"VARCHAR",
|
||||
"NVARCHAR",
|
||||
"CHAR",
|
||||
"NCHAR",
|
||||
"TEXT",
|
||||
"NTEXT",
|
||||
"DECIMAL",
|
||||
"FLOAT",
|
||||
"REAL",
|
||||
"DATE",
|
||||
"DATETIME",
|
||||
"DATETIME2",
|
||||
"TIME",
|
||||
"UNIQUEIDENTIFIER",
|
||||
"BIT",
|
||||
"VARBINARY",
|
||||
"XML",
|
||||
],
|
||||
};
|
||||
|
||||
const f = (name: string, params: string, returns?: string, aggregate?: boolean): SqlFunction => ({
|
||||
@@ -260,6 +283,20 @@ const FUNCTIONS: Record<DbDriver, SqlFunction[]> = {
|
||||
f("row_number", "", "bigint"),
|
||||
f("rank", "", "bigint"),
|
||||
],
|
||||
sqlServer: [
|
||||
...COMMON,
|
||||
f("getdate", "", "datetime"),
|
||||
f("getutcdate", "", "datetime"),
|
||||
f("dateadd", "part, n, date", "datetime"),
|
||||
f("datediff", "part, a, b", "int"),
|
||||
f("isnull", "a, b"),
|
||||
f("iif", "cond, then, else"),
|
||||
f("concat", "value, ...", "text"),
|
||||
f("format", "value, format", "text"),
|
||||
f("newid", "", "uniqueidentifier"),
|
||||
f("row_number", "", "bigint"),
|
||||
f("rank", "", "bigint"),
|
||||
],
|
||||
};
|
||||
|
||||
export function functions(driver: DbDriver): SqlFunction[] {
|
||||
|
||||
Reference in new issue
Заблокувати користувача