コンテンツにスキップ

BunSqliteDataAdapter

このコンテンツはまだ日本語訳がありません。

Cache database using JSON file

Implements

Constructors

new BunSqliteDataAdapter()

new BunSqliteDataAdapter(options?): BunSqliteDataAdapter

Parameters

options?: BunSqliteDataAdapterOptions

Returns

BunSqliteDataAdapter

Defined in

src/extras/BunSqliteDataAdapter.ts:114

Properties

db

db: Database

Defined in

src/extras/BunSqliteDataAdapter.ts:64


dbDir

dbDir: string

Defined in

src/extras/BunSqliteDataAdapter.ts:55


dbFile

dbFile: string

Defined in

src/extras/BunSqliteDataAdapter.ts:54


dbPath

dbPath: string = ":memory:"

Defined in

src/extras/BunSqliteDataAdapter.ts:62


isInMemory

isInMemory: boolean

Defined in

src/extras/BunSqliteDataAdapter.ts:58


retentionCount

retentionCount: null | number

Defined in

src/extras/BunSqliteDataAdapter.ts:61


retentionPeriod

retentionPeriod: null | number = 10

Defined in

src/extras/BunSqliteDataAdapter.ts:60


table

table: string

Defined in

src/extras/BunSqliteDataAdapter.ts:56


useWAL

useWAL: boolean

Defined in

src/extras/BunSqliteDataAdapter.ts:57

Methods

close()

close(): void

Close database

Returns

void

Implementation of

ImgProcDataAdapter.close

Defined in

src/extras/BunSqliteDataAdapter.ts:458


countdown()

countdown(): void

Countdown all records

Returns

void

Implementation of

ImgProcDataAdapter.countdown

Defined in

src/extras/BunSqliteDataAdapter.ts:426


delete()

delete(criteria): void

Delete the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void

Implementation of

ImgProcDataAdapter.delete

Defined in

src/extras/BunSqliteDataAdapter.ts:398


deleteExpiredRecords()

deleteExpiredRecords(now): null | Set<string>

Delete expired records

Parameters

now: number = ...

Unixtime (milliseconds)

Returns

null | Set<string>

Deleted hashes or null

Implementation of

ImgProcDataAdapter.deleteExpiredRecords

Defined in

src/extras/BunSqliteDataAdapter.ts:434


fetch()

fetch(criteria): null | ImgProcFileRecord

Fetch single record

  • To fetch a record with category source, specify hash.
  • To fetch a record with category variant or placeholder, specify source and profile.

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

null | ImgProcFileRecord

Implementation of

ImgProcDataAdapter.fetch

Defined in

src/extras/BunSqliteDataAdapter.ts:347


initialize()

initialize(options): void

Initialize database

Parameters

options: ImgProcDataAdapterInitOptions

Returns

void

Implementation of

ImgProcDataAdapter.initialize

Defined in

src/extras/BunSqliteDataAdapter.ts:129


insert()

insert(data): void

Insert the record

Parameters

data: ImgProcFile

Returns

void

Implementation of

ImgProcDataAdapter.insert

Defined in

src/extras/BunSqliteDataAdapter.ts:362


list()

list(): Set<string>

List all hashes

Returns

Set<string>

Implementation of

ImgProcDataAdapter.list

Defined in

src/extras/BunSqliteDataAdapter.ts:357


renew()

renew(criteria): void

Renew the record

Parameters

criteria: ImgProcDataAdapterCriteria

Returns

void

Implementation of

ImgProcDataAdapter.renew

Defined in

src/extras/BunSqliteDataAdapter.ts:407


updateMetadata()

updateMetadata(data): void

Update the record for remote file

Parameters

data

data.b?: number

data.expiresAt?: number

data.format: string

data.g?: number

data.hash: string

data.height: number

data.r?: number

data.width: number

Returns

void

Implementation of

ImgProcDataAdapter.updateMetadata

Defined in

src/extras/BunSqliteDataAdapter.ts:376