blobs
Creates, updates, deletes, gets or lists a blobs resource.
Overview
| Name | blobs |
| Type | Resource |
| Id | github.git.blobs |
Fields
The following fields are returned by SELECT queries:
- get_blob
Response
| Name | Datatype | Description |
|---|---|---|
node_id | string | |
content | string | |
encoding | string | |
highlighted_content | string | |
sha | string | |
size | integer | |
url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_blob | select | owner, repo, file_sha | The content in the response will always be Base64 encoded.This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw blob data.- application/vnd.github+json: Returns a JSON representation of the blob with content as a base64 encoded string. This is the default if no media type is specified.Note This endpoint supports blobs up to 100 megabytes in size. | |
create_blob | insert | owner, repo, content |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
file_sha | string | |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_blob
The content in the response will always be Base64 encoded.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw blob data.
- application/vnd.github+json: Returns a JSON representation of the blob with content as a base64 encoded string. This is the default if no media type is specified.
Note This endpoint supports blobs up to 100 megabytes in size.
SELECT
node_id,
content,
encoding,
highlighted_content,
sha,
size,
url
FROM github.git.blobs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND file_sha = '{{ file_sha }}' -- required
;
INSERT examples
- create_blob
- Manifest
No description available.
INSERT INTO github.git.blobs (
content,
encoding,
owner,
repo
)
SELECT
'{{ content }}' /* required */,
'{{ encoding }}',
'{{ owner }}',
'{{ repo }}'
RETURNING
sha,
url
;
# Description fields are for documentation purposes
- name: blobs
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the blobs resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the blobs resource.
- name: content
value: "{{ content }}"
description: |
The new blob's content.
- name: encoding
value: "{{ encoding }}"
description: |
The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported.
default: utf-8