API Reference
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.
Connection Commands
add_connection
Register 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>
update_connection
Update 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>
update_connection_color
Update only the color of a connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
color | number? | New color hue |
Returns: Promise<void>
connect_to_database
Establish an active connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<boolean>
disconnect_from_database
Close the active connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<void>
get_connections
List all configured connections.
Returns: Promise<ConnectionInfo[]>
remove_connection
Delete a connection configuration.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<void>
test_connection
Test connectivity without saving.
Inputs:
| Name | Type | Description |
|---|---|---|
database_info | DatabaseInfo | Details to test |
Returns: Promise<boolean>
initialize_connections
Loads and initializes connections from storage on startup.
Returns: Promise<void>
get_recent_connections
Get recently used connections.
Inputs:
| Name | Type | Description |
|---|---|---|
limit | number? | Max results |
Returns: Promise<ConnectionInfo[]>
get_connection_history
Get 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[]>
Query Commands
start_query
Execute 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)
fetch_query
Get info about a query execution.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<StatementInfo>
fetch_page
Fetch 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>
get_query_status
Check execution status.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<QueryStatus>
get_page_count
Get total pages for a query.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<number>
get_columns
Get column definitions for a query result.
Inputs:
| Name | Type | Description |
|---|---|---|
query_id | number | Query ID |
Returns: Promise<ColumnDef[] | null>
save_query_to_history
Manually 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>
get_query_history
Get history for a specific connection.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | String | Connection ID |
limit | number? | Max items |
Returns: Promise<QueryHistoryEntry[]>
get_recent_queries
Get 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[]>
Script Commands
save_script
Save 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)
update_script
Update 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>
get_scripts
List saved scripts.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid? | Filter by connection |
Returns: Promise<SavedQuery[]>
delete_script
Delete a saved script.
Inputs:
| Name | Type | Description |
|---|---|---|
id | number | Script ID |
Returns: Promise<void>
Setting / Session Commands
save_session_state
Persist UI session state (tabs, etc.).
Inputs:
| Name | Type | Description |
|---|---|---|
session_data | String | JSON string |
Returns: Promise<void>
get_session_state
Retrieve persisted session state.
Returns: Promise<String | null>
get_setting
Get a user preference.
Inputs:
| Name | Type | Description |
|---|---|---|
key | String | Setting key |
Returns: Promise<String | null>
set_setting
Set a user preference.
Inputs:
| Name | Type | Description |
|---|---|---|
key | String | Setting key |
value | String | Value |
Returns: Promise<void>
Mutation Commands
insert_row
Insert 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>
update_cell
Update 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>
delete_rows
Delete 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>
export_table
Export 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)
soft_delete_rows
Perform 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>
undo_soft_delete
Restore 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>
seed_table
Populate 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>
truncate_table
Truncate 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>
truncate_database
Truncate ALL tables.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
schema_name | String? | Target schema (optional) |
confirm | boolean | Safety flag |
Returns: Promise<TruncateResult>
dump_database
Create a database dump.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
output_path | String | Target file path |
Returns: Promise<DumpResult>
execute_batch
Execute multiple raw SQL statements.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
statements | String[] | SQL statements |
Returns: Promise<MutationResult>
Metadata Commands
get_database_schema
Get full schema tree.
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<DatabaseSchema>
get_database_metadata
Get simple metadata (version, size).
Inputs:
| Name | Type | Description |
|---|---|---|
connection_id | Uuid | Connection ID |
Returns: Promise<DatabaseMetadata>
Last updated on