/jb-db-parser:jb-db-parserfrom jb-db-parser
Load the database metadata a JetBrains IDE (DataGrip, IntelliJ IDEA Ultimate, PyCharm Professional and others) has introspected - databases, schemas, tables, views, columns, keys, foreign keys, indexes, view and routine source - into a SQLite file and query it. Use when asked about the structure of a database that a JetBrains data source points at, when writing SQL against such a database without a live connection, or when the user mentions .idea/dataSources, DataGrip metadata, or the IDE's database schema cache.
Ships in jb-db-parser. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A JetBrains IDE with the Database Tools plugin introspects each data source and keeps the result on disk. The result is not DDL text. It is an XML object model ("dbm" serializer): one element per database object, linked to its parent by id. The script flattens every model it finds into one SQLite file, then answers SQL queries against that file. No database connection is used. The data is as current as the IDE's last introspection.
Project data sources are in the project's .idea directory:
dataSources.xml — one <data-source name uuid> per connection, with <driver-ref> and <jdbc-url>.dataSources.local.xml — per-user settings such as the introspection scope.dataSources directory holds <uuid>.xml, the introspected model for that data source.storage_v2 directory in the <uuid> directory beside it holds the source text of views, routines and triggers. Each source file has a .meta file beside it that holds the object name on a #n: line.Global data sources (shared by all projects) are in the IDE configuration directory, for example DataGrip2025.2. Its options directory holds their dataSources.xml. Their model files are below the configuration directory.
The locate command prints each IDE configuration directory and each DataGrip project that has data sources. The script finds them for the current operating system:
uv run "${CLAUDE_SKILL_DIR}/scripts/jb_db_parser.py" locate
The files exist only on the computer that runs the IDE. In a cloud session, attach that computer first.
Build the SQLite file. Each path is an .idea directory, an IDE configuration directory, or one model file. Pass the paths that locate printed, or a project's .idea directory:
uv run "${CLAUDE_SKILL_DIR}/scripts/jb_db_parser.py" build "<PATH>" [<PATH> ...] [--out <FILE>]
The build prints the path of the file it wrote, each data source it found and a count of objects per kind. By default it writes metadata.sqlite in the .claude directory of the working directory, in a jb-db directory. A build replaces the file. Do not pass a home directory as a path: discovery reads every *.xml below each path.
Print the DDL of every table and view in the file:
uv run "${CLAUDE_SKILL_DIR}/scripts/jb_db_parser.py" schema "<FILE>"
Query the file with any SQLite client, for example the sqlite3 command. Open it read-only.
The script uses SQLAlchemy 2.1. The build writes in WAL mode with foreign keys on. For work that SQL alone does not suit, import the ORM models (DataSource, DbObject, Prop, SourceText) from the script. DbObject has parent, children, data_source, and values, a dictionary of its properties.
Base tables. Every table is STRICT, and every foreign key is enforced:
data_sources — one row per data source: integer id, key (the uuid), name, rdbms, format_version, driver, jdbc_url, and the files it came from.objects — one row per model element: data_source_id, model_id (the id in the XML), parent_id (the parent row's id), kind (the XML element name), name, the nearest database and schema, and path (names from the top down, joined with .).props — one row per property of an object: object_id, key is the child element name (DataType, NotNull, ColNames, Comment, ...), value is its text.sources — stored source text of views, routines and triggers, with kind taken from the directory name.Views for common questions. Each view has a data_source column that holds the data source key:
v_relations — tables, views, materialized views and foreign tables, with comments.v_columns — columns with position, data_type, not_null, default_expression, comment.v_constraints — keys, foreign keys, indexes and checks, with columns, is_primary, is_unique, ref_relation, ref_columns, predicate.v_foreign_keys — foreign keys only. ref_schema falls back to the owning schema.Example queries:
SELECT relation, column_name, data_type, not_null FROM v_columns
WHERE schema = 'public' AND relation = 'orders' ORDER BY position;
SELECT relation, columns, ref_relation, ref_columns FROM v_foreign_keys
WHERE ref_relation = 'customers';
SELECT kind, name, path FROM objects WHERE name LIKE '%invoice%';
SELECT key, value FROM props WHERE object_id = (
SELECT id FROM objects WHERE kind = 'table' AND name = 'orders');
DataType holds the type followed by | and a flag, for example varchar(80)|0s. The views drop the part after |. props keeps it.ColNames and RefColNames separate names with a newline. The views join them with , .1.SELECT kind, count(*) FROM objects GROUP BY kind;
SELECT DISTINCT o.kind, p.key FROM props p JOIN objects o ON o.id = p.object_id ORDER BY 1, 2;
dataSources.local.xml, not that the object does not exist. Say so when it matters.<uuid>.corrupted.<timestamp>.xml are backups and are skipped.Report answers from the query results. Do not paste whole result sets back to the user unless asked.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub estasney/agent-skills --plugin jb-db-parser