You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,6 +44,7 @@ Why not just use the name 'nosql' or 'pynosql'? because they already exist on py
41
44
```
42
45
pip install 'abnosql[dynamodb]'
43
46
pip install 'abnosql[cosmos]'
47
+
pip install 'abnosql[firestore]'
44
48
```
45
49
46
50
For optional [client side](#client-side-encryption) field level envelope encryption
@@ -121,6 +125,8 @@ During mocked tests, [SQLGlot](https://sqlglot.com/) is used to [execute](https:
121
125
122
126
Care should be taken with `query_sql()` to not to use SQL features that are specific to any specific provider (breaking the abstraction capability of using abnosql in the first place)
123
127
128
+
The Firestore plugin uses sqlglot to parse simple SQL statements (eg AND only supported)
129
+
124
130
## Indexes
125
131
126
132
Beyond partition and range keys defined on the table, indexes currently have limited support within abnosql
@@ -140,6 +146,8 @@ If you don't need to do any updates and only need to do create/replace, then the
140
146
141
147
All items being updated must actually exist first, or else exception raised
142
148
149
+
Firestore does not return updated item, so if this is required use `put_get` = `True` config variable
150
+
143
151
144
152
## Existence Checking
145
153
@@ -183,7 +191,7 @@ A few methods such as `get_item()`, `delete_item()` and `query()` need to know p
183
191
184
192
`query` and `query_sql` accept `limit` and `next` optional kwargs and return `next` in response. Use these to paginate.
185
193
186
-
This works for AWS DyanmoDB, however Azure Cosmos has a limitation with continuation token for cross partitions queries (see [Python SDK documentation](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos)). For Cosmos, abnosql appends OFFSET and LIMIT in the SQL statement if not already present, and returns `next`. `limit` is defaulted to 100. See the tests for examples
194
+
This works for AWS DyanmoDB & Firestore, however Azure Cosmos has a limitation with continuation token for cross partitions queries (see [Python SDK documentation](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos)). For Cosmos, abnosql appends OFFSET and LIMIT in the SQL statement if not already present, and returns `next`. `limit` is defaulted to 100. See the tests for examples
187
195
188
196
## Audit
189
197
@@ -228,6 +236,8 @@ This behaviour is enabled by default, however can be disabled by setting `ABNOSQ
228
236
229
237
To write an Azure Function / AWS Lambda that is able to process both DynamoDB and Cosmos events, look for `changeMetadata` first and if present use that otherwise look for `eventName` and `eventSourceARN` in the event payload assuming its DynamoDB
230
238
239
+
**Google Firestore** should support [triggering functions](https://firebase.google.com/docs/functions/firestore-events?gen=2nd#python-preview) similar to DynamoDB Streams, so changeMetadata is not required
240
+
231
241
## Client Side Encryption
232
242
233
243
If configured in table config with `kms` attribute, abnosql will perform client side encryption using AWS KMS or Azure KeyVault
@@ -288,6 +298,7 @@ if `ABNOSQL_DB` env var is not set, abnosql will attempt to apply defaults based
288
298
289
299
-`AWS_DEFAULT_REGION` - sets database to `dynamodb` (see [aws docs](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html))
290
300
-`FUNCTIONS_WORKER_RUNTIME` - sets database to `cosmos` (see [azure docs](https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#functions_worker_runtime))
301
+
-`K_SERVICE` - sets database to `firestore` (though this could also get confused if running on knative)
291
302
292
303
293
304
## AWS DynamoDB
@@ -335,6 +346,36 @@ tb = table(
335
346
)
336
347
```
337
348
349
+
350
+
## Google Firestore
351
+
352
+
Set the following environment variables:
353
+
354
+
-`ABNOSQL_DB` = "firestore"
355
+
-`ABNOSQL_FIRESTORE_PROJECT` or `GOOGLE_CLOUD_PROJECT` = google cloud project
-`ABNOSQL_FIRESTORE_CREDENTIALS` = oauth, optional - if using google CLI, its also picked up from `~/.config/gcloud/application_default_credentials.json` if found
-[][Google Firestore](https://cloud.google.com/python/docs/reference/firestore/latest) support, ideally in the core library (though could be added outside via use of the plugin system). Would need something like [FireSQL](https://firebaseopensource.com/projects/jsayol/firesql/) implemented for oython, maybe via sqlglot
491
+
-[x][Google Firestore](https://cloud.google.com/python/docs/reference/firestore/latest) support, ideally in the core library (though could be added outside via use of the plugin system). Would need something like [FireSQL](https://firebaseopensource.com/projects/jsayol/firesql/) implemented for python, maybe via sqlglot
434
492
-[ ][Google Vault](https://cloud.google.com/python/docs/reference/cloudkms/latest/) KMS support
435
493
-[ ][Hashicorp Vault](https://github.com/hashicorp/vault-examples/blob/main/examples/_quick-start/python/example.py) KMS support
436
494
-[ ] Simple caching (maybe) using globals (used for AWS Lambda / Azure Functions)
0 commit comments