Update
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
"node": ">20.0.x <21.0.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/plugin-sql": "2.0.0-beta.5",
|
||||
"svelte-tauri": "link:"
|
||||
}
|
||||
}
|
||||
|
16
pnpm-lock.yaml
generated
16
pnpm-lock.yaml
generated
@@ -8,6 +8,9 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@tauri-apps/plugin-sql':
|
||||
specifier: 2.0.0-beta.5
|
||||
version: 2.0.0-beta.5
|
||||
svelte-tauri:
|
||||
specifier: 'link:'
|
||||
version: 'link:'
|
||||
@@ -599,6 +602,10 @@ packages:
|
||||
resolution: {integrity: sha512-Jgwj8BK/9YXZNzcqVDk1Al7+u5V9sWrZ8MhV41A1AKgJaicHuqlkc/qdx06sNDXvc+qprTPpBAaqnt891qOUIQ==}
|
||||
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.13':
|
||||
resolution: {integrity: sha512-Np1opKANzRMF3lgJ9gDquBCB9SxlE2lRmNpVx1+L6RyzAmigkuh0ZulT5jMnDA3JLsuSDU135r/s4t/Pmx4atg==}
|
||||
engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@1.5.13':
|
||||
resolution: {integrity: sha512-wXsBp6FIsQ1yoAEJ8dao7BkVdOp5xlfgGyAbJVCFKU3LTUqKw4A+ayxO6CV2lFfSaOdzdU86z+eJsl38nzmoSg==}
|
||||
engines: {node: '>= 10'}
|
||||
@@ -664,6 +671,9 @@ packages:
|
||||
engines: {node: '>= 10'}
|
||||
hasBin: true
|
||||
|
||||
'@tauri-apps/plugin-sql@2.0.0-beta.5':
|
||||
resolution: {integrity: sha512-EuhrMeIGmIQmGYuzxk6i+PPqIMMgT+nApNsjYbpuVwYuav60RiI0pIC76B77BfmO5J7Sj9ueJyhiugwUevsYmQ==}
|
||||
|
||||
'@tsconfig/svelte@5.0.4':
|
||||
resolution: {integrity: sha512-BV9NplVgLmSi4mwKzD8BD/NQ8erOY/nUE/GpgWe2ckx+wIQF5RyRirn/QsSSCPeulVpc3RA/iJt6DpfTIZps0Q==}
|
||||
|
||||
@@ -2426,6 +2436,8 @@ snapshots:
|
||||
|
||||
'@tauri-apps/api@1.5.5': {}
|
||||
|
||||
'@tauri-apps/api@2.0.0-beta.13': {}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@1.5.13':
|
||||
optional: true
|
||||
|
||||
@@ -2469,6 +2481,10 @@ snapshots:
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 1.5.13
|
||||
'@tauri-apps/cli-win32-x64-msvc': 1.5.13
|
||||
|
||||
'@tauri-apps/plugin-sql@2.0.0-beta.5':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.13
|
||||
|
||||
'@tsconfig/svelte@5.0.4': {}
|
||||
|
||||
'@types/cookie@0.6.0': {}
|
||||
|
2827
src-tauri/Cargo.lock
generated
2827
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ license = "MIT"
|
||||
repository = "https://github.com/Fractal-Tess/Svelte-Tauri"
|
||||
default-run = "svelte-tauri"
|
||||
edition = "2021"
|
||||
rust-version = "1.71.1"
|
||||
rust-version = "1.78.0"
|
||||
|
||||
[build-dependencies.tauri-build]
|
||||
version = "1.5.2"
|
||||
@@ -19,10 +19,6 @@ sha2 = "0.10.8"
|
||||
thiserror = "1.0.56"
|
||||
specta = "1.0.5"
|
||||
|
||||
[dependencies.tauri-plugin-window-state]
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "dev"
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0.196"
|
||||
features = ["derive"]
|
||||
@@ -44,3 +40,9 @@ panic = "abort"
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = 3
|
||||
|
||||
[dependencies.tauri-plugin-sql]
|
||||
features = ["sqlite"] # or "postgres", or "mysql"
|
||||
# alternatively with Git
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "v1"
|
||||
|
@@ -14,7 +14,8 @@ mod state;
|
||||
|
||||
fn main() {
|
||||
// App builder
|
||||
let app = TauriBuilder::default().plugin(tauri_plugin_window_state::Builder::default().build());
|
||||
let app = TauriBuilder::default()
|
||||
.plugin(tauri_plugin_sql::Builder::default().build());
|
||||
|
||||
// Register app commands
|
||||
let app = register_command_handlers(app);
|
||||
|
@@ -3,25 +3,27 @@
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI_INVOKE__<T>(cmd: string, args?: Record<string, unknown>): Promise<T>
|
||||
__TAURI_INVOKE__<T>(cmd: string, args?: Record<string, unknown>): Promise<T>;
|
||||
}
|
||||
}
|
||||
|
||||
// Function avoids 'window not defined' in SSR
|
||||
const invoke = () => window.__TAURI_INVOKE__
|
||||
const invoke = () => window.__TAURI_INVOKE__;
|
||||
|
||||
export function helloTauri() {
|
||||
return invoke()<string>('hello_tauri')
|
||||
return invoke()<string>("hello_tauri")
|
||||
}
|
||||
|
||||
export function hash256sum(hashInput: string) {
|
||||
return invoke()<string>('hash256sum', { hashInput })
|
||||
return invoke()<string>("hash256sum", { hashInput })
|
||||
}
|
||||
|
||||
export function storeSetKey(key: string, value: string) {
|
||||
return invoke()<null>('store_set_key', { key, value })
|
||||
return invoke()<null>("store_set_key", { key,value })
|
||||
}
|
||||
|
||||
export function storeReadKey(key: string) {
|
||||
return invoke()<string | null>('store_read_key', { key })
|
||||
return invoke()<string | null>("store_read_key", { key })
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user