lu-query-explore-schema
Skill2 starsChanged 29 days agoMITView on GitHub
Use lu-query to explore an unknown Oracle database - discover schemas, tables, views, indexes, constraints, triggers, procedures, sequences and partitions, read an object's DDL, and map dependencies with Mermaid graphs. Start here before writing any SQL against an unfamiliar schema. Covers 31 metadata and graph tools.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- constraint-driven-developmentSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grill-meSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- prSkill
- security-and-hardeningSkill
- setup-matt-pocock-skillsSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- to-specSkill
- to-ticketsSkill
- using-agent-skillsSkill
- wayfinderSkill
- writing-for-agentsSkill
- lu-query-audit-data-qualitySkill
- lu-query-audit-reportSkill
- lu-query-benchmark-sqlSkill
- lu-query-manage-schemaSkill
- lu-query-plan-data-changesSkill
- lu-query-query-dataSkill
- lu-query-triage-incidentSkill
- lu-query-tune-sqlSkill
- lu-query-use-plsqlSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Every object-scoped tool resolves the owner in this order, and stops at the first hit:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Explore an Oracle schema with lu-query
When to use
- You do not know the schema: "which table holds orders?", "what columns does
SKL_EMPhave?", "what breaks if I drop this?" - You need the exact DDL of an object before changing it.
- You need to see relationships: foreign keys, object dependencies.
When not to use
- You already know the table and want rows → lu-query-query-data.
- You want to change structure → lu-query-manage-schema.
- You want to call a procedure → lu-query-use-plsql.
Workflow
- Ground yourself.
test_connection→ confirm database name, current user and current schema. Everything else is relative to that. - Find objects by name pattern.
search_objects(any type) orlist_tables/list_views(withnamePattern, e.g.SKL%). They resolve the session schema on their own; passschemaonly to target another owner. - Describe the object.
describe_tablefor columns/nullability/defaults/comments,get_ddlfor the full source, or read the resourceoracle://schema/{schema}/table/{table}for a formatted column report andoracle://schema/{schema}/object/{object}/ddlfor DDL. - Inspect structure.
list_indexes,list_constraints,list_partitions,list_triggers,list_sequences/get_sequence_info,list_types. - Check for damage.
list_invalid_objects(statusINVALID= broken code) andget_plsql_errorsfor the compilation message. - Map relationships.
get_fk_graph(foreign keys) andget_dependency_graph(what an object needs / who needs it). Both return amermaidfield you can render or paste. - Confirm existence cheaply.
table_existsreturns a baretrue/false(views do not count).
Schema resolution (verified)
Every object-scoped tool resolves the owner in this order, and stops at the first hit:
- the
schemaargument of the call; ORACLE_DB_SCHEMAon the server;- the session's own
CURRENT_SCHEMA(SYS_CONTEXT('USERENV','CURRENT_SCHEMA')) - the owner you are connected as.
So with neither ORACLE_DB_SCHEMA nor a schema argument, describe_table, count_rows, get_table_stats, every catalog tool with table and every DDL tool still work: they read the session schema. (Verified 2026-10-18 on 2.16.3. Before that the session fallback was broken and they failed with "needs a schema".)
Pass schema only to target an owner other than the one you are connected as.
A blank schema (" ") is not an owner: it falls through to the next step of the order above. To know the owner you are connected as, read currentSchema from test_connection.
Tool reference
| Tool | Use for |
test_connection | connectivity, version, current user/schema |
list_schemas | users visible to the connection |
list_tables / list_views | tables / views, optional schema, namePattern |
search_objects | any object type by pattern (returns OBJECT_TYPE, STATUS) |
list_objects | objects filtered by type |
describe_table | columns, types, nullability, defaults, comments |
table_exists | boolean existence check |
get_ddl | DDL of any object (type inferred when omitted on the resource, required here) |
list_indexes, list_constraints, list_partitions, list_ind_partitions, list_subpartitions | physical and logical structure |
list_sequences, get_sequence_info | sequence range, cache, last number |
list_triggers, list_procedures, list_types, list_synonyms, list_lob_columns | code and type objects |
list_db_links, list_directories, list_external_tables, list_materialized_views, list_mview_logs | objects outside the local tablespace |
list_invalid_objects, list_dependencies, list_scheduler_jobs, list_scheduler_job_runs | breakage and automation |
Full signatures, output shapes and gotchas: references/tools.md.
Verified transcripts: references/examples.md.
Reading results correctly
- Column types arrive as Oracle renders them:
NUMBER(6,),NUMBER(10,2),TIMESTAMP(6). The trailing comma inNUMBER(precision,)is cosmetic. - Dates in JSON are ISO strings with a
Zsuffix (2024-01-15T06:00:00.000Z);DATEcolumns are converted to UTC instants - that is the client's serialisation, not the stored local time. STATUS: VALIDvsINVALIDonsearch_objectsis about compilable code, not permissions.
Safety
This skill is read-only. It never mutates. Keep it that way: do not follow an exploration with a DDL call unless the user asked for the change.
Evidence
Quote the tool call and the rows you relied on. Every call lands in the session audit Markdown; oracle://audit/session/current returns the file for the running session.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

