Skip to main content
Module

x/sqlite3/mod.ts>SQLBlob

Fastest & correct JavaScript bindings to SQLite3 C API, using Deno FFI.
Go to Latest
class SQLBlob
Re-export
import { SQLBlob } from "https://deno.land/x/sqlite3@0.5.1/mod.ts";

Enumerates SQLite3 Blob opened for streamed I/O.

BLOB columns still return a Uint8Array of the data. You can instead open this from Database.openBlob().

Constructors

new
SQLBlob(db: Database, options: BlobOpenOptions)

Properties

readonly
byteLength: number

Byte size of the Blob

readonly
readable: ReadableStream<Uint8Array>

Obtains Web Stream for reading the Blob

readonly
writable: WritableStream<Uint8Array>

Obtains Web Stream for writing to the Blob

Methods

close(): void

Close the Blob. It must be called to prevent leaks.

read(offset: number, p: Uint8Array): Promise<void>

Read asynchronously from the Blob at given offset into a buffer.

This function suspends sqlite3_blob_read function into a separate thread, so beware of data races. Once you pass a buffer it should not be used until this function resolves.

readSync(offset: number, p: Uint8Array): void

Read from the Blob at given offset into a buffer (Uint8Array)

write(offset: number, p: Uint8Array): Promise<void>

Write a buffer (Uint8Array) at given offset in the Blob.

writeSync(offset: number, p: Uint8Array): void

Write a buffer (Uint8Array) at given offset in the Blob

[Symbol.iterator](): IterableIterator<Uint8Array>