Closed let4be closed 1 year ago
What is needed to support it exactly, could you expand a bit?
Right now export from substream to db is -very- limited. As we see in https://github.com/streamingfast/substreams-database-change/blob/7cab5707e68393cbf970c0c75b4d9a0e459693f2/proto/substreams/sink/database/v1/database.proto#L27
every change gets compressed into a map[string]string
and primary key is essentially a string
as well...
Export structure should be expanded, to support flexible data types(same as done in EntityChange
, https://github.com/streamingfast/substreams-entity-change) - or those 2 concepts should be somehow united. Then primary key should be turned into a repeated
field, and sink's logic should be upgraded as well
I could see composite keys being useful(especially if sink properly supports bytea
postgres data type). Now bytea
support can be added by properly handling param bindings when doing a query - see https://github.com/streamingfast/substreams-sink-postgres/issues/8
Are there any plans for composite primary keys support?
No one is actively working on it. It's something we would like to add, but it's not prioritize now.
Could be useful to support composite primary keys https://kb.objectrocket.com/postgresql/postgresql-composite-primary-keys-629