vtclient
vtclient
vtclient connects to a vtgate server using the standard go driver API.
Synopsis
vtclient connects to a vtgate server using the standard go driver API.
For query bound variables, we assume place-holders in the query string in the form of :v1, :v2, etc.
1. vtclient <query> [flags]
Examples
1. vtclient --server vtgate:15991 "SELECT * FROM messages"
3. vtclient --server vtgate:15991 --target '@primary' --bind_variables '[ 12345, 1, "msg 12345" ]' "INSERT INTO messages (page,time_created_ns,message) VALUES (:v1, :v2, :v3)"
Options
1. --alsologtostderr log to standard error as well as files
2. --bind_variables float bind variables as a json list (default null)
3. --config-file string Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
4. --config-file-not-found-handling ConfigFileNotFoundHandling Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
5. --config-name string Name of the config file (without extension) to search for. (default "vtconfig")
6. --config-path strings Paths to search for config files in. (default [$WORKDIR])
7. --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s)
8. --config-type string Config file type (omit to infer config type from file extension).
9. --count int DMLs only: Number of times each thread executes the query. Useful for simple, sustained load testing. (default 1)
10. --grpc_enable_tracing Enable gRPC tracing.
11. --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
12. --grpc_prometheus Enable gRPC monitoring with Prometheus.
13. -h, --help help for vtclient
14. --json Output JSON instead of human-readable table
15. --keep_logs duration keep logs for this long (using ctime) (zero to keep forever)
16. --keep_logs_by_mtime duration keep logs for this long (using mtime) (zero to keep forever)
17. --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
18. --log_dir string If non-empty, write log files in this directory
19. --log_err_stacks log stack traces for errors
20. --log_rotate_max_size uint size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
21. --logtostderr log to standard error instead of files
22. --max_sequence_id int max sequence ID.
23. --min_sequence_id int min sequence ID to generate. When max_sequence_id > min_sequence_id, for each query, a number is generated in [min_sequence_id, max_sequence_id) and attached to the end of the bind variables.
24. --mysql_server_version string MySQL server version to advertise. (default "8.0.30-Vitess")
25. --parallel int DMLs only: Number of threads executing the same query in parallel. Useful for simple load testing. (default 1)
26. --pprof strings enable profiling
27. --purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
28. --qps int queries per second to throttle each thread at.
29. --security_policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
30. --server string vtgate server to connect to
31. --stderrthreshold severity logs at or above this threshold go to stderr (default 1)
32. --streaming use a streaming query
33. --target string keyspace:shard@tablet_type
34. --timeout duration timeout for queries (default 30s)
35. --use_random_sequence use random sequence for generating [min_sequence_id, max_sequence_id)
36. --v Level log level for V logs
37. -v, --version print binary version
38. --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
