mirror of
https://github.com/lumehq/lume.git
synced 2025-03-28 02:31:49 +01:00
replaced tauri-sql with prisma-client-rust
This commit is contained in:
parent
27082acf5c
commit
9b8a96c651
2
src-tauri/.cargo/config.toml
Normal file
2
src-tauri/.cargo/config.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[alias]
|
||||
prisma = "run --bin prisma --"
|
2
src-tauri/.gitignore
vendored
2
src-tauri/.gitignore
vendored
@ -2,3 +2,5 @@
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# prisma
|
||||
src/prisma.rs
|
||||
|
2406
src-tauri/Cargo.lock
generated
2406
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -17,11 +17,10 @@ tauri-build = { version = "1.2", features = [] }
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.2", features = ["clipboard-read-text", "clipboard-write-text", "http-request", "os-all", "shell-open", "system-tray", "window-close", "window-start-dragging"] }
|
||||
|
||||
[dependencies.tauri-plugin-sql]
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "dev"
|
||||
features = ["sqlite"]
|
||||
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.7", default-features = false, features = ["sqlite", "migrations", "mocking", "specta"] }
|
||||
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.7", default-features = false, features = ["sqlite", "migrations", "mocking", "specta"] }
|
||||
specta = "1.0.0"
|
||||
tauri-specta = { version = "1.0.0", features = ["typescript"] }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
objc = "0.2.7"
|
||||
|
0
src-tauri/prisma/migrations/.keep
Normal file
0
src-tauri/prisma/migrations/.keep
Normal file
11
src-tauri/prisma/schema.prisma
Normal file
11
src-tauri/prisma/schema.prisma
Normal file
@ -0,0 +1,11 @@
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = "file:lume.db"
|
||||
}
|
||||
|
||||
generator client {
|
||||
// Corresponds to the cargo alias created earlier
|
||||
provider = "cargo prisma"
|
||||
// The location to generate the client. Is relative to the position of the schema
|
||||
output = "../src/prisma.rs"
|
||||
}
|
3
src-tauri/src/bin/prisma.rs
Normal file
3
src-tauri/src/bin/prisma.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
prisma_client_rust_cli::run();
|
||||
}
|
@ -8,7 +8,6 @@
|
||||
extern crate objc;
|
||||
|
||||
use tauri::{Manager, WindowEvent};
|
||||
use tauri_plugin_sql::{Migration, MigrationKind};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use window_ext::WindowExt;
|
||||
@ -25,23 +24,11 @@ fn main() {
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.plugin(
|
||||
tauri_plugin_sql::Builder::default()
|
||||
.add_migrations(
|
||||
"sqlite:lume.db",
|
||||
vec![Migration {
|
||||
version: 1,
|
||||
description: "create default tables",
|
||||
sql: include_str!("../migrations/20230226004139_create_tables.sql"),
|
||||
kind: MigrationKind::Up,
|
||||
}],
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
.on_window_event(|e| {
|
||||
#[cfg(target_os = "macos")]
|
||||
let apply_offset = || {
|
||||
let win = e.window();
|
||||
// keep inset for traffic lights when window resize (macos)
|
||||
win.position_traffic_lights(8.0, 20.0);
|
||||
};
|
||||
#[cfg(target_os = "macos")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user