Repository navigation
docs(indexer): use the real table names in the README - #318
Open
O1sumitkumar wants to merge 1 commit into
Open
O1sumitkumar wants to merge 1 commit into
O1sumitkumar wants to merge 1 commit into
Conversation
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.
|
@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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Tables" section of
indexer/README.mdlisted 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 withrelation "..." does not exist.This PR:
"IndexerCursor","Invocation","Contract","BackfillCursor","StorageChange","ContractEventRecord","IndexerGap";"BackfillCursor", taken fromprisma/schema.prismaandsrc/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 InvocationandFROM indexer_cursor: each fails withrelation "..." does not exist, which is the problem the issue describes and why the note about quoting is there.information_schema.columnsforBackfillCursor, which matches the new column table.Notes
I didn't touch the descriptions of the other tables' columns, only their names.