Skip to main content

blobs

Creates, updates, deletes, gets or lists a blobs resource.

Overview​

Nameblobs
TypeResource
Idgithub.git.blobs

Fields​

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
node_idstring
contentstring
encodingstring
highlighted_contentstring
shastring
sizeinteger
urlstring (uri)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_blobselectowner, repo, file_shaThe 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_blobinsertowner, 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.

NameDatatypeDescription
file_shastring
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples​

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​

No description available.

INSERT INTO github.git.blobs (
content,
encoding,
owner,
repo
)
SELECT
'{{ content }}' /* required */,
'{{ encoding }}',
'{{ owner }}',
'{{ repo }}'
RETURNING
sha,
url
;