[go: nahoru, domu]

Skip to content

Commit

Permalink
feat(firestore-bigquery-export): allow firestore database selection (#…
Browse files Browse the repository at this point in the history
…1933)

Co-authored-by: Mais Alheraki <mais.alheraki@gmail.com>
  • Loading branch information
jauntybrain and pr-Mais committed Mar 20, 2024
1 parent 32270a7 commit d1bdc73
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 9,727 deletions.
1 change: 1 addition & 0 deletions _emulator/extensions/firestore-bigquery-export.env.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
BIGQUERY_PROJECT_ID=dev-extensions-testing
DATABASE_ID=(default)
COLLECTION_PATH=posts
DATASET_ID=firestore_export
DATASET_LOCATION=us-central1
Expand Down
2 changes: 2 additions & 0 deletions firestore-bigquery-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan

* BigQuery Project ID: Override the default project for BigQuery instance. This can allow updates to be directed to to a BigQuery instance on another GCP project.

* Database ID: Override the default project Firestore database. Learn more about managing multiple Firestore databases [here](https://cloud.google.com/firestore/docs/manage-databases).

* Collection path: What is the path of the collection that you would like to export? You may use `{wildcard}` notation to match a subcollection of all documents in a collection (for example: `chatrooms/{chatid}/posts`). Parent Firestore Document IDs from `{wildcards}` can be returned in `path_params` as a JSON formatted string.

* Enable Wildcard Column field with Parent Firestore Document IDs: If enabled, creates a column containing a JSON object of all wildcard ids from a documents path.
Expand Down
12 changes: 11 additions & 1 deletion firestore-bigquery-export/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ resources:
runtime: nodejs18
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.write
resource: projects/${param:PROJECT_ID}/databases/(default)/documents/${param:COLLECTION_PATH}/{documentId}
resource: projects/${param:PROJECT_ID}/databases/${param:DATABASE_ID}/documents/${param:COLLECTION_PATH}/{documentId}

- name: fsimportexistingdocs
type: firebaseextensions.v1beta.function
Expand Down Expand Up @@ -180,6 +180,16 @@ params:
default: ${PROJECT_ID}
required: true

- param: DATABASE_ID
label: Database ID
description: >-
Override the default project Firestore database. Learn more about managing
multiple Firestore databases
[here](https://cloud.google.com/firestore/docs/manage-databases).
type: string
default: (default)
required: true

- param: COLLECTION_PATH
label: Collection path
description: >-
Expand Down
Loading

0 comments on commit d1bdc73

Please sign in to comment.