Socket
Book a DemoInstallSign in
Socket

@patwoz/react-query-cache-persistent-adapter-bun-sqlite

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patwoz/react-query-cache-persistent-adapter-bun-sqlite

0.0.9
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

@patwoz/react-query-cache-persistent-adapter-bun-sqlite

Adapter for bun:sqlite to use react-query-cache-persistent.

Installation

bun add react-query-cache-persistent @patwoz/react-query-cache-persistent-adapter-bun-sqlite

Example

Take also a look into the tests.

import { Database } from 'bun:sqlite'
import { QueryClient } from '@tanstack/query-core'
import { createPersistentQueryCacheForBunSqlite } from '@patwoz/react-query-cache-persistent-adapter-bun-sqlite'

const db = new Database(':memory:')

const queryClient = new QueryClient({
  queryCache: createPersistentQueryCacheForBunSqlite(db),
  // Do not forget to set a staleTime, otherwise you will not take advantage of the synchronous cache
  defaultOptions: {
    queries: {
      staleTime: 1000 * 60 * 60, // 1 hour (just an example)
    },
  },
})

// All your queries are automatically cached in your sqlite database

FAQs

Package last updated on 30 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.