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

ORM SQL indexing #11000

Closed
aaronc opened this issue Jan 21, 2022 · 6 comments
Closed

ORM SQL indexing #11000

aaronc opened this issue Jan 21, 2022 · 6 comments
Labels

Comments

@aaronc
Copy link
Member

aaronc commented Jan 21, 2022

Using EntryCodecs and ADR 038 (or alternative orm Hooks), orm data can be indexed in an SQL database if there is some conversion of proto.Message to SQL.

The proposed approach is to use https://gorm.io to target any backend it targets (Sqlite, Postgres, Mysql, etc.). The indexer would read the ORM proto extensions in order to tell GORM which fields to setup as the primary key, and using GORM AutoMigrate, the integration should be pretty straightforward.

@aaronc aaronc mentioned this issue Jan 21, 2022
19 tasks
@aaronc aaronc changed the title ORM SQL decoding ORM SQL indexing Jan 21, 2022
@aaronc aaronc added this to the ORM v1.1 milestone Feb 1, 2022
@aaronc aaronc moved this from In Progress to Todo in Cosmos SDK: ORM WG Feb 1, 2022
@aaronc aaronc moved this from Todo to Ice Box in Cosmos SDK: Framework WG Mar 29, 2022
@aaronc aaronc moved this from Ice Box to Backlog in Cosmos SDK: Framework WG Apr 12, 2022
@tac0turtle tac0turtle removed this from the ORM v1.1 milestone Jun 14, 2022
@pratikbin
Copy link
Contributor

gaia version 7.1.0 has psql indexing support, but I couldn't find the docs for creating initial migration or relation for index

image

@tac0turtle
Copy link
Member

the sql indexer you are seeing here is the tendermint one. You will have to open a separate issue in that repo

@pratikbin
Copy link
Contributor

Got it. Thank you

@alexanderbez
Copy link
Contributor

gaia version 7.1.0 has psql indexing support, but I couldn't find the docs for creating initial migration or relation for index

image

The SQL schema exists in the Tendermint repo. The Tendermint repo documents how the indexer works and the schema needed:

https://github.com/tendermint/tendermint/blob/main/state/indexer/sink/psql/schema.sql

@pratikbin
Copy link
Contributor

pratikbin commented Jan 5, 2023

The Tendermint repo documents how the indexer works and the schema needed:

Totally missed it🫣

Thank you ser @alexanderbez

@tac0turtle tac0turtle moved this to ❌ Blocked in Cosmos-SDK Nov 16, 2023
@tac0turtle tac0turtle moved this from ❌ Blocked to ☃️ Icebox in Cosmos-SDK Mar 13, 2024
@aaronc
Copy link
Member Author

aaronc commented Jul 10, 2024

Replaced by #20352

@aaronc aaronc closed this as completed Jul 10, 2024
@github-project-automation github-project-automation bot moved this from ☃️ Icebox to 🥳 Done in Cosmos-SDK Jul 10, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Cosmos SDK: Framework WG Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

4 participants