Closed llllvvuu closed 6 months ago
In this docs page it is shown how to implement your own store for Subsquid: https://docs.subsquid.io/sdk/resources/persisting-data/overview/#custom-database
A minor point, but exporting some of these types like:
FinalTxInfo
HotTxInfo
HashAndHeight
HotDatabaseState
Database<S>, FinalDatabase<S>, HotDatabase<S>
would be helpful for the user to get started with their code. Otherwise have to copy/paste them like so: https://github.com/llllvvuu/subsquid-drizzle-store/blob/8c48be016b52e3ff2a7a9db60982f5a1ac8771c9/src/store.ts#L33-L58
In addition it seems like some of the functions like assertStateInvariants and assertChainContinuity which I copy-pasta'd from the TypeORM store could be exported as general utility functions (seems like they apply to any store):
assertStateInvariants
assertChainContinuity
https://github.com/subsquid/squid-sdk/blob/bce36bc36438b4c0024ffc531919508be4d7900d/typeorm/typeorm-store/src/database.ts#L279-L297
Well, the copy paste is the intended way :)
In this docs page it is shown how to implement your own store for Subsquid: https://docs.subsquid.io/sdk/resources/persisting-data/overview/#custom-database
A minor point, but exporting some of these types like:
FinalTxInfo
,HotTxInfo
HashAndHeight
,HotDatabaseState
Database<S>, FinalDatabase<S>, HotDatabase<S>
would be helpful for the user to get started with their code. Otherwise have to copy/paste them like so: https://github.com/llllvvuu/subsquid-drizzle-store/blob/8c48be016b52e3ff2a7a9db60982f5a1ac8771c9/src/store.ts#L33-L58
In addition it seems like some of the functions like
assertStateInvariants
andassertChainContinuity
which I copy-pasta'd from the TypeORM store could be exported as general utility functions (seems like they apply to any store):https://github.com/subsquid/squid-sdk/blob/bce36bc36438b4c0024ffc531919508be4d7900d/typeorm/typeorm-store/src/database.ts#L279-L297