Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mysql): map medium int to int, tinytext to varchar(255) #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/mysql/writer/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ impl ColumnInfo {
};
col_def = self.write_num_attr(col_def, num_attr);
}
Type::MediumInt(_) => {
// FIXME: Unresolved type mapping
col_def.custom(self.col_type.clone());
Type::MediumInt(num_attr) => {
match num_attr.unsigned {
Some(_) => col_def.unsigned(),
None => col_def.integer(),
};
col_def = self.write_num_attr(col_def, num_attr);
}
Type::Int(num_attr) => {
match num_attr.unsigned {
Expand Down Expand Up @@ -169,8 +172,9 @@ impl ColumnInfo {
col_def = self.write_str_attr(col_def, str_attr);
}
Type::TinyText(_) => {
// FIXME: Unresolved type mapping
col_def.custom(self.col_type.clone());
// map to varchar(255)
col_def.string_len(255);
col_def.extra(format!("CHARACTER SET {}", CharSet::Utf8.to_string()));
}
Type::MediumText(_) => {
// FIXME: Unresolved type mapping
Expand Down