fix prisma client codegen - again

This commit is contained in:
Jamie Pine
2022-03-06 21:13:40 -08:00
parent ff7ebc618f
commit a019e2c290
5 changed files with 12 additions and 13 deletions

View File

Binary file not shown.

BIN
packages/core/Cargo.lock generated
View File

Binary file not shown.

View File

@@ -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>(

View File

File diff suppressed because one or more lines are too long

View File

@@ -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")