Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store-sync): adjust DB schema/table names for consistency #2379

Merged
merged 8 commits into from
Mar 11, 2024

Conversation

holic
Copy link
Member

@holic holic commented Mar 6, 2024

part of #2173

  • moves postgres from {address}__{namespace}.{tableName} to {address}.{namespace}__{tableName}
  • moves sqlite to use snake case for table/column names to match postgres

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 26c845a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@latticexyz/store-indexer Major
@latticexyz/store-sync Major
@latticexyz/dev-tools Major
@latticexyz/abi-ts Major
@latticexyz/block-logs-stream Major
@latticexyz/cli Major
@latticexyz/common Major
@latticexyz/config Major
create-mud Major
@latticexyz/ecs-browser Major
@latticexyz/faucet Major
@latticexyz/gas-report Major
@latticexyz/network Major
@latticexyz/noise Major
@latticexyz/phaserx Major
@latticexyz/protocol-parser Major
@latticexyz/react Major
@latticexyz/recs Major
@latticexyz/schema-type Major
@latticexyz/services Major
@latticexyz/solecs Major
solhint-config-mud Major
solhint-plugin-mud Major
@latticexyz/std-client Major
@latticexyz/std-contracts Major
@latticexyz/store-cache Major
@latticexyz/store Major
@latticexyz/utils Major
@latticexyz/world-modules Major
@latticexyz/world Major
mock-game-contracts Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@holic holic force-pushed the holic/indexer-db-schemas branch from ced444e to fb0fab1 Compare March 6, 2024 14:19
@holic holic marked this pull request as ready for review March 6, 2024 14:31
@holic holic requested review from alvrs and yonadaa as code owners March 6, 2024 14:31
Copy link
Contributor

@yonadaa yonadaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasoning makes sense! I worry this might be less useable though, because a useful "division" (ie. pg namespaces) we can have are into MUD namespaces.

For example, with the Sky Strife analytics indexer, the indexer already has a specific world address, and it's useful to SEARCH_PATH a specific namespace to save rewriting long table names: https://github.com/latticexyz/skystrife-public/blob/main/sql-queries/WalletMatchesJoined.sql#L1-L2

basically does this best take advantage of Postgres namespaces?

@holic
Copy link
Member Author

holic commented Mar 6, 2024

since sky strife uses root namespace, you won't need to do anything differently here except remove the __ suffix from the schema

the idea is that selecting from SQL tables will look/feel the same as fetching data from tables in client

@holic holic merged commit adc6822 into main Mar 11, 2024
11 checks passed
@holic holic deleted the holic/indexer-db-schemas branch March 11, 2024 10:40
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.

2 participants