LokiDataAdapter
このコンテンツはまだ日本語訳がありません。
Cache database using LokiJS
- Requires lokijs
Implements
Constructors
new LokiDataAdapter()
new LokiDataAdapter(
options
?):LokiDataAdapter
Parameters
• options?: LokiDataAdapterOptions
Returns
Defined in
src/extras/LokiDataAdapter.ts:59
Properties
autosave
autosave:
boolean
Defined in
src/extras/LokiDataAdapter.ts:49
autosaveInterval
autosaveInterval:
number
Defined in
src/extras/LokiDataAdapter.ts:50
db
db:
LokiConstructor
Defined in
src/extras/LokiDataAdapter.ts:56
dbDir
dbDir:
string
Defined in
src/extras/LokiDataAdapter.ts:47
dbFile
dbFile:
string
Defined in
src/extras/LokiDataAdapter.ts:46
dbPath
dbPath:
string
=":memory:"
Defined in
src/extras/LokiDataAdapter.ts:54
files
files:
Collection
<ImgProcFileRecord
>
Defined in
src/extras/LokiDataAdapter.ts:57
isInMemory
isInMemory:
boolean
Defined in
src/extras/LokiDataAdapter.ts:48
retentionCount
retentionCount:
null
|number
Defined in
src/extras/LokiDataAdapter.ts:53
retentionPeriod
retentionPeriod:
null
|number
=10
Defined in
src/extras/LokiDataAdapter.ts:52
Methods
close()
close():
void
Save and close database
Returns
void
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:268
countdown()
countdown():
void
Countdown all records
Returns
void
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:226
delete()
delete(
criteria
):void
Delete the record
Parameters
• criteria: ImgProcDataAdapterCriteria
Returns
void
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:203
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/LokiDataAdapter.ts:240
fetch()
fetch(
criteria
):null
|object
Fetch single record
- To fetch a record with category
source
, specifyhash
. - To fetch a record with category
variant
orplaceholder
, specifysource
andprofile
.
Parameters
• criteria: ImgProcDataAdapterCriteria
Returns
null
| object
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:154
initialize()
initialize(
options
):Promise
<void
>
Async part of constructor
Parameters
• options: ImgProcDataAdapterInitOptions
Returns
Promise
<void
>
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:77
insert()
insert(
data
):void
Insert the record
Parameters
• data: ImgProcFile
Returns
void
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:175
list()
list():
Set
<string
>
List all hashes
Returns
Set
<string
>
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:166
renew()
renew(
criteria
):void
Renew the record
Parameters
• criteria: ImgProcDataAdapterCriteria
Returns
void
Implementation of
Defined in
src/extras/LokiDataAdapter.ts:207
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