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]>
Цей коміт міститься в:
葛俊таgejun123456 authored and GitHub committed 2026-12-02 14:25:35 +08:00
1 джерело abc5b2b2c6
коміт b7c2d4eacb
201 files changed
+1180 -176

No files matched your search

+19
Переглянути файл
@@ -1293,6 +1293,25 @@ its purpose) and a trusted project. Without the grant the call returns `error::d
An unknown session, a malformed id, a session another task already holds, or a `cwd` that
does not match the recording is an invalid or not-found error, not a fork.
### Database table menus and schema inspection (API 1.20)
With `engines.openidea = "^1.20"`, contribute a command to
`database.table.context` to receive a JSON string `{ "tables": [...] }`.
Each selected table has `sourceId`, nullable `catalog`, `schema`, `table`, `kind`
and `driver`; no connection settings or credentials are passed. Conditions can
use `databaseDriver`, `databaseObjectKind`, `databaseSchema`, `databaseTable`
and `databaseSelectionCount`; each selected table must match.
Declare the separate medium-risk `database.schema` capability and call
`Project::database_table_schema(&DatabaseTableRef)` (`database.describe-table`).
It reads columns, indexes, foreign keys and comments from an already connected
source in a trusted project, including user-created sources. It returns no row
data or credentials and cannot execute SQL or connect sources. Source ownership
management continues to require `database.sources` independently. Requests are
cancellable, bounded by the I/O timeout and limited to 4096 entries per collection.
See the [database guide](../docs/en/plugins/guides/database.mdx) for a complete manifest
and Rust example; generating files additionally requires `project.write`.
### Database sources (API 1.4)
Declare `database.sources` (medium risk). All five calls require it and a
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
385b624ee9593d759a2ce22d4427edc0f06954d0e98f458a77d780e5a3dbe92a
4b1f2303c8b795c11e9c6c57d980005e28b0bdf53a98999175db0d573b38554f
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
1949060673bb04cc457f22af3a3013185da7fe29af593ca3896b6ce1e519819f
3cabfcb916565d4ba98e10c1d935ecd8771e03eade5586a03a387e728d14ae68
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
a1db2b630b6b91b4bad39d7e06f0808a7d50167a49dcc35adc9c77c031df541c
c3dc2b4a769b65efc2958bcceed0249e3fa999f2592441fdf92338d7be61397a
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
cc6bc4b394758a6f7417d44b2ce1cd6444af26533e233850f92027b15a930a0e
22d0cf6590e46fb79d2bd92ab9ef1939d5d7babb0ff7d8d236b62878b6443ade
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
d84518ae53618a8762ba01f2ce1cd5d1edfbb020280543fa0fa4f5d86806fa78
1e9d095de03a7c60a820a88407b384188b55f79d2a231b613e9b8b03c20387b1
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
3c3c05b19ed460c28710e4818b30767904853063179c826fc8ffb0bae5247e5a
013d920f8aaad0ebb44d1a11ef50d27aaedd0614241ce7be4f50eac9e996f986
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
dcbfe5bc29ec9eb87e5ce3d04dd8318ce1a0f072aabbba85e8a1946b9ecac897
f6f54d8c8416bf5d2ab7da51614c044ba3252964ab913c49dfb09c9e6604f750
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
b9244a4dbf041102e2edede46844aff49ffe34df572bc69a9ebd68a8c96aa036
c64b316772ea26ce5e2669025d55ba4af9b9a22f225971f361ee9716ae1cbbd4
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
b76b6599aeb9c7f0b6e7d58b413b7c013a049879af7605ad44de5749fc4734f0
1c40bd1a24c77eade5f617d99b8719e1961979c30a77c613e07d97c1abc5b03f
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
7c4141ad8946f38daec7bc687066a51c63323613382512346eeb8ff1c91ca759
bcf00a07cfc9a894d3effd88a3dbc4d000ac2abc057358db1afe17f9fde93710
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
d20b93d3e426f9b1ec99e7d1f284c3c7b22bf2cb367ae30fb4915c18d025697a
811e77cd9740eecd4007f1104343b6d0943920160a5ab7c41018c932ab5148f6
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
001fb007580783881f2c7fe08121796d930db6fc0aeb82a6fbb077028355f5dc
cef63193655a8fe67397b6cc7c60a082cd0feddea6a7516d8a77c5feb15d5588
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
9c6070c56d9aef747cb91ffa336727273ae3e6124dabf939a08e18123acc2ea7
845c85070a383baa9b28c451175273db83a0f11c14a089cd4ec39eeb302f9e7c
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
923fa9c58a1d934b8053aeaed6672fbe294c2ebfa69434f8f42758ff4f60624e
48f302f820ec837bace09a3299d8d3835314445c7da0c12f2f2c49559655832f
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
847ea10dc57fc7062eb680c768d284502c33a78a1ce2783ed6d9fe27078f1c46
f59fcefbb81a5df556fb806ffc824460f24d0935c2a60e72889ed0124ae62a3c