Reference
All 55 tools
You don't call these yourself. Your assistant picks them while answering you. This is what each one does, so you know what it can and can't do for you.
Explore the schema
Find the right tables before any SQL is written, so the assistant works from what exists, not from guesses.
orientGives a one-call overview of the whole database.search_schemaFinds tables, views and functions that match your words.inspect_or_searchSearches and describes the matches in one step.describe_objectShows one table or view in full: columns, types, keys and indexes.get_join_pathWorks out how two tables connect.sample_valuesShows a handful of real values from one column.get_ddlReturns the definition of a table, view, function or index.list_schemasLists the schemas in the current database.list_objectsLists the tables and views in a schema.find_missing_fksSpots columns that look like foreign keys but aren't declared as one.
Ask with SQL
Run read-only queries, get results in the shape you need, and understand why a query is slow.
run_selectRuns a read-only query and returns the rows.explain_queryShows how Postgres plans to run a query, without running it.export_queryRuns a query and formats the result as CSV, JSON or INSERT statements.deep_plan_analysisRuns a query with timing and explains where the time goes.auto_tune_querySuggests step-by-step fixes for a slow query.
Connections
Add databases, move between them, and find which one holds the data, with passwords kept out of the chat.
add_databaseConnects another database without the password passing through the chat.list_connectionsLists the saved connections.get_current_contextSays which connection and database the session is using.switch_connectionMoves the session to another connection or database.list_databasesLists the databases on a server.search_all_databasesFinds which database holds a table, across every connection.resolve_targetPicks the right connection from a hint like "staging" or a table name.setup_connectionDetects or creates a connection from what's already on your machine.save_profileSaves or updates a connection profile.test_profileChecks that a connection works.export_profileProduces a shareable config with every secret stripped.import_profileImports a team config into your own.
Health and performance
See how the database is doing, what's slow, what's stuck, and which indexes help or hurt.
db_dashboardGives a live snapshot of the database in one call.db_health_checkChecks for common problems and reports them.table_statsShows size and activity for one table.index_usageShows how often each index on a table is used.list_running_queriesLists the queries running right now.find_blocking_locksFinds which queries are stuck and who is blocking them.slow_queriesLists the slowest queries the database has seen.suggest_indexesSuggests indexes that would likely help.find_unused_indexesLists indexes that have never been used.bloat_reportEstimates which tables carry the most dead rows.server_settingsShows the server settings that matter most.list_extensionsLists installed extensions.list_rolesLists database roles, or one role's memberships and privileges.
Changes and migrations
Plan schema changes safely, and, only when you allow it, change data and run maintenance.
schema_diffCompares two schemas in the same database.generate_migrationWrites the SQL to turn one schema into another.check_ddl_safetyWarns about schema changes that would lock or rewrite a table.execute_sqlRuns an INSERT, UPDATE or DELETE.Needs write modeedit_rowInserts, updates or deletes one row by its primary key.Needs write modeimport_dataInserts many rows from a list.Needs write modeapply_ddlRuns a schema change: CREATE, ALTER, DROP, TRUNCATE.Needs admin modecreate_index_concurrentlyBuilds an index without blocking writes.Needs admin moderun_maintenanceRuns VACUUM, ANALYZE or REINDEX.Needs admin modeterminate_queryCancels or ends a running query by its pid.Needs admin mode
NexQL itself
Look after the schema index, check the setup, and load more tools when the assistant needs them.
run_doctorChecks the connection, permissions and index, and reports problems.get_index_statusSays when the schema index was built and whether it's out of date.rebuild_indexRebuilds the schema index from scratch.refresh_indexUpdates the schema index using the last build's settings.discover_toolsFinds and loads more tools on demand.
No tool matches. Try a shorter word.