Add support for JSONB datatype (#1089)

This commit is contained in:
Alexander Beedie 2024-01-15 14:46:09 +04:00 committed by GitHub
parent 7cb1654d81
commit 5d66dc5dc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View file

@ -2172,6 +2172,17 @@ fn parse_cast() {
},
expr_from_projection(only(&select.projection))
);
let sql = "SELECT CAST(details AS JSONB) FROM customer";
let select = verified_only_select(sql);
assert_eq!(
&Expr::Cast {
expr: Box::new(Expr::Identifier(Ident::new("details"))),
data_type: DataType::JSONB,
format: None,
},
expr_from_projection(only(&select.projection))
);
}
#[test]