New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bun-sqlite-key-value

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-sqlite-key-value - npm Package Compare versions

Comparing version 1.9.7 to 1.10.1

4

dist/index.d.ts

@@ -43,3 +43,3 @@ import { Database } from "bun:sqlite";

private renameStatement;
private touchStatement;
private setTtlStatement;
constructor(filename?: string, options?: Options);

@@ -96,3 +96,3 @@ deleteExpired(): void;

rename(oldKey: string, newKey: string): boolean;
touch(key: string, ttlMs?: number): boolean;
setTtl(key: string, ttlMs?: number): boolean;
hSet<T = any>(key: string, field: string, value: T, ttlMs?: number): boolean;

@@ -99,0 +99,0 @@ hGet<T = any>(key: string, field: string): T | undefined;

@@ -31,3 +31,3 @@ // src/index.ts

renameStatement;
touchStatement;
setTtlStatement;
constructor(filename, options) {

@@ -92,3 +92,3 @@ const {

this.renameStatement = this.db.query("UPDATE items SET key = $newKey WHERE key = $oldKey");
this.touchStatement = this.db.query("UPDATE items SET expires = $expires WHERE key = $key");
this.setTtlStatement = this.db.query("UPDATE items SET expires = $expires WHERE key = $key");
this.deleteExpired();

@@ -388,3 +388,3 @@ }

}
touch(key, ttlMs) {
setTtl(key, ttlMs) {
let expires;

@@ -395,3 +395,3 @@ ttlMs = ttlMs ?? this.ttlMs;

}
return this.touchStatement.run({ key, expires }).changes === 1;
return this.setTtlStatement.run({ key, expires }).changes === 1;
}

@@ -398,0 +398,0 @@ hSet(key, field, value, ttlMs) {

{
"name": "bun-sqlite-key-value",
"version": "1.9.7",
"version": "1.10.1",
"author": {

@@ -5,0 +5,0 @@ "name": "Gerold Penz",

@@ -837,3 +837,3 @@ # Bun SQLite Key Value

```typescript
touch(key: string, ttlMs?: number): boolean
setTtl(key: string, ttlMs?: number): boolean
```

@@ -843,3 +843,2 @@

Returns `true` if the `key` exists.
Inspired by: https://docs.keydb.dev/docs/commands/#touch

@@ -868,6 +867,6 @@ ### key

// Update TTL
store.touch("my-key", 10000) // --> true
store.setTtl("my-key", 10000) // --> true
// Delete TTL
store.touch("my-key", 0) // --> true
store.setTtl("my-key", 0) // --> true
```

@@ -874,0 +873,0 @@

@@ -61,3 +61,3 @@ import { Database, type Statement } from "bun:sqlite"

private renameStatement: Statement
private touchStatement: Statement
private setTtlStatement: Statement

@@ -154,3 +154,3 @@

this.renameStatement = this.db.query("UPDATE items SET key = $newKey WHERE key = $oldKey")
this.touchStatement = this.db.query("UPDATE items SET expires = $expires WHERE key = $key")
this.setTtlStatement = this.db.query("UPDATE items SET expires = $expires WHERE key = $key")

@@ -615,3 +615,3 @@ // Delete expired items

// Inspired by: https://docs.keydb.dev/docs/commands/#touch
touch(key: string, ttlMs?: number): boolean {
setTtl(key: string, ttlMs?: number): boolean {
let expires: number | undefined

@@ -622,3 +622,3 @@ ttlMs = ttlMs ?? this.ttlMs

}
return this.touchStatement.run({key, expires}).changes === 1
return this.setTtlStatement.run({key, expires}).changes === 1
}

@@ -625,0 +625,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc