From 05780f9e2ef64e863aeab05836a9c6a7a09eb726 Mon Sep 17 00:00:00 2001 From: Miguel Fernandez Date: Mon, 22 Jan 2024 16:16:38 +0100 Subject: [PATCH] Checkout Makefile from main --- Makefile | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index a8f68b3852d0..cbf9a6bf07ee 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CONFIG_FILE = .test_config SCHEMA_EXAMPLES_PATH = ./query-engine/example_schemas DEV_SCHEMA_FILE = dev_datamodel.prisma DRIVER_ADAPTERS_BRANCH ?= main -NIX := $(shell command -v nix 2> /dev/null) +NIX := $(shell type nix 2> /dev/null) LIBRARY_EXT := $(shell \ case "$$(uname -s)" in \ @@ -327,7 +327,7 @@ build-qe-napi: cargo build --package query-engine-node-api --profile $(PROFILE) build-qe-wasm: -ifneq ($(strip $(NIX)),) +ifdef NIX @echo "Building wasm engine on nix" rm -rf query-engine/query-engine-wasm/pkg nix run .#export-query-engine-wasm query-engine/query-engine-wasm/pkg 0.0.0 @@ -335,17 +335,9 @@ else cd query-engine/query-engine-wasm && ./build.sh endif -.PHONY: measure-qe-wasm measure-qe-wasm: build-qe-wasm @cd query-engine/query-engine-wasm/pkg; \ - gzip -c query_engine_bg.wasm | wc -c | awk '{$$1/=(1024*1024); printf "%.3fMB\n", $$1}' > temp_size.txt; \ - if [ ! -f size.txt ]; then \ - echo "0MB" > size.txt; \ - fi; \ - echo "Previous size: `cat size.txt`"; \ - echo "Current size: `cat temp_size.txt`"; \ - awk '{print $$1}' size.txt temp_size.txt | paste -d" " - - | awk '{printf "Increment: %.3fMB\n", $$2 - $$1}'; \ - mv temp_size.txt size.txt; \ + gzip -k -c query_engine_bg.wasm | wc -c | awk '{$$1/=(1024*1024); printf "Current wasm query-engine size compressed: %.3fMB\n", $$1}' build-driver-adapters-kit: build-driver-adapters cd query-engine/driver-adapters && pnpm i && pnpm build @@ -372,7 +364,10 @@ validate: cargo run --bin test-cli -- validate-datamodel dev_datamodel.prisma qe: - cargo run --bin query-engine -- --enable-playground --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response + cargo run --bin query-engine -- --engine-protocol json --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response + +qe-graphql: + cargo run --bin query-engine -- --engine-protocol graphql --enable-playground --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response qe-dmmf: cargo run --bin query-engine -- cli dmmf > dmmf.json