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

mysql: refactor, comments, simplify (#18258)

This commit is contained in:
Mark aka walkingdevel
2023-05-25 00:50:15 +00:00
committed by GitHub
parent 010a5c26a0
commit 351b2e0e42
9 changed files with 259 additions and 169 deletions

View File

@@ -1,6 +1,6 @@
module mysql
// FieldType is a list of all supported MYSQL field types
// FieldType is a list of all supported MYSQL field types.
pub enum FieldType {
type_decimal
type_tiny
@@ -35,7 +35,7 @@ pub enum FieldType {
type_geometry
}
// str returns a text representation of the field type `f`
// str returns a text representation of the field type `f`.
pub fn (f FieldType) str() string {
return match f {
.type_decimal { 'decimal' }
@@ -72,7 +72,8 @@ pub fn (f FieldType) str() string {
}
}
// get_len returns the length in bytes, for the given field type `f`
// get_len returns the length in bytes, for the given field type `f`.
// Should be deleted after the `time` type reimplementation.
pub fn (f FieldType) get_len() u32 {
return match f {
.type_blob { 262140 }