Encapsulate CreateTable, CreateIndex into specific structs (#1291)

This commit is contained in:
Philip Cristiano 2024-06-05 05:25:42 -04:00 committed by GitHub
parent f3f5de51e5
commit a0f511cb21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 387 additions and 400 deletions

View file

@ -354,7 +354,7 @@ fn parse_create_view_with_unquoted_hyphen() {
fn parse_create_table_with_unquoted_hyphen() {
let sql = "CREATE TABLE my-pro-ject.mydataset.mytable (x INT64)";
match bigquery().verified_stmt(sql) {
Statement::CreateTable { name, columns, .. } => {
Statement::CreateTable(CreateTable { name, columns, .. }) => {
assert_eq!(
name,
ObjectName(vec![
@ -388,14 +388,14 @@ fn parse_create_table_with_options() {
r#"OPTIONS(partition_expiration_days = 1, description = "table option description")"#
);
match bigquery().verified_stmt(sql) {
Statement::CreateTable {
Statement::CreateTable(CreateTable {
name,
columns,
partition_by,
cluster_by,
options,
..
} => {
}) => {
assert_eq!(
name,
ObjectName(vec!["mydataset".into(), "newtable".into()])
@ -477,7 +477,7 @@ fn parse_create_table_with_options() {
fn parse_nested_data_types() {
let sql = "CREATE TABLE table (x STRUCT<a ARRAY<INT64>, b BYTES(42)>, y ARRAY<STRUCT<INT64>>)";
match bigquery_and_generic().one_statement_parses_to(sql, sql) {
Statement::CreateTable { name, columns, .. } => {
Statement::CreateTable(CreateTable { name, columns, .. }) => {
assert_eq!(name, ObjectName(vec!["table".into()]));
assert_eq!(
columns,