CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

trysac/personal-data-map

Map personal data in SQL schemas: parse CREATE TABLE, classify columns by name, flag special categories and tables linked to people by foreign keys. Use when the user asks for a personal data inventory or privacy review of a schema.

Quality

94%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files
name:
personal-data-map
description:
Map personal data in SQL schemas: parse CREATE TABLE, classify columns by name, flag special categories and tables linked to people by foreign keys. Use when the user asks for a personal data inventory or privacy review of a schema.

Personal data map

Builds an inventory of personal data from SQL DDL alone. It reads a schema file, never connects to a database, makes no network calls and needs only Python 3.10+ and the standard library.

When to use

  • The user wants to know which tables and columns of a schema hold personal data.
  • Preparing a privacy review or a data inventory from migrations or a schema.sql dump.
  • Checking whether a schema stores special-category data (health, religion, biometrics and similar).

Steps

  1. Locate the schema as one SQL file (a dump, or migrations concatenated in order). Only CREATE TABLE statements are read; other statements are skipped.

  2. Run the mapper:

    python scripts/personal_data_map.py schema.sql --format markdown
    python scripts/personal_data_map.py schema.sql --format json --fail-on special_category

    --fail-on CATEGORY (repeatable) exits with code 1 when any column has that category.

  3. Read the result. Each classified column has a category; each table has a role. Categories, roles and matching rules are in rules.

  4. Review the result with the user using the review checklist: the mapper sees column names only, so some columns are missed and some are matched by coincidence.

  5. Present the table, list special-category tables separately, and state the limits. This output supports an inventory; it is not legal advice or a compliance determination.

Exit codes

0 success, 1 a --fail-on category was found or the schema could not be parsed (message on stderr), 2 usage error or unreadable file.

Scope

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [schema.]name (...) with column-level and table-level REFERENCES / FOREIGN KEY. Input over 5,242,880 bytes, more than 2000 tables or parentheses nested deeper than 32 levels are rejected. Classification uses column names only, never data values.

Workspace
trysac
Visibility
Public
Created
Last updated
Source
CLI
Repository
No repository linked. Set repository in the plugin manifest, or publish from a GitHub Action to verify it.
Badge
trysac/personal-data-map badge