← PlanetScaleCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
Update to PlanetScale
Snapshot Sep 30, 2026 · 23:11 UTC · version 1.0.0
Collection source: not recorded for this historical snapshot.
First saved snapshot
No earlier snapshot is available to establish a change.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"name": "codebase-sqlcommenter-instrumentation",
"description": "Inspect an application repository connected to PlanetScale and recommend SQLCommenter-compatible query tagging packages and conventions.",
"included_files": [],
"skill_md_contents": "---\nname: codebase-sqlcommenter-instrumentation\ndescription: Inspect an application repository connected to PlanetScale and recommend SQLCommenter-compatible query tagging packages and conventions.\n---\n\n# Codebase SQLCommenter instrumentation\n\n## Purpose\n\nInspect the application repository connected to PlanetScale and recommend the correct SQLCommenter-style instrumentation so PlanetScale Insights and Postgres Traffic Control can attribute queries to application code paths. Do not edit files or install dependencies without approval.\n\n## Repository inspection\n\nIdentify:\n\n- Language and framework.\n- ORM or query builder.\n- Database adapter.\n- Migration tool.\n- Background job system.\n- Routing framework.\n- Deployment metadata source, such as git SHA or release ID.\n- Existing SQL comments, query tags, tracing, OpenTelemetry, or database middleware.\n- PlanetScale connection configuration.\n- Whether the repository connects to Vitess, Postgres, or both.\n\n## Recommended package mapping\n\nUse the most native maintained option for the detected stack.\n\n### Ruby on Rails / ActiveRecord\n\nPreferred for PlanetScale tag compatibility:\n\n- `activerecord-sql_commenter` from PlanetScale when Rails query comments need SQLCommenter format for PlanetScale Query Insights.\n\nOther options:\n\n- Rails built-in query logs when sufficient and compatible with the target database/Insights behavior.\n- `marginalia` for older Rails or when Basecamp-style ActiveRecord query attribution is already in use.\n- `sqlcommenter_rails` where the project already uses the OpenTelemetry SQLCommenter ecosystem.\n\nRecommend tags:\n\n- `application`\n- `controller`\n- `action`\n- `job`\n- `route`\n- `release_sha`\n\n### Laravel / PHP\n\nPreferred:\n\n- `spatie/laravel-sql-commenter` for SQLCommenter-format comments compatible with PlanetScale Query Insights.\n\nRecommend tags:\n\n- `application`\n- `route`\n- `controller`\n- `action`\n- `job`\n- `queue`\n- `release_sha`\n\n### Prisma / TypeScript / JavaScript\n\nPreferred:\n\n- Prisma’s first-party SQL comments packages when Prisma is detected:\n - `@prisma/sqlcommenter`\n - `@prisma/sqlcommenter-query-tags`\n - `@prisma/sqlcommenter-trace-context`\n\nNote: PlanetScale’s Postgres query-tag docs may list Prisma as lacking official SQLCommenter support, but Prisma’s own current docs provide first-party SQLCommenter packages. Prefer current Prisma docs when Prisma is detected.\n\nRecommend tags:\n\n- `application`\n- `service`\n- `route`\n- `operation`\n- `feature`\n- `release_sha`\n\n### Knex / Sequelize / Express / Node\n\nUse SQLCommenter-compatible middleware or instrumentation from the OpenTelemetry SQLCommenter ecosystem where maintained and compatible.\n\nRecommend tags:\n\n- `application`\n- `service`\n- `route`\n- `controller`\n- `action`\n- `feature`\n- `release_sha`\n\n### Kysely / Drizzle / Bun / custom query builders\n\nIf there is no maintained SQLCommenter package, recommend manual tagging at the database client boundary or query builder extension layer.\n\nRequirements:\n\n- Tags must be structured SQL comments.\n- Tags must be inserted before the statement terminator.\n- Tags must survive ORM, proxy, and pooler behavior.\n- Values must be URL encoded and safe for SQL comments.\n- Tags must be low-cardinality.\n\n### Django / SQLAlchemy / psycopg2 / Flask / Python\n\nUse SQLCommenter instrumentation from the OpenTelemetry SQLCommenter ecosystem where compatible.\n\nRecommend tags:\n\n- `application`\n- `framework`\n- `route`\n- `view`\n- `job`\n- `release_sha`\n\n### Java / Hibernate / Spring\n\nUse SQLCommenter-compatible instrumentation for Hibernate/Spring where compatible.\n\nRecommend tags:\n\n- `application`\n- `service`\n- `controller`\n- `action`\n- `route`\n- `release_sha`\n\n### Go / database/sql / net/http / gorilla/mux\n\nUse SQLCommenter-compatible instrumentation or a database wrapper at the query boundary.\n\nRecommend tags:\n\n- `application`\n- `service`\n- `handler`\n- `route`\n- `job`\n- `release_sha`\n\n## Standard tag policy\n\nRecommend this baseline across all frameworks:\n\n- Stable, bounded values only.\n- Normalize routes before tagging.\n- Include app/service/job attribution.\n- Include deploy SHA.\n- Include source type for agents, scripts, BI, workers, and integrations.\n- Do not include secrets, PII, user IDs, request IDs, raw tenant IDs, or raw URLs.\n\n## Validation plan\n\nBefore recommending merge:\n\n- Confirm generated SQL comments appear in local/staging query logs.\n- Confirm comments survive the ORM, driver, pooler, and PlanetScale connection path.\n- Confirm Insights displays tags.\n- Confirm tag cardinality is bounded.\n- Confirm Traffic Control can match the intended tags for Postgres.\n- Confirm no sensitive data is present.\n\n## Output\n\nReturn:\n\n- Detected stack.\n- Current query tagging state.\n- Recommended package or manual instrumentation path.\n- Proposed tag schema.\n- Files likely to change.\n- Validation steps.\n- Risks.\n- Proposed changes requiring approval.\n\nEnd with:\n\n“No repository files or dependencies have been changed.”\n"
}SHA-256: 17cc6e7731687a72712126929f762eb5d2038f14cf162283da78e0616d6d0455