Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b5cd21

Browse files
skyflow-lipsaappasuamithsai
authored andcommitted
SK-1192 README and changelog update for token options in get interface
1 parent 295f0ce commit 6b5cd21

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.15.0] - 2023-10-30
6+
## Added
7+
- options tokens support for Get method.
8+
59
## [1.14.0] - 2023-09-29
610
## Added
711
- Support for different BYOT modes in Insert method.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,75 @@ Sample response:
525525
}
526526
```
527527

528+
### Get With Options
529+
530+
To retrieve data using Skyflow IDs or unique column values, use the `get(records: dict,options: GetOptions)` method. The `records` parameter takes a Dictionary that contains either an array of Skyflow IDs.
531+
532+
```python
533+
# options, indicates whether to return all fields in tokenized format. Defaults to 'false'.
534+
options: GetOptions
535+
```
536+
537+
```python
538+
{
539+
'records': [
540+
{
541+
'ids': [str], # List of Skyflow IDs.
542+
'table': str, # Name of table holding the data.
543+
}
544+
]
545+
}
546+
547+
```
548+
Sample usage
549+
550+
The following snippet shows how to use the `get()` method.
551+
552+
```python
553+
{
554+
'records': [
555+
{
556+
'ids': ["56513264-fc45-41fa-9cb0-d1ad3602bc49","da26de53-95d5-4bdb-99db-8d8c66a35ff9"],
557+
'table': cards,
558+
}
559+
]
560+
}
561+
562+
try:
563+
client.update(records, GetOptions(True))
564+
except SkyflowError as e:
565+
if e.data:
566+
print(e.data)
567+
else:
568+
print(e)
569+
```
570+
571+
Sample response:
572+
573+
```python
574+
{
575+
'records': [
576+
{
577+
'fields': {
578+
'card_number': 'gAAAAABlP7XQtYljbTWNsXgyKeRm9d9ZyHSsH46EoVK6wQlS_Wi_zvLy78B3bwT07Nd2OdV8nhbkaqXuy210_zT7K4CfBMOAseVkcaq5Pf75zvb0cAJUiKc=',
579+
'cvv': 'gAAAAABlP7XQqAvgj3qbZv53JWgIzaDAtqmDhZikmiNFNNcogH6zKOqDbCZD_pX_ARme3RLETZdgX-zW1e5h311QwTDTahh9RQ==',
580+
'skyflow_id': 'gAAAAABlP7XQPX0tL6PMf1nW3sqNSvyMQ7fJkFSIKLGci03vTV5EC8ZIGJhfjIOx7bvZcqreeScjNZQnnUi4k1YEyyQAaqqBoz7EpVGTbUrllp6BUXvKIC8LIj_nBWF-L1XrLd5i7ZXk'
581+
},
582+
'table': 'cards'
583+
},
584+
{
585+
'fields': {
586+
'card_number': 'gAAAAABlP7aUxdtn5M0hmOhQ_1kxe0QE58JGrbX4oZ8GL24LUapmgxaDFyPtjVnsl7g9-eFbGJHOSLzt5FjNEFi9JTnix_fkOK9lHuJtxwvExdBwf747g-s=',
587+
'cvv': 'gAAAAABlP7aUAlbDCrQ8SvSurH1NJjiI0yYXLtRCJeTpuGRGo03eBr8f6gaSL9cYbr9k1UCNm8SMoD2ehpu472897LjfuI6kKw==',
588+
'skyflow_id': 'gAAAAABlP7aU8whfXOeZAEtwNmRBDjvHWFmKazJbQ0zxJDwPJJhknXhPSl6FpE0g-j-23XranpxTc3_qsRaTIsM_D_llgrNfXtyVFbB55KEwmd7c1RguFoeXbaCYFOl1XHZIR8rjXvup'
589+
},
590+
'table': 'cards'
591+
}
592+
],
593+
'errors': []
594+
}
595+
```
596+
528597
### Get By Id
529598

530599
For retrieving using SkyflowID's, use the get_by_id(records: dict) method. The records parameter takes a Dictionary that contains records to be fetched as shown below:

0 commit comments

Comments
 (0)