id
, vid
, and block_range
.
When you update an entity in a subgraph mapping handler, a new row in the database is created with the same ID, but new VID and block_range, and the old row’s block_range
is updated to have an end.
By default, pipelines deduplicate on id
, to show only the latest row per id
. In other words, historical entity state is not kept in the sink database. This saves a lot of database space and makes for easier querying, as additional deduplication logic is not needed for simple queries. In a postgres database for example, the pipeline will update existing rows with the values from the newest block.
This deduplication happens through setting the primary key in the data going through the pipeline. By default, the primary key is id
.
If historical data is desired, you can set the primary key to vid
through a transform.
goldsky pipeline create <pipeline-name>
and select Project Subgraph
, and push subgraph data into any of our supported sinks.
goldsky pipeline create <your-pipeline-name>
, select Community Subgraphs as the source type. This will display a list of available subgraphs to choose from. Select the one you are interested in and follow the prompts to complete the pipeline creation.
This will get load the subgraph into your project and create a pipeline with that subgraph as the source.