mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
Postgres: Add support for text search types (#1889)
This commit is contained in:
parent
204d3b484d
commit
1d0dc7cdd8
4 changed files with 49 additions and 0 deletions
|
@ -6201,3 +6201,34 @@ fn parse_alter_table_replica_identity() {
|
|||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_ts_datatypes() {
|
||||
match pg_and_generic().verified_stmt("CREATE TABLE foo (x TSVECTOR)") {
|
||||
Statement::CreateTable(CreateTable { columns, .. }) => {
|
||||
assert_eq!(
|
||||
columns,
|
||||
vec![ColumnDef {
|
||||
name: "x".into(),
|
||||
data_type: DataType::TsVector,
|
||||
options: vec![],
|
||||
}]
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
match pg_and_generic().verified_stmt("CREATE TABLE foo (x TSQUERY)") {
|
||||
Statement::CreateTable(CreateTable { columns, .. }) => {
|
||||
assert_eq!(
|
||||
columns,
|
||||
vec![ColumnDef {
|
||||
name: "x".into(),
|
||||
data_type: DataType::TsQuery,
|
||||
options: vec![],
|
||||
}]
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue