-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
support bigger blob #314
support bigger blob #314
Conversation
7cb4b0d
to
8d8f8b7
Compare
This does not seem right. We should instead add more variants to ColumnType |
But then all these new types, |
best way to support blob is add new column type. |
Are you suggesting
This will be a good middle ground for me though we have to be explicit these new column types are primarily added for MySQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a blob type with a enum BlobSize param makes the most sense
You mean blob type with an |
Okay this might not actually be relevant. My rule of thumb is "anything that exists conceptually deserves to be named accordingly". |
It could be enum BlobSize {
Default,
Medium,
Long,
} so we don't need an Option |
Hey @hunjixin, got any updates? :) |
add new columntype "BLOB" to support this feature? if all think it okay, i'd like to implement one, but i am not sure whether affect other db types, maybe need help. |
My plans are...
|
see your idea, but have two suggestions
#[derive(Debug, Clone)]
enum BlobSize {
Default(Option<u32>), // Backward compatibility: MySQL & SQLite support `binary(length)` column type
Tiny,
Blob, //default blob, need a better name?
Medium,
Long,
}
/// Set column type as blob
pub fn blob(&mut self, size: BlobSize) -> &mut Self {
//todo need to check set default size or convert to correct blob type?
self.types = Some(ColumnType::Binary(size));
self
} |
8d8f8b7
to
be5f186
Compare
@billy1624 updated pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks! @hunjixin
I will updates the downstream accordingly |
Thank you for the patience @hunjixin |
PR Info
support medium blob longblob type
Adds
Breaking Changes
Changes
this implement is a little track , but in the current implementation there is specific blob type