Skip to content

Commit

Permalink
mysql example added
Browse files Browse the repository at this point in the history
Signed-off-by: EraKin575 <[email protected]>
  • Loading branch information
EraKin575 committed Jan 10, 2024
1 parent 2003231 commit 0c749e4
Show file tree
Hide file tree
Showing 10 changed files with 1,798 additions and 0 deletions.
14 changes: 14 additions & 0 deletions js-mysql/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.1'

services:
db:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: mydb
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
378 changes: 378 additions & 0 deletions js-mysql/keploy/test-set-0/mocks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,378 @@
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: HANDSHAKE_RESPONSE
responseOperation: MySQLOK
type: config
requests:
- header:
packet_length: 134
packet_number: 1
packet_type: HANDSHAKE_RESPONSE
message:
capability_flags: 280687567
max_packet_size: 0
character_set: 224
reserved:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
username: user
auth_data:
- 206
- 145
- 78
- 100
- 171
- 47
- 27
- 11
- 200
- 55
- 192
- 40
- 5
- 118
- 199
- 231
- 86
- 34
- 154
- 20
database: mydb
auth_plugin_name: mysql_native_password
connect_attributes:
_client_name: Node-MySQL-2
_client_version: 3.7.0
zstdcompressionlevel: 0
responses:
- header:
packet_length: 73
packet_number: 0
packet_type: MySQLHandshakeV10
message:
protocol_version: 10
server_version: 8.2.0
connection_id: 9
auth_plugin_data:
- 110
- 20
- 39
- 8
- 24
- 115
- 95
- 39
- 44
- 19
- 30
- 30
- 50
- 59
- 18
- 4
- 47
- 113
- 120
- 68
- 0
capability_flags: 3758096383
character_set: 255
status_flags: 2
auth_plugin_name: mysql_native_password
- header:
packet_length: 16
packet_number: 2
packet_type: MySQLOK
message:
affected_rows: 0
last_insert_id: 0
status_flags: 16386
warnings: 0
info: "\0\a\x01\x05\x04mydb"
created: 1704863677
---
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: MySQLQuery
responseOperation: MySQLOK
type: mocks
requests:
- header:
packet_length: 235
packet_number: 0
packet_type: MySQLQuery
message:
command: 3
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 "
responses:
- header:
packet_length: 7
packet_number: 1
packet_type: MySQLOK
message:
affected_rows: 0
last_insert_id: 0
status_flags: 2
warnings: 1
info: ""
created: 1704863677
---
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: MySQLQuery
responseOperation: MySQLOK
type: mocks
requests:
- header:
packet_length: 71
packet_number: 0
packet_type: MySQLQuery
message:
command: 3
query: INSERT INTO items SET `name` = 'Item1', `description` = 'Description1'
responses:
- header:
packet_length: 7
packet_number: 1
packet_type: MySQLOK
message:
affected_rows: 1
last_insert_id: 2
status_flags: 2
warnings: 0
info: ""
created: 1704863681
---
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: MySQLQuery
responseOperation: RESULT_SET_PACKET
type: mocks
requests:
- header:
packet_length: 20
packet_number: 0
packet_type: MySQLQuery
message:
command: 3
query: SELECT * FROM items
responses:
- header:
packet_length: 1
packet_number: 1
packet_type: RESULT_SET_PACKET
message:
columns:
- packet_header:
packet_length: 40
packet_sequence_id: 2
catalog: def
schema: mydb
table: items
org_table: items
name: id
org_name: id
next_length: 0
character_set: 63
column_length: 11
column_type: 3
flags: 16899
decimals: 0
string: ""
- packet_header:
packet_length: 44
packet_sequence_id: 3
catalog: def
schema: mydb
table: items
org_table: items
name: name
org_name: name
next_length: 0
character_set: 224
column_length: 1020
column_type: 253
flags: 4097
decimals: 0
string: ""
- packet_header:
packet_length: 58
packet_sequence_id: 4
catalog: def
schema: mydb
table: items
org_table: items
name: description
org_name: description
next_length: 0
character_set: 224
column_length: 262140
column_type: 252
flags: 16
decimals: 0
string: ""
- packet_header:
packet_length: 56
packet_sequence_id: 5
catalog: def
schema: mydb
table: items
org_table: items
name: created_at
org_name: created_at
next_length: 0
character_set: 63
column_length: 19
column_type: 7
flags: 1152
decimals: 0
string: ""
rows:
- header:
packet_length: 41
sequence_id: 7
row_column_definition:
- type: 3
name: id
value: "1"
- type: 253
name: name
value: Item1
- type: 252
name: description
value: Description1
- type: 7
name: created_at
value: 12338-50-52 45:48:49
- header:
packet_length: 41
sequence_id: 8
row_column_definition:
- type: 3
name: id
value: "2"
- type: 253
name: name
value: Item1
- type: 252
name: description
value: Description1
- type: 7
name: created_at
value: 12338-50-52 45:48:49
eofPresent: true
paddingPresent: false
eofPresentFinal: true
paddingPresentFinal: false
optionalPadding: false
optionalEOFBytes:
- 5
- 0
- 0
- 9
- 254
- 0
- 0
- 34
- 0
eofAfterColumns:
- 5
- 0
- 0
- 6
- 254
- 0
- 0
- 34
- 0
created: 1704863692
---
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: MySQLQuery
responseOperation: MySQLOK
type: mocks
requests:
- header:
packet_length: 93
packet_number: 0
packet_type: MySQLQuery
message:
command: 3
query: UPDATE items SET `name` = 'UpdatedItem', `description` = 'UpdatedDescription' WHERE id = '1'
responses:
- header:
packet_length: 48
packet_number: 1
packet_type: MySQLOK
message:
affected_rows: 1
last_insert_id: 0
status_flags: 2
warnings: 0
info: '(Rows matched: 1 Changed: 1 Warnings: 0'
created: 1704863702
---
version: api.keploy.io/v1beta1
kind: SQL
name: mocks
spec:
metadata:
operation: MySQLQuery
responseOperation: MySQLOK
type: mocks
requests:
- header:
packet_length: 33
packet_number: 0
packet_type: MySQLQuery
message:
command: 3
query: DELETE FROM items WHERE id = '1'
responses:
- header:
packet_length: 7
packet_number: 1
packet_type: MySQLOK
message:
affected_rows: 1
last_insert_id: 0
status_flags: 2
warnings: 0
info: ""
created: 1704863719
Loading

0 comments on commit 0c749e4

Please sign in to comment.