Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(libquery): remove dmmf #4790

Merged
merged 3 commits into from May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 1 addition & 26 deletions query-engine/query-engine-node-api/src/engine.rs
Expand Up @@ -10,7 +10,7 @@ use query_engine_common::engine::{
ConstructorOptionsNative, EngineBuilder, EngineBuilderNative, Inner,
};
use query_engine_metrics::MetricFormat;
use request_handlers::{dmmf, load_executor, render_graphql_schema, ConnectorKind, RequestBody, RequestHandler};
use request_handlers::{load_executor, render_graphql_schema, ConnectorKind, RequestBody, RequestHandler};
use serde::Deserialize;
use serde_json::json;
use std::{collections::HashMap, future::Future, marker::PhantomData, panic::AssertUnwindSafe, sync::Arc};
Expand Down Expand Up @@ -392,31 +392,6 @@ impl QueryEngine {
.await
}

#[napi]
pub async fn dmmf(&self, trace: String) -> napi::Result<String> {
async_panic_to_js_error(async {
let inner = self.inner.read().await;
let engine = inner.as_engine()?;

let dispatcher = self.logger.dispatcher();

tracing::dispatcher::with_default(&dispatcher, || {
let span = tracing::info_span!("prisma:engine:dmmf");
let _ = telemetry::helpers::set_parent_context_from_json_str(&span, &trace);
let _guard = span.enter();
let dmmf = dmmf::render_dmmf(&engine.query_schema);

let json = {
let _span = tracing::info_span!("prisma:engine:dmmf_to_json").entered();
serde_json::to_string(&dmmf)?
};

Ok(json)
})
})
.await
}

/// If connected, attempts to roll back a transaction with id `tx_id` in the core.
#[napi]
pub async fn rollback_transaction(&self, tx_id: String, _trace: String) -> napi::Result<String> {
Expand Down