#tauri-plugin-sql Can't get it working.

7 messages · Page 1 of 1 (latest)

unique solar
#

tauri-plugin-sql Can't get it working.

fiery niche
#

Please share the output of tauri info.

#

I wasn't able to replicate this on my end with the same code.

placid elk
#

try call database like this
`"use client";
import Database from "tauri-plugin-sql-api";

class DB {
constructor() {
this.db = null;
this.connect();
}

connect = async () => {
try {
const db = await Database.load("sqlite:app.db");
this.db = db;
} catch (error) {
console.log("Error connecting to the database:", error);
}
};

}
let dbInstance = null;
export const getDBInstance = () => {
if (!dbInstance) {
dbInstance = new DB();
}
return dbInstance;
};`

unique solar
unique solar
fiery niche