-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
81 lines (65 loc) · 2.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY: example
export DB_USERNAME := root
export DB_DATABASE := gravityr
export HASURA_URL := http://localhost:8081
export HASURA_ADMIN_SECRET := myadminsecretkey
export JAEGER_UI_URL := http://localhost:16686
export JAEGER_GRPC_ADDRESS := localhost:16685
devSetup:
go install github.com/spf13/cobra-cli@latest
go install github.com/vektra/mockery/v2@latest
# mockery usage:
# mockery --name Reader --srcpkg github.com/jaegertracing/jaeger/storage/spanstore --output mocks/jaeger --outpkg jaegermock
lint:
golangci-lint run --fix
test:
go test ./...
build_client:
cd client && yarn build
build: build_client
go build -o dist/gr main.go
clean_client:
rm -rf client/dist/
clean: clean_client
rm -rf dist/
release_snapshot: clean_client build_client
rm -rf dist/goreleaser
goreleaser release --snapshot --rm-dist
define example_query
SELECT
name,
t.description
FROM
users
INNER JOIN tasks AS t ON users.id = t.user_id
WHERE
users.email = 'test31776@example.com'
endef
export example_query
define example_gql
query MyQuery($$email: String) {
users(where: {email: {_eq: $$email}}) {
email
name
tasks(where: {}) {
title
description
}
}
}
endef
export example_gql
define example_gql_variables
{"email": "test33333@example.com"}
endef
export example_gql_variables
example:
mkdir -p example
./dist/gr db suggest hasura postgres -o "example/hasura_postgres.html" -q "$${example_gql}" --json-variables "$${example_gql_variables}"
./dist/gr db suggest hasura postgres --with-examine -o "example/hasura_postgres_examine.html" -q "$${example_gql}" --json-variables "$${example_gql_variables}"
./dist/gr db suggest mysql -o "example/mysql.html" -q "$${example_query}"
./dist/gr db suggest mysql --with-examine -o "example/mysql_examine.html" -q "$${example_query}"
./dist/gr db suggest postgres -o "example/postgres.html" -q "$${example_query}"
./dist/gr db suggest postgres --with-examine -o "example/postgres_examine.html" -q "$${example_query}"
./dist/gr db dig performance-insights -o "example/performance-insights.html" --use-mock --start-from 2022-08-04T14:00:00Z
./dist/gr app dig jaeger -o "example/jaeger.html" --service-name bff --start-from 2001-02-03T00:00:00Z