дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
feat(plugins): expose database table menus and read-only schema (#7372)
Plugin API 1.20 adds wit/database.wit with describe-table behind the database.schema capability: a read-only view of a connected source's table (columns, keys, indexes) through DbManager::connected_table_details. Plugins can contribute database.table.context menu entries (needs_api 20) that receive the non-secret table identity and the when keys databaseDriver, databaseObjectKind, databaseSchema, databaseTable and databaseSelectionCount. Co-authored-by: gejun123456 <[email protected]>
Цей коміт міститься в:
1 джерело
abc5b2b2c6
коміт
b7c2d4eacb
201 files changed
+1180
-176
No files matched your search
+39
-1
@@ -1,4 +1,4 @@
|
||||
package openidea:plugin@1.19.0;
|
||||
package openidea:plugin@1.20.0;
|
||||
|
||||
/// Plugin-owned project data sources. Requires database.sources and project trust.
|
||||
/// Runs on the Database subsystem's host, including on remote project servers.
|
||||
@@ -31,4 +31,42 @@ interface database {
|
||||
/// Requests the project's usual connection/introspection in the invoking window.
|
||||
/// Invalid outside a command/event of that project's window.
|
||||
connect: func(project: borrow<project>, id: string) -> result<_, error>;
|
||||
|
||||
/// A table/view in an already connected data source of this project (API 1.20).
|
||||
/// source-id is the host's connection target id, including its database suffix.
|
||||
record table-ref {
|
||||
source-id: string,
|
||||
catalog: option<string>,
|
||||
schema: string,
|
||||
table: string,
|
||||
}
|
||||
record column-schema {
|
||||
name: string,
|
||||
data-type: string,
|
||||
nullable: bool,
|
||||
default-value: option<string>,
|
||||
primary-key: bool,
|
||||
comment: option<string>,
|
||||
}
|
||||
record index-schema {
|
||||
name: string,
|
||||
unique: bool,
|
||||
columns: list<string>,
|
||||
}
|
||||
record foreign-key-schema {
|
||||
columns: list<string>,
|
||||
referenced-schema: string,
|
||||
referenced-table: string,
|
||||
referenced-columns: list<string>,
|
||||
}
|
||||
record table-schema {
|
||||
comment: option<string>,
|
||||
columns: list<column-schema>,
|
||||
indexes: list<index-schema>,
|
||||
foreign-keys: list<foreign-key-schema>,
|
||||
}
|
||||
/// Read metadata of any already connected project source, including user-owned
|
||||
/// sources. Requires the separate database.schema grant and a trusted project.
|
||||
/// Never connects a source, returns credentials/rows, or executes caller SQL.
|
||||
describe-table: func(project: borrow<project>, table: table-ref) -> result<table-schema, error>;
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача