Skip to content

Commit

Permalink
SK-1192 README and changelog update for token options in get interface
Browse files Browse the repository at this point in the history
  • Loading branch information
skyflow-lipsa committed Oct 30, 2023
1 parent 5605cb3 commit 24c433f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## [1.15.0] - 2023-10-30
## Added
- options tokens support for Get method.

## [1.14.0] - 2023-09-29
## Added
- Support for different BYOT modes in Insert method.
Expand Down
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,75 @@ Sample response:
}
```

### Get With Options

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.

```python
# options, indicates whether to return all fields in tokenized format. Defaults to 'false'.
options: GetOptions
```

```python
{
'records': [
{
'ids': [str], # List of Skyflow IDs.
'table': str, # Name of table holding the data.
}
]
}

```
Sample usage

The following snippet shows how to use the `get()` method.

```python
{
'records': [
{
'ids': ["56513264-fc45-41fa-9cb0-d1ad3602bc49","da26de53-95d5-4bdb-99db-8d8c66a35ff9"],
'table': cards,
}
]
}

try:
client.update(records, GetOptions(True))
except SkyflowError as e:
if e.data:
print(e.data)
else:
print(e)
```

Sample response:

```python
{
'records': [
{
'fields': {
'card_number': 'gAAAAABlP7XQtYljbTWNsXgyKeRm9d9ZyHSsH46EoVK6wQlS_Wi_zvLy78B3bwT07Nd2OdV8nhbkaqXuy210_zT7K4CfBMOAseVkcaq5Pf75zvb0cAJUiKc=',
'cvv': 'gAAAAABlP7XQqAvgj3qbZv53JWgIzaDAtqmDhZikmiNFNNcogH6zKOqDbCZD_pX_ARme3RLETZdgX-zW1e5h311QwTDTahh9RQ==',
'skyflow_id': 'gAAAAABlP7XQPX0tL6PMf1nW3sqNSvyMQ7fJkFSIKLGci03vTV5EC8ZIGJhfjIOx7bvZcqreeScjNZQnnUi4k1YEyyQAaqqBoz7EpVGTbUrllp6BUXvKIC8LIj_nBWF-L1XrLd5i7ZXk'
},
'table': 'cards'
},
{
'fields': {
'card_number': 'gAAAAABlP7aUxdtn5M0hmOhQ_1kxe0QE58JGrbX4oZ8GL24LUapmgxaDFyPtjVnsl7g9-eFbGJHOSLzt5FjNEFi9JTnix_fkOK9lHuJtxwvExdBwf747g-s=',
'cvv': 'gAAAAABlP7aUAlbDCrQ8SvSurH1NJjiI0yYXLtRCJeTpuGRGo03eBr8f6gaSL9cYbr9k1UCNm8SMoD2ehpu472897LjfuI6kKw==',
'skyflow_id': 'gAAAAABlP7aU8whfXOeZAEtwNmRBDjvHWFmKazJbQ0zxJDwPJJhknXhPSl6FpE0g-j-23XranpxTc3_qsRaTIsM_D_llgrNfXtyVFbB55KEwmd7c1RguFoeXbaCYFOl1XHZIR8rjXvup'
},
'table': 'cards'
}
],
'errors': []
}
```

### Get By Id

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:
Expand Down

0 comments on commit 24c433f

Please sign in to comment.