Skip to content

Commit 0c749e4

Browse files
committed
mysql example added
Signed-off-by: EraKin575 <tejaskumar574@gmail.com>
1 parent 2003231 commit 0c749e4

File tree

10 files changed

+1798
-0
lines changed

10 files changed

+1798
-0
lines changed

js-mysql/docker-compose.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.1'
2+
3+
services:
4+
db:
5+
image: mysql:latest
6+
command: --default-authentication-plugin=mysql_native_password
7+
restart: always
8+
environment:
9+
MYSQL_ROOT_PASSWORD: rootpassword
10+
MYSQL_DATABASE: mydb
11+
MYSQL_USER: user
12+
MYSQL_PASSWORD: password
13+
ports:
14+
- "3306:3306"
Lines changed: 378 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,378 @@
1+
version: api.keploy.io/v1beta1
2+
kind: SQL
3+
name: mocks
4+
spec:
5+
metadata:
6+
operation: HANDSHAKE_RESPONSE
7+
responseOperation: MySQLOK
8+
type: config
9+
requests:
10+
- header:
11+
packet_length: 134
12+
packet_number: 1
13+
packet_type: HANDSHAKE_RESPONSE
14+
message:
15+
capability_flags: 280687567
16+
max_packet_size: 0
17+
character_set: 224
18+
reserved:
19+
- 0
20+
- 0
21+
- 0
22+
- 0
23+
- 0
24+
- 0
25+
- 0
26+
- 0
27+
- 0
28+
- 0
29+
- 0
30+
- 0
31+
- 0
32+
- 0
33+
- 0
34+
- 0
35+
- 0
36+
- 0
37+
- 0
38+
- 0
39+
- 0
40+
- 0
41+
- 0
42+
username: user
43+
auth_data:
44+
- 206
45+
- 145
46+
- 78
47+
- 100
48+
- 171
49+
- 47
50+
- 27
51+
- 11
52+
- 200
53+
- 55
54+
- 192
55+
- 40
56+
- 5
57+
- 118
58+
- 199
59+
- 231
60+
- 86
61+
- 34
62+
- 154
63+
- 20
64+
database: mydb
65+
auth_plugin_name: mysql_native_password
66+
connect_attributes:
67+
_client_name: Node-MySQL-2
68+
_client_version: 3.7.0
69+
zstdcompressionlevel: 0
70+
responses:
71+
- header:
72+
packet_length: 73
73+
packet_number: 0
74+
packet_type: MySQLHandshakeV10
75+
message:
76+
protocol_version: 10
77+
server_version: 8.2.0
78+
connection_id: 9
79+
auth_plugin_data:
80+
- 110
81+
- 20
82+
- 39
83+
- 8
84+
- 24
85+
- 115
86+
- 95
87+
- 39
88+
- 44
89+
- 19
90+
- 30
91+
- 30
92+
- 50
93+
- 59
94+
- 18
95+
- 4
96+
- 47
97+
- 113
98+
- 120
99+
- 68
100+
- 0
101+
capability_flags: 3758096383
102+
character_set: 255
103+
status_flags: 2
104+
auth_plugin_name: mysql_native_password
105+
- header:
106+
packet_length: 16
107+
packet_number: 2
108+
packet_type: MySQLOK
109+
message:
110+
affected_rows: 0
111+
last_insert_id: 0
112+
status_flags: 16386
113+
warnings: 0
114+
info: "\0\a\x01\x05\x04mydb"
115+
created: 1704863677
116+
---
117+
version: api.keploy.io/v1beta1
118+
kind: SQL
119+
name: mocks
120+
spec:
121+
metadata:
122+
operation: MySQLQuery
123+
responseOperation: MySQLOK
124+
type: mocks
125+
requests:
126+
- header:
127+
packet_length: 235
128+
packet_number: 0
129+
packet_type: MySQLQuery
130+
message:
131+
command: 3
132+
query: "\n CREATE TABLE IF NOT EXISTS items (\n id INT AUTO_INCREMENT PRIMARY KEY,\n name VARCHAR(255) NOT NULL,\n description TEXT,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n )\n "
133+
responses:
134+
- header:
135+
packet_length: 7
136+
packet_number: 1
137+
packet_type: MySQLOK
138+
message:
139+
affected_rows: 0
140+
last_insert_id: 0
141+
status_flags: 2
142+
warnings: 1
143+
info: ""
144+
created: 1704863677
145+
---
146+
version: api.keploy.io/v1beta1
147+
kind: SQL
148+
name: mocks
149+
spec:
150+
metadata:
151+
operation: MySQLQuery
152+
responseOperation: MySQLOK
153+
type: mocks
154+
requests:
155+
- header:
156+
packet_length: 71
157+
packet_number: 0
158+
packet_type: MySQLQuery
159+
message:
160+
command: 3
161+
query: INSERT INTO items SET `name` = 'Item1', `description` = 'Description1'
162+
responses:
163+
- header:
164+
packet_length: 7
165+
packet_number: 1
166+
packet_type: MySQLOK
167+
message:
168+
affected_rows: 1
169+
last_insert_id: 2
170+
status_flags: 2
171+
warnings: 0
172+
info: ""
173+
created: 1704863681
174+
---
175+
version: api.keploy.io/v1beta1
176+
kind: SQL
177+
name: mocks
178+
spec:
179+
metadata:
180+
operation: MySQLQuery
181+
responseOperation: RESULT_SET_PACKET
182+
type: mocks
183+
requests:
184+
- header:
185+
packet_length: 20
186+
packet_number: 0
187+
packet_type: MySQLQuery
188+
message:
189+
command: 3
190+
query: SELECT * FROM items
191+
responses:
192+
- header:
193+
packet_length: 1
194+
packet_number: 1
195+
packet_type: RESULT_SET_PACKET
196+
message:
197+
columns:
198+
- packet_header:
199+
packet_length: 40
200+
packet_sequence_id: 2
201+
catalog: def
202+
schema: mydb
203+
table: items
204+
org_table: items
205+
name: id
206+
org_name: id
207+
next_length: 0
208+
character_set: 63
209+
column_length: 11
210+
column_type: 3
211+
flags: 16899
212+
decimals: 0
213+
string: ""
214+
- packet_header:
215+
packet_length: 44
216+
packet_sequence_id: 3
217+
catalog: def
218+
schema: mydb
219+
table: items
220+
org_table: items
221+
name: name
222+
org_name: name
223+
next_length: 0
224+
character_set: 224
225+
column_length: 1020
226+
column_type: 253
227+
flags: 4097
228+
decimals: 0
229+
string: ""
230+
- packet_header:
231+
packet_length: 58
232+
packet_sequence_id: 4
233+
catalog: def
234+
schema: mydb
235+
table: items
236+
org_table: items
237+
name: description
238+
org_name: description
239+
next_length: 0
240+
character_set: 224
241+
column_length: 262140
242+
column_type: 252
243+
flags: 16
244+
decimals: 0
245+
string: ""
246+
- packet_header:
247+
packet_length: 56
248+
packet_sequence_id: 5
249+
catalog: def
250+
schema: mydb
251+
table: items
252+
org_table: items
253+
name: created_at
254+
org_name: created_at
255+
next_length: 0
256+
character_set: 63
257+
column_length: 19
258+
column_type: 7
259+
flags: 1152
260+
decimals: 0
261+
string: ""
262+
rows:
263+
- header:
264+
packet_length: 41
265+
sequence_id: 7
266+
row_column_definition:
267+
- type: 3
268+
name: id
269+
value: "1"
270+
- type: 253
271+
name: name
272+
value: Item1
273+
- type: 252
274+
name: description
275+
value: Description1
276+
- type: 7
277+
name: created_at
278+
value: 12338-50-52 45:48:49
279+
- header:
280+
packet_length: 41
281+
sequence_id: 8
282+
row_column_definition:
283+
- type: 3
284+
name: id
285+
value: "2"
286+
- type: 253
287+
name: name
288+
value: Item1
289+
- type: 252
290+
name: description
291+
value: Description1
292+
- type: 7
293+
name: created_at
294+
value: 12338-50-52 45:48:49
295+
eofPresent: true
296+
paddingPresent: false
297+
eofPresentFinal: true
298+
paddingPresentFinal: false
299+
optionalPadding: false
300+
optionalEOFBytes:
301+
- 5
302+
- 0
303+
- 0
304+
- 9
305+
- 254
306+
- 0
307+
- 0
308+
- 34
309+
- 0
310+
eofAfterColumns:
311+
- 5
312+
- 0
313+
- 0
314+
- 6
315+
- 254
316+
- 0
317+
- 0
318+
- 34
319+
- 0
320+
created: 1704863692
321+
---
322+
version: api.keploy.io/v1beta1
323+
kind: SQL
324+
name: mocks
325+
spec:
326+
metadata:
327+
operation: MySQLQuery
328+
responseOperation: MySQLOK
329+
type: mocks
330+
requests:
331+
- header:
332+
packet_length: 93
333+
packet_number: 0
334+
packet_type: MySQLQuery
335+
message:
336+
command: 3
337+
query: UPDATE items SET `name` = 'UpdatedItem', `description` = 'UpdatedDescription' WHERE id = '1'
338+
responses:
339+
- header:
340+
packet_length: 48
341+
packet_number: 1
342+
packet_type: MySQLOK
343+
message:
344+
affected_rows: 1
345+
last_insert_id: 0
346+
status_flags: 2
347+
warnings: 0
348+
info: '(Rows matched: 1 Changed: 1 Warnings: 0'
349+
created: 1704863702
350+
---
351+
version: api.keploy.io/v1beta1
352+
kind: SQL
353+
name: mocks
354+
spec:
355+
metadata:
356+
operation: MySQLQuery
357+
responseOperation: MySQLOK
358+
type: mocks
359+
requests:
360+
- header:
361+
packet_length: 33
362+
packet_number: 0
363+
packet_type: MySQLQuery
364+
message:
365+
command: 3
366+
query: DELETE FROM items WHERE id = '1'
367+
responses:
368+
- header:
369+
packet_length: 7
370+
packet_number: 1
371+
packet_type: MySQLOK
372+
message:
373+
affected_rows: 1
374+
last_insert_id: 0
375+
status_flags: 2
376+
warnings: 0
377+
info: ""
378+
created: 1704863719

0 commit comments

Comments
 (0)