Skip to content

docs(indexer): use the real table names in the README - #318

Open
O1sumitkumar wants to merge 1 commit into
prism-explorer:mainfrom
O1sumitkumar:docs/indexer-table-names
Open

O1sumitkumar wants to merge 1 commit into
prism-explorer:mainfrom
O1sumitkumar:docs/indexer-table-names

Conversation

@O1sumitkumar

Copy link
Copy Markdown

Summary

The "Tables" section of indexer/README.md listed snake_case names (indexer_cursor, invocations, contracts, storage_changes, …). The schema has no @@map, so Prisma creates the tables under the model names, and querying the documented names fails with relation "..." does not exist.

This PR:

  • renames each heading to the real table name: "IndexerCursor", "Invocation", "Contract", "BackfillCursor", "StorageChange", "ContractEventRecord", "IndexerGap";
  • adds a short note and example query showing that the names (and the camelCase columns) must be double-quoted in SQL, since Postgres folds unquoted names to lower case;
  • adds the missing column table for "BackfillCursor", taken from prisma/schema.prisma and src/db.ts (singleton row with id 1).

Closes #317

Checks

Docs-only change, so the build/test checks don't apply. To check the names, I applied the three migrations in indexer/prisma/migrations/ in order to a fresh Postgres (PGlite, Postgres compiled to WASM, since I had no local server) and ran:

  • SELECT count(*) FROM "<name>" for all seven documented names: each one works.
  • SELECT count(*) FROM invocations, FROM Invocation and FROM indexer_cursor: each fails with relation "..." does not exist, which is the problem the issue describes and why the note about quoting is there.
  • information_schema.columns for BackfillCursor, which matches the new column table.

Notes

I didn't touch the descriptions of the other tables' columns, only their names.

Prisma names tables after the models (quoted PascalCase), so the
snake_case names in the Tables section don't exist in Postgres. Use
the real names, show how to quote them in SQL, and document the
BackfillCursor columns.
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

@O1sumitkumar is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the table names in the indexer README

1 participant