Added BigInt handling to the delimited file format for the 'to' command (#4034)

Co-authored-by: patrick <patrick@spol42069.hitronhub.home>
This commit is contained in:
Patrick More 2021-09-24 15:47:16 -06:00 committed by GitHub
parent b3d8666db0
commit 4e6327de1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -136,7 +136,8 @@ fn to_string_tagged_value(v: &Value) -> Result<String, ShellError> {
| Primitive::Boolean(_) | Primitive::Boolean(_)
| Primitive::Decimal(_) | Primitive::Decimal(_)
| Primitive::FilePath(_) | Primitive::FilePath(_)
| Primitive::Int(_), | Primitive::Int(_)
| Primitive::BigInt(_),
) => as_string(v), ) => as_string(v),
UntaggedValue::Primitive(Primitive::Date(d)) => Ok(d.to_string()), UntaggedValue::Primitive(Primitive::Date(d)) => Ok(d.to_string()),
UntaggedValue::Primitive(Primitive::Nothing) => Ok(String::new()), UntaggedValue::Primitive(Primitive::Nothing) => Ok(String::new()),

View File

@ -698,6 +698,7 @@ pub fn as_string(value: &Value) -> Result<String, ShellError> {
UntaggedValue::Primitive(Primitive::Int(x)) => Ok(x.to_string()), UntaggedValue::Primitive(Primitive::Int(x)) => Ok(x.to_string()),
UntaggedValue::Primitive(Primitive::Filesize(x)) => Ok(x.to_string()), UntaggedValue::Primitive(Primitive::Filesize(x)) => Ok(x.to_string()),
UntaggedValue::Primitive(Primitive::FilePath(x)) => Ok(x.display().to_string()), UntaggedValue::Primitive(Primitive::FilePath(x)) => Ok(x.display().to_string()),
UntaggedValue::Primitive(Primitive::BigInt(x)) => Ok(x.to_string()),
UntaggedValue::Primitive(Primitive::ColumnPath(path)) => Ok(path UntaggedValue::Primitive(Primitive::ColumnPath(path)) => Ok(path
.iter() .iter()
.map(|member| match &member.unspanned { .map(|member| match &member.unspanned {