extensions icon indicating copy to clipboard operation
extensions copied to clipboard

[firestore-bigquery-export] Store change.before.data() somewhere

Open samatcolumn opened this issue 3 years ago • 3 comments

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Extension name

firestore-bigquery-export

What feature would you like to see?

Store data before and data after in the changelog, especially on DELETE operations.

How would you use it?

Right now on DELETE operations the data is null. Normally when looking at deletions int the changelog my first question is "what data got deleted?". This can be especially relevant in situations where the extension was installed on a large existing data set.

A second property, like beforeData: change.before.data() would be super useful. Here's the relevant code: https://github.com/firebase/extensions/blob/a8848a2706839790749f16c5061d96ceb543a043/firestore-bigquery-export/functions/src/index.ts#L62

samatcolumn avatar Sep 15 '22 08:09 samatcolumn

Thanks for the suggestion! Going to bring this up at the next meeting with Invertase next week.

huangjeff5 avatar Sep 15 '22 16:09 huangjeff5

Hey @samatcolumn, I wonder if querying the changelog table could serve your needs. The whole history of record changes is stored in the changelog table.

yamankatby avatar Sep 26 '22 10:09 yamankatby

@yamankatby yeah the changelog has the data but it just means much more complex queries when looking at deletion events because the event with the deleted data is the one preceding the deletion.

samatcolumn avatar Sep 26 '22 13:09 samatcolumn