Skip to content

Commit

Permalink
BREAKING! Rename CreateTableTablespaceClause to TablespaceClause
Browse files Browse the repository at this point in the history
  • Loading branch information
nene committed Jan 30, 2024
1 parent 9a2c359 commit f2f6b79
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/cst/CreateTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type AllCreateTableNodes =
| PartitionBoundRemainder
| CreateTableDefaultPartitionClause
| CreateTableOnCommitClause
| CreateTableTablespaceClause
| TablespaceClause
| UsingAccessMethodClause
| CreateTableWithoutOidsClause
| CreateTableWithDataClause
Expand Down Expand Up @@ -239,7 +239,7 @@ type PostgresqlCreateTableClause =
| CreateTablePartitionBoundClause
| CreateTableDefaultPartitionClause
| CreateTableOnCommitClause
| CreateTableTablespaceClause
| TablespaceClause
| UsingAccessMethodClause
| PostgresqlWithOptions
| CreateTableWithoutOidsClause
Expand Down Expand Up @@ -322,8 +322,8 @@ export interface CreateTableOnCommitClause extends BaseNode {
actionKw: [Keyword<"DELETE" | "PRESERVE">, Keyword<"ROWS">] | Keyword<"DROP">;
}

export interface CreateTableTablespaceClause extends BaseNode {
type: "create_table_tablespace_clause";
export interface TablespaceClause extends BaseNode {
type: "tablespace_clause";
tablespaceKw: Keyword<"TABLESPACE">;
name: Identifier;
}
Expand Down
4 changes: 2 additions & 2 deletions src/cst/View.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AlterActionSetOptions } from "./AlterAction";
import { BaseNode, Keyword } from "./Base";
import {
CreateTableTablespaceClause,
TablespaceClause,
CreateTableWithDataClause,
UsingAccessMethodClause,
} from "./CreateTable";
Expand Down Expand Up @@ -41,7 +41,7 @@ type CreateViewClause =
| ClusterByClause
| PartitionByClause
| UsingAccessMethodClause
| CreateTableTablespaceClause
| TablespaceClause
| CreateTableWithDataClause
| AsClause<SubSelect>;

Expand Down
8 changes: 4 additions & 4 deletions src/parser.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ postgres_create_view_clause
= postgresql_with_options
/ with_check_option_clause
/ using_access_method_clause
/ create_table_tablespace_clause
/ tablespace_clause
/ create_table_with_data_clause

with_check_option_clause
Expand Down Expand Up @@ -2138,7 +2138,7 @@ create_table_clause_postgresql
/ create_table_partition_bound_clause
/ create_table_default_partition_clause
/ create_table_on_commit_clause
/ create_table_tablespace_clause
/ tablespace_clause
/ using_access_method_clause
/ postgresql_with_options
/ create_table_without_oids_clause
Expand Down Expand Up @@ -2242,10 +2242,10 @@ create_table_on_commit_clause
});
}

create_table_tablespace_clause
tablespace_clause
= kw:(TABLESPACE __) name:ident {
return loc({
type: "create_table_tablespace_clause",
type: "tablespace_clause",
tablespaceKw: read(kw),
name,
});
Expand Down
3 changes: 1 addition & 2 deletions src/showNode/create_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export const createTableMap: FullTransformMap<string, AllCreateTableNodes> = {
create_table_default_partition_clause: (node) => show(node.defaultKw),
create_table_on_commit_clause: (node) =>
show([node.onCommitKw, node.actionKw]),
create_table_tablespace_clause: (node) =>
show([node.tablespaceKw, node.name]),
tablespace_clause: (node) => show([node.tablespaceKw, node.name]),
using_access_method_clause: (node) => show([node.usingKw, node.method]),
create_table_without_oids_clause: (node) => show(node.withoutOidsKw),
create_table_with_data_clause: (node) => show(node.withDataKw),
Expand Down

0 comments on commit f2f6b79

Please sign in to comment.