Tauri Core API - v2.6.0
    Preparing search index...

    Class Resource

    A rust-backed resource stored through tauri::Manager::resources_table API.

    The resource lives in the main process and does not exist in the Javascript world, and thus will not be cleaned up automatiacally except on application exit. If you want to clean it up early, call Resource.close

    import { Resource, invoke } from '@tauri-apps/api/core';
    export class DatabaseHandle extends Resource {
    static async open(path: string): Promise<DatabaseHandle> {
    const rid: number = await invoke('open_db', { path });
    return new DatabaseHandle(rid);
    }

    async execute(sql: string): Promise<void> {
    await invoke('execute_sql', { rid: this.rid, sql });
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods

    • Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

      Returns Promise<void>