Loading documentation…
Preparing this guide.
Complete reference for all Tauri backend commands.
This page documents the complete list of remote procedure calls (RPC) available to the frontend via Tauri's invoke system.
add_connectionRegister a new database connection.
Stable
Inputs:
| Name | Type | Description |
|---|---|---|
name | String | Display name |
database_info | DatabaseInfo | Connection details |
color | number? | UI color hue |
Returns: Promise<ConnectionInfo>
await invoke('add_connection', { name, database_info, color })update_connectionUpdate an existing connection configuration.
Side Effect
May disconnect active session.
Inputs:
| Name | Type | Description |
|---|---|---|
conn_id | Uuid | Connection ID |
name | String | New name |
database_info | DatabaseInfo | New details |
color | number? | New color |
Returns: Promise<ConnectionInfo>
await invoke('update_connection', { conn_id, name, database_info, color })update_connection_colorUpdate only the color of a connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
color | number? | New color hue |
Returns: Promise<void>
await invoke('update_connection_color', { connection_id, color })connect_to_databaseEstablish an active connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<boolean>
await invoke('connect_to_database', { connection_id })disconnect_from_databaseClose the active connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<void>
await invoke('disconnect_from_database', { connection_id })get_connectionsList all configured connections.
Returns: Promise<ConnectionInfo[]>
const conns = await invoke('get_connections')remove_connectionDelete a connection configuration.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<void>
await invoke('remove_connection', { connection_id })test_connectionTest connectivity without saving.
Inputs:
| Name | Type | Description |
|---|---|---|
database_info | DatabaseInfo | Details to test |
Returns: Promise<boolean>
await invoke('test_connection', { database_info })initialize_connectionsLoads and initializes connections from storage on startup.
Returns: Promise<void>
await invoke('initialize_connections')get_recent_connectionsGet recently used connections.
Inputs:
| Name | Type | Description |
|---|---|---|
limit | number? | Max results |
Returns: Promise<ConnectionInfo[]>
await invoke('get_recent_connections', { limit: 5 })get_connection_historyGet historical connection attempts.
Inputs:
| Name | Type | Description |
|---|---|---|
db_type_filter | String? | Filter by DB type |
success_filter | boolean? | Filter by success |
limit | number? | Max results |
Returns: Promise<ConnectionHistoryEntry[]>
await invoke('get_connection_history', { limit: 20 })start_queryExecute a SQL query. Returns partial results immediately if possible or Query IDs.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Active connection |
query | String | SQL string |
Returns: Promise<number[]> (Query IDs)
await invoke('start_query', { connection_id, query })fetch_queryGet info about a query execution.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<StatementInfo>
await invoke('fetch_query', { query_id })fetch_pageFetch a specific page of results.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
page_index | number | Page number |
Returns: Promise<Record<string, any>[] | null>
await invoke('fetch_page', { query_id, page_index: 0 })get_query_statusCheck execution status.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<QueryStatus>
await invoke('get_query_status', { query_id })get_page_countGet total pages for a query.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<number>
await invoke('get_page_count', { query_id })get_columnsGet column definitions for a query result.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<ColumnDef[] | null>
await invoke('get_columns', { query_id })save_query_to_historyManually record a query execution.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | String | Connection ID |
query | String | SQL |
duration_ms | number? | Execution time |
status | String | Result status |
row_count | number | Rows affected |
error_message | String? | Error details |
Returns: Promise<void>
await invoke('save_query_to_history', { ... });get_query_historyGet history for a specific connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | String | Connection ID |
limit | number? | Max items |
Returns: Promise<QueryHistoryEntry[]>
await invoke('get_query_history', { connection_id })get_recent_queriesGet global query history.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | String? | Filter by connection |
limit | number? | Max items |
status_filter | String? | Filter by status |
Returns: Promise<QueryHistoryEntry[]>
await invoke('get_recent_queries', { limit: 50 })save_scriptSave a SQL script.
Inputs:
| Name | Type | Description |
|---|---|---|
name | String | Script name |
content | String | SQL content |
connection_id | Uuid? | Linked connection |
description | String? | Metadata |
Returns: Promise<number> (Script ID)
const id = await invoke('save_script', { name, content })update_scriptUpdate an existing script.
Inputs:
| Name | Type | Description |
|---|---|---|
id | number | Script ID |
name | String | New name |
content | String | New content |
connection_id | Uuid? | Linked connection |
description | String? | Description |
Returns: Promise<void>
await invoke('update_script', { id, name, content })get_scriptsList saved scripts.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid? | Filter by connection |
Returns: Promise<SavedQuery[]>
await invoke('get_scripts')delete_scriptDelete a saved script.
Inputs:
| Name | Type | Description |
|---|---|---|
id | number | Script ID |
Returns: Promise<void>
await invoke('delete_script', { id })save_session_statePersist UI session state (tabs, etc.).
Inputs:
| Name | Type | Description |
|---|---|---|
session_data | String | JSON string |
Returns: Promise<void>
await invoke('save_session_state', { session_data })get_session_stateRetrieve persisted session state.
Returns: Promise<String | null>
await invoke('get_session_state')get_settingGet a user preference.
Inputs:
| Name | Type | Description |
|---|---|---|
key | String | Setting key |
Returns: Promise<String | null>
await invoke('get_setting', { key: 'theme' })set_settingSet a user preference.
Inputs:
| Name | Type | Description |
|---|---|---|
key | String | Setting key |
value | String | Value |
Returns: Promise<void>
await invoke('set_setting', { key: 'theme', value: 'dark' })insert_rowInsert a record.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
row_data | Object | Data |
Returns: Promise<MutationResult>
await invoke('insert_row', { connection_id, table_name, row_data })update_cellUpdate a single cell value.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
primary_key_column | String | PK Column |
primary_key_value | any | PK Value |
column_name | String | Target Column |
new_value | any | New Value |
Returns: Promise<MutationResult>
await invoke('update_cell', { ... });delete_rowsDelete rows by PK.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
primary_key_column | String | PK Column |
primary_key_values | any[] | PK Values |
Returns: Promise<MutationResult>
await invoke('delete_rows', { ... });export_tableExport table data.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
format | ExportFormat | Enum (CSV, JSON, SQL) |
limit | number? | Max rows |
Returns: Promise<String> (Data or Path)
await invoke('export_table', { ... });soft_delete_rowsPerform a soft delete (update flag).
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
primary_key_column | String | PK Column |
primary_key_values | any[] | PK Values |
soft_delete_column | String? | Column to update |
Returns: Promise<SoftDeleteResult>
await invoke('soft_delete_rows', { ... });undo_soft_deleteRestore soft-deleted rows.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
primary_key_column | String | PK Column |
primary_key_values | any[] | PK Values |
soft_delete_column | String | Column to restore |
Returns: Promise<MutationResult>
await invoke('undo_soft_delete', { ... });seed_tablePopulate a table with mock data for testing. All seedable columns (non-PK) will be filled with realistic data based on their type and name.
Experimental
May fail on complex constraints.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Target Table |
schema_name | String? | Target Schema |
count | number | Rows to insert |
Returns: Promise<SeedResult>
await invoke('seed_table', {
connection_id,
table_name: 'users',
count: 100
})truncate_tableTruncate a table.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
table_name | String | Table |
schema_name | String? | Schema |
cascade | boolean? | CASCADE option |
Returns: Promise<TruncateResult>
await invoke('truncate_table', { ... });truncate_databaseTruncate ALL tables.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
schema_name | String? | Target schema (optional) |
confirm | boolean | Safety flag |
Returns: Promise<TruncateResult>
await invoke('truncate_database', { confirm: true, ... });dump_databaseCreate a database dump.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
output_path | String | Target file path |
Returns: Promise<DumpResult>
await invoke('dump_database', { output_path: '/tmp/dump.sql' })execute_batchExecute multiple raw SQL statements.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
statements | String[] | SQL statements |
Returns: Promise<MutationResult>
await invoke('execute_batch', { statements: [...] });get_database_schemaGet full schema tree.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<DatabaseSchema>
await invoke('get_database_schema', { connection_id })get_database_metadataGet simple metadata (version, size).
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<DatabaseMetadata>
await invoke('get_database_metadata', { connection_id })