1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

mysql: migrate connection flags to enum instead of const, fix example (#7803)

This commit is contained in:
Don Alfons Nisnoni
2021-01-02 21:09:20 +08:00
committed by GitHub
parent 7f776bfd29
commit e943d03298
3 changed files with 37 additions and 32 deletions

View File

@ -1,5 +1,25 @@
module mysql
// Values for the capabilities flag bitmask used by the MySQL protocol.
// See more on https://dev.mysql.com/doc/dev/mysql-server/latest/group__group__cs__capabilities__flags.html#details
pub enum ConnectionFlag {
// CAN_HANDLE_EXPIRED_PASSWORDS = C.CAN_HANDLE_EXPIRED_PASSWORDS
client_compress = C.CLIENT_COMPRESS
client_found_rows = C.CLIENT_FOUND_ROWS
client_ignore_sigpipe = C.CLIENT_IGNORE_SIGPIPE
client_ignore_space = C.CLIENT_IGNORE_SPACE
client_interactive = C.CLIENT_INTERACTIVE
client_local_files = C.CLIENT_LOCAL_FILES
client_multi_results = C.CLIENT_MULTI_RESULTS
client_multi_statements = C.CLIENT_MULTI_STATEMENTS
client_no_schema = C.CLIENT_NO_SCHEMA
client_odbc = C.CLIENT_ODBC
// client_optional_resultset_metadata = C.CLIENT_OPTIONAL_RESULTSET_METADATA
client_ssl = C.CLIENT_SSL
client_remember_options = C.CLIENT_REMEMBER_OPTIONS
}
// TODO: Documentation
pub struct Connection {
mut:
@ -10,7 +30,7 @@ pub mut:
username string
password string
dbname string
flag int
flag ConnectionFlag
}
// connect connects to a MySQL server.