sqlx_core/mysql/protocol/
capabilities.rs

1// https://dev.mysql.com/doc/dev/mysql-server/8.0.12/group__group__cs__capabilities__flags.html
2// https://mariadb.com/kb/en/library/connection/#capabilities
3bitflags::bitflags! {
4    pub struct Capabilities: u64 {
5        // [MariaDB] MySQL compatibility
6        const MYSQL = 1;
7
8        // [*] Send found rows instead of affected rows in EOF_Packet.
9        const FOUND_ROWS = 2;
10
11        // Get all column flags.
12        const LONG_FLAG = 4;
13
14        // [*] Database (schema) name can be specified on connect in Handshake Response Packet.
15        const CONNECT_WITH_DB = 8;
16
17        // Don't allow database.table.column
18        const NO_SCHEMA = 16;
19
20        // [*] Compression protocol supported
21        const COMPRESS = 32;
22
23        // Special handling of ODBC behavior.
24        const ODBC = 64;
25
26        // Can use LOAD DATA LOCAL
27        const LOCAL_FILES = 128;
28
29        // [*] Ignore spaces before '('
30        const IGNORE_SPACE = 256;
31
32        // [*] New 4.1+ protocol
33        const PROTOCOL_41 = 512;
34
35        // This is an interactive client
36        const INTERACTIVE = 1024;
37
38        // Use SSL encryption for this session
39        const SSL = 2048;
40
41        // Client knows about transactions
42        const TRANSACTIONS = 8192;
43
44        // 4.1+ authentication
45        const SECURE_CONNECTION = (1 << 15);
46
47        // Enable/disable multi-statement support for COM_QUERY *and* COM_STMT_PREPARE
48        const MULTI_STATEMENTS = (1 << 16);
49
50        // Enable/disable multi-results for COM_QUERY
51        const MULTI_RESULTS = (1 << 17);
52
53        // Enable/disable multi-results for COM_STMT_PREPARE
54        const PS_MULTI_RESULTS = (1 << 18);
55
56        // Client supports plugin authentication
57        const PLUGIN_AUTH = (1 << 19);
58
59        // Client supports connection attributes
60        const CONNECT_ATTRS = (1 << 20);
61
62        // Enable authentication response packet to be larger than 255 bytes.
63        const PLUGIN_AUTH_LENENC_DATA = (1 << 21);
64
65        // Don't close the connection for a user account with expired password.
66        const CAN_HANDLE_EXPIRED_PASSWORDS = (1 << 22);
67
68        // Capable of handling server state change information.
69        const SESSION_TRACK = (1 << 23);
70
71        // Client no longer needs EOF_Packet and will use OK_Packet instead.
72        const DEPRECATE_EOF = (1 << 24);
73
74        // Support ZSTD protocol compression
75        const ZSTD_COMPRESSION_ALGORITHM = (1 << 26);
76
77        // Verify server certificate
78        const SSL_VERIFY_SERVER_CERT = (1 << 30);
79
80        // The client can handle optional metadata information in the resultset
81        const OPTIONAL_RESULTSET_METADATA = (1 << 25);
82
83        // Don't reset the options after an unsuccessful connect
84        const REMEMBER_OPTIONS = (1 << 31);
85    }
86}