🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

kysely-dialect-tauri

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kysely-dialect-tauri

Kysely Tauri dialect, using @tauri-apps/plugin-sql

1.2.0
latest
Source
npm
Version published
Weekly downloads
57
23.91%
Maintainers
1
Weekly downloads
 
Created
Source

kysely-dialect-tauri

kysely dialect for Tauri, using official sql plugin

Currently only supports SQLite

Install

pnpm add kysely kysely-dialect-tauri @tauri-apps/plugin-sql

Usage

import { appDataDir } from '@tauri-apps/api/path'
import Database from '@tauri-apps/plugin-sql'
import { Kysely } from 'kysely'

const kysely = new Kysely<DB>({
  dialect: new TauriSqliteDialect({
    database: prefix => Database.load(`${prefix}${await appDataDir()}test.db`)
  }),
})

Config

export interface TauriSqliteDialectConfig {
  database: Promisable<TauriSqlDB> | ((prefix: 'sqlite:') => Promisable<TauriSqlDB>)
  /**
   * Called once when the first query is executed.
   *
   * This is a Kysely specific feature and does not come from the `better-sqlite3` module.
   */
  onCreateConnection?: (connection: DatabaseConnection) => Promisable<void>
}

Keywords

kysely

FAQs

Package last updated on 14 Apr 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