mysql> show create table edges\G
*************************** 1. row ***************************
Table: edges
Create Table: CREATE TABLE `edges` (
`id` bigint NOT NULL AUTO_INCREMENT,
`from_event_id` varchar(64) NOT NULL,
`to_entity_id` varchar(64) NOT NULL,
`to_entity_type` int NOT NULL,
`from_event_type` int NOT NULL,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mysql.connector | |
| import random | |
| import time | |
| # ================= 配置区域 ================= | |
| DB_CONFIG = { | |
| 'host': '127.0.0.1', # 替换 TiDB IP | |
| 'port': 4000, | |
| 'user': 'root', # 替换用户名 | |
| 'password': '', # 替换密码 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql> show create table t\G | |
| *************************** 1. row *************************** | |
| Table: t | |
| Create Table: CREATE TABLE `t` ( | |
| `id` int NOT NULL, | |
| `a` int DEFAULT NULL, | |
| `b` int DEFAULT NULL, | |
| `c` int DEFAULT NULL, | |
| `padding` varchar(100) DEFAULT NULL, | |
| PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pymysql | |
| import random | |
| import time | |
| # --- 数据库配置 --- | |
| DB_CONFIG = { | |
| 'host': '127.0.0.1', # 默认为本地,如果 TiDB 在远程请修改 IP | |
| 'port': 4000, | |
| 'user': 'root', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql> show create table audit_log_events\G | |
| *************************** 1. row *************************** | |
| Table: audit_log_events | |
| Create Table: CREATE TABLE `audit_log_events` ( | |
| `id` bigint unsigned NOT NULL AUTO_INCREMENT, | |
| `event_uuid` varbinary(16) NOT NULL, | |
| `created_at` timestamp(6) NOT NULL, | |
| `user_uuid` binary(16) DEFAULT NULL, | |
| `source_hash` binary(64) DEFAULT NULL, | |
| `device_code` varchar(32) DEFAULT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pymysql | |
| import random | |
| import time | |
| import binascii | |
| from datetime import datetime, timedelta | |
| # --- Database Configuration --- | |
| DB_CONFIG = { | |
| 'host': '127.0.0.1', | |
| 'port': 4000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/rand" | |
| "database/sql" | |
| "encoding/hex" | |
| "fmt" | |
| "log" | |
| "os" | |
| "strconv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| import mysql.connector | |
| from mysql.connector import Error | |
| import random | |
| import string | |
| import time | |
| from datetime import datetime, timedelta | |
| from collections import Counter | |
| import logging | |
| from logging.handlers import RotatingFileHandler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| config=""" | |
| [data-sources] | |
| [data-sources.mysql] | |
| host = "127.0.0.1" | |
| port = 3306 | |
| user = "root" | |
| password = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| import string | |
| import datetime | |
| import mysql.connector | |
| import time | |
| def random_string(length=10): | |
| return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) | |
| def random_date(start_year=2000, end_year=2025): |
NewerOlder