forked from prisma/prisma-engines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
213 lines (146 loc) Β· 5.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
CONFIG_PATH = ./query-engine/connector-test-kit-rs/test-configs
CONFIG_FILE = .test_config
SCHEMA_EXAMPLES_PATH = ./query-engine/example_schemas
DEV_SCHEMA_FILE = dev_datamodel.prisma
default: build
##################
# Build commands #
##################
build:
cargo build
# Emulate pedantic CI compilation.
pedantic:
RUSTFLAGS="-D warnings" cargo fmt -- --check && RUSTFLAGS="-D warnings" cargo clippy --all-targets
release:
cargo build --release
#################
# Test commands #
#################
test-qe:
cargo test --package query-engine-tests
test-qe-verbose:
cargo test --package query-engine-tests -- --nocapture
# Single threaded thread execution.
test-qe-st:
cargo test --package query-engine-tests -- --test-threads 1
# Single threaded thread execution, verbose.
test-qe-verbose-st:
cargo test --package query-engine-tests -- --nocapture --test-threads 1
###########################
# Database setup commands #
###########################
all-dbs-up:
docker-compose -f docker-compose.yml up -d --remove-orphans
all-dbs-down:
docker-compose -f docker-compose.yml down -v --remove-orphans
start-sqlite:
dev-sqlite:
cp $(CONFIG_PATH)/sqlite $(CONFIG_FILE)
start-postgres9:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres9
dev-postgres9: start-postgres9
cp $(CONFIG_PATH)/postgres9 $(CONFIG_FILE)
start-postgres10:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres10
dev-postgres10: start-postgres10
cp $(CONFIG_PATH)/postgres10 $(CONFIG_FILE)
start-postgres11:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres11
dev-postgres11: start-postgres11
cp $(CONFIG_PATH)/postgres11 $(CONFIG_FILE)
start-postgres12:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres12
dev-postgres12: start-postgres12
cp $(CONFIG_PATH)/postgres12 $(CONFIG_FILE)
start-postgres13:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres13
dev-postgres13: start-postgres13
cp $(CONFIG_PATH)/postgres13 $(CONFIG_FILE)
start-postgres14:
docker-compose -f docker-compose.yml up -d --remove-orphans postgres14
dev-postgres14: start-postgres14
cp $(CONFIG_PATH)/postgres14 $(CONFIG_FILE)
start-cockroach:
docker-compose -f docker-compose.yml up -d --remove-orphans cockroach
dev-cockroach: start-cockroach
cp $(CONFIG_PATH)/cockroach $(CONFIG_FILE)
dev-pgbouncer:
docker-compose -f docker-compose.yml up -d --remove-orphans pgbouncer postgres11
start-mysql_5_7:
docker-compose -f docker-compose.yml up -d --remove-orphans mysql-5-7
dev-mysql: start-mysql_5_7
cp $(CONFIG_PATH)/mysql57 $(CONFIG_FILE)
start-mysql_5_6:
docker-compose -f docker-compose.yml up -d --remove-orphans mysql-5-6
dev-mysql_5_6: start-mysql_5_6
cp $(CONFIG_PATH)/mysql56 $(CONFIG_FILE)
start-mysql_8:
docker-compose -f docker-compose.yml up -d --remove-orphans mysql-8-0
dev-mysql8: start-mysql_8
cp $(CONFIG_PATH)/mysql8 $(CONFIG_FILE)
start-mysql_mariadb:
docker-compose -f docker-compose.yml up -d --remove-orphans mariadb-10-0
dev-mariadb: start-mysql_mariadb
cp $(CONFIG_PATH)/mariadb $(CONFIG_FILE)
start-mssql_2019:
docker-compose -f docker-compose.yml up -d --remove-orphans mssql-2019
dev-mssql2019: start-mssql_2019
cp $(CONFIG_PATH)/sqlserver2019 $(CONFIG_FILE)
start-mssql_2017:
docker-compose -f docker-compose.yml up -d --remove-orphans mssql-2017
dev-mssql2017: start-mssql_2017
cp $(CONFIG_PATH)/sqlserver2017 $(CONFIG_FILE)
start-mongodb42-single:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo42-single
start-mongodb44-single:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo44-single
start-mongodb4-single: start-mongodb44-single
start-mongodb5-single:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo5-single
start-mongodb_4_2:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo42
start-mongodb_4_4:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo44
dev-mongodb_4_4: start-mongodb_4_4
cp $(CONFIG_PATH)/mongodb44 $(CONFIG_FILE)
start-mongodb_5:
docker-compose -f docker-compose.yml up -d --remove-orphans mongo5
dev-mongodb_5: start-mongodb_5
cp $(CONFIG_PATH)/mongodb5 $(CONFIG_FILE)
dev-mongodb_4_2: start-mongodb_4_2
cp $(CONFIG_PATH)/mongodb42 $(CONFIG_FILE)
start-vitess_5_7:
docker-compose -f docker-compose.yml up -d --remove-orphans vitess-test-5_7 vitess-shadow-5_7
dev-vitess_5_7: start-vitess_5_7
cp $(CONFIG_PATH)/vitess_5_7 $(CONFIG_FILE)
start-vitess_8_0:
docker-compose -f docker-compose.yml up -d --remove-orphans vitess-test-8_0 vitess-shadow-8_0
dev-vitess_8_0: start-vitess_8_0
cp $(CONFIG_PATH)/vitess_8_0 $(CONFIG_FILE)
######################
# Local dev commands #
######################
qe:
cargo run --bin query-engine -- --enable-playground --enable-raw-queries
qe-dmmf:
cargo run --bin query-engine -- cli dmmf > dmmf.json
push-schema:
cargo run --bin test-cli -- schema-push $(DEV_SCHEMA_FILE) --force
qe-dev-chinook-sqlite:
cp $(SCHEMA_EXAMPLES_PATH)/chinook_sqlite.prisma $(DEV_SCHEMA_FILE)
qe-dev-chinook-postgres10: start-postgres10
cp $(SCHEMA_EXAMPLES_PATH)/chinook_postgres10.prisma $(DEV_SCHEMA_FILE)
sleep 5
make push-schema
qe-dev-mongo_4_4: start-mongodb_4_4
cp $(SCHEMA_EXAMPLES_PATH)/generic_mongo4.prisma $(DEV_SCHEMA_FILE)
use-local-migration-engine:
cargo build --release
cp target/release/migration-engine $(PRISMA2_BINARY_PATH)/
use-local-query-engine:
cargo build --release
cp target/release/query-engine $(PRISMA2_BINARY_PATH)/runtime/
cp target/release/query-engine $(PRISMA2_BINARY_PATH)/query-engine-darwin
## OpenTelemetry
otel:
docker-compose up --remove-orphans -d otel