mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-23 16:07:15 -04:00
fix prisma client codegen - again
This commit is contained in:
BIN
apps/desktop/src-tauri/Cargo.lock
generated
BIN
apps/desktop/src-tauri/Cargo.lock
generated
Binary file not shown.
BIN
packages/core/Cargo.lock
generated
BIN
packages/core/Cargo.lock
generated
Binary file not shown.
@@ -1,6 +1,9 @@
|
||||
use crate::file::checksum::sha256_digest;
|
||||
use crate::prisma::{Migration, PrismaClient};
|
||||
use crate::state;
|
||||
use crate::{
|
||||
prisma,
|
||||
prisma::{Migration, PrismaClient},
|
||||
};
|
||||
use anyhow::Result;
|
||||
use data_encoding::HEXLOWER;
|
||||
use include_dir::{include_dir, Dir};
|
||||
@@ -23,7 +26,7 @@ pub async fn get() -> Result<&'static PrismaClient, String> {
|
||||
let path = current_library.library_path.clone();
|
||||
// TODO: Error handling when brendan adds it to prisma-client-rust
|
||||
|
||||
let client = PrismaClient::new_with_url(&format!("file:{}", &path)).await;
|
||||
let client = prisma::new_client_with_url(&format!("file:{}", &path)).await;
|
||||
DB.set(client).unwrap_or_default();
|
||||
|
||||
Ok(DB.get().unwrap())
|
||||
@@ -36,7 +39,7 @@ const INIT_MIGRATION: &str = include_str!("../../prisma/migrations/migration_tab
|
||||
static MIGRATIONS_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/prisma/migrations");
|
||||
|
||||
pub async fn init(db_url: &str) -> Result<()> {
|
||||
let client = PrismaClient::new_with_url(&format!("file:{}", &db_url)).await;
|
||||
let client = prisma::new_client_with_url(&format!("file:{}", &db_url)).await;
|
||||
|
||||
match client
|
||||
._query_raw::<serde_json::Value>(
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -32,10 +32,6 @@ model Library {
|
||||
encryption Int @default(0)
|
||||
date_created DateTime @default(now())
|
||||
timezone String?
|
||||
// total_file_count Int @default(0)
|
||||
// total_bytes_used String @default("0")
|
||||
// total_byte_capacity String @default("0")
|
||||
// total_unique_bytes String @default("0")
|
||||
spaces Space[]
|
||||
|
||||
@@map("libraries")
|
||||
|
||||
Reference in New Issue
Block a user