Repository: cloudspannerecosystem/memefish
Pull request #158 (2024-10-21 04:07:57)

Support named schema in existing DDL statements
This PR implements named schema support in existing DDL statements. #100 

* I believe `testdata/input/ddl/named_schema_*.sql` covers current [named schema](https://cloud.google.com/spanner/docs/schema-and-data-model#named-schemas) use cases.
* Many breaking changes because of replacing `*Ident` with `*Path`.
  * It need to relax the current constraints of `Path.Idents` to permit `len(Idents) == 1`

Note

~I am thinking That using `Path` as FQN implementation is natural because is is possible to be extended to multi level named schema, but temporarily implemented as FQN{Name string; Schema string} for PoC.~

apstndb: Turn to draft because it is not completed.

Patch:
diff --git a/ast/ast.go b/ast/ast.go
index 12c7e23..a6d215e 100644
--- a/ast/ast.go
+++ b/ast/ast.go
@@ -1379,13 +1379,14 @@ type Ident struct {
 }
 
 // Path is dot-chained identifier list.
+// It can be simple name without dot.
 //
 //	{{.Idents | sqlJoin "."}}
 type Path struct {
 	// pos = Idents[0].pos
 	// end = Idents[$].end
 
-	Idents []*Ident // len(Idents) >= 2
+	Idents []*Ident // len(Idents) > 0
 }
 
 // ArrayLiteral is array literal node.
@@ -1840,7 +1841,7 @@ type CreateTable struct {
 	Rparen token.Pos // position of ")" of PRIMARY KEY clause
 
 	IfNotExists       bool
-	Name              *Ident
+	Name              *Path
 	Columns           []*ColumnDef
 	TableConstraints  []*TableConstraint
 	PrimaryKeys       []*IndexKey
@@ -1871,7 +1872,7 @@ type CreateSequence struct {
 
 	Create token.Pos // position of "CREATE" keyword
 
-	Name        *Ident
+	Name        *Path
 	IfNotExists bool
 	Options     *Options
 }
@@ -1964,7 +1965,7 @@ type ForeignKey struct {
 	OnDeleteEnd token.Pos // end position of ON DELETE clause
 
 	Columns          []*Ident
-	ReferenceTable   *Ident
+	ReferenceTable   *Path
 	ReferenceColumns []*Ident       // len(ReferenceColumns) > 0
 	OnDelete         OnDeleteAction // optional
 }
@@ -2005,7 +2006,7 @@ type Cluster struct {
 	Comma       token.Pos // position of ","
 	OnDeleteEnd token.Pos // end position of ON DELETE clause
 
-	TableName *Ident
+	TableName *Path
 	OnDelete  OnDeleteAction // optional
 }
 
@@ -2046,7 +2047,7 @@ type CreateView struct {
 
 	Create token.Pos
 
-	Name         *Ident
+	Name         *Path
 	OrReplace    bool
 	SecurityType SecurityType
 	Query        QueryExpr
@@ -2061,7 +2062,7 @@ type DropView struct {
 
 	Drop token.Pos
 
-	Name *Ident
+	Name *Path
 }
 
 // AlterTable is ALTER TABLE statement node.
@@ -2073,7 +2074,7 @@ type AlterTable struct {
 
 	Alter token.Pos // position of "ALTER" keyword
 
-	Name            *Ident
+	Name            *Path
 	TableAlteration TableAlteration
 }
 
@@ -2086,7 +2087,7 @@ type AlterIndex struct {
 
 	Alter token.Pos // position of "ALTER" keyword
 
-	Name            *Ident
+	Name            *Path
 	IndexAlteration IndexAlteration
 }
 
@@ -2097,7 +2098,7 @@ type AlterSequence struct {
 
 	Alter token.Pos // position of "ALTER" keyword
 
-	Name    *Ident
+	Name    *Path
 	Options *Options
 }
 
@@ -2315,7 +2316,7 @@ type DropTable struct {
 	Drop token.Pos // position of "DROP" keyword
 
 	IfExists bool
-	Name     *Ident
+	Name     *Path
 }
 
 // RenameTable is RENAME TABLE statement node.
@@ -2361,8 +2362,8 @@ type CreateIndex struct {
 	Unique       bool
 	NullFiltered bool
 	IfNotExists  bool
-	Name         *Ident
-	TableName    *Ident
+	Name         *Path
+	TableName    *Path
 	Keys         []*IndexKey
 	Storing      *Storing      // optional
 	InterleaveIn *InterleaveIn // optional
@@ -2549,7 +2550,7 @@ type DropIndex struct {
 	Drop token.Pos // position of "DROP" keyword
 
 	IfExists bool
-	Name     *Ident
+	Name     *Path
 }
 
 // DropVectorIndex is DROP VECTOR INDEX statement node.
@@ -2571,9 +2572,10 @@ type DropVectorIndex struct {
 type DropSequence struct {
 	// pos = Drop
 	// end = Name.end
+
 	Drop     token.Pos
 	IfExists bool
-	Name     *Ident
+	Name     *Path
 }
 
 // CreateRole is CREATE ROLE statement node.
diff --git a/parser.go b/parser.go
index 9a3a5c9..57c9032 100644
--- a/parser.go
+++ b/parser.go
@@ -2424,7 +2424,7 @@ func (p *Parser) parseAlterDatabase(pos token.Pos) *ast.AlterDatabase {
 func (p *Parser) parseCreateTable(pos token.Pos) *ast.CreateTable {
 	p.expectKeywordLike("TABLE")
 	ifNotExists := p.parseIfNotExists()
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	// This loop allows parsing trailing comma intentionally.
 	// TODO: is this allowed by Spanner really?
@@ -2498,10 +2498,15 @@ func (p *Parser) parseCreateTable(pos token.Pos) *ast.CreateTable {
 	}
 }
 
+func (p *Parser) parsePath() *ast.Path {
+	path := p.parseIdentOrPath()
+	return &ast.Path{Idents: path}
+}
+
 func (p *Parser) parseCreateSequence(pos token.Pos) *ast.CreateSequence {
 	p.expectKeywordLike("SEQUENCE")
 	ifNotExists := p.parseIfNotExists()
-	name := p.parseIdent()
+	name := p.parsePath()
 	options := p.parseOptions()
 
 	return &ast.CreateSequence{
@@ -2521,7 +2526,7 @@ func (p *Parser) parseCreateView(pos token.Pos) *ast.CreateView {
 	}
 	p.expectKeywordLike("VIEW")
 
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	p.expectKeywordLike("SQL")
 	p.expectKeywordLike("SECURITY")
@@ -2552,7 +2557,7 @@ func (p *Parser) parseCreateView(pos token.Pos) *ast.CreateView {
 
 func (p *Parser) parseDropView(pos token.Pos) *ast.DropView {
 	p.expectKeywordLike("VIEW")
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	return &ast.DropView{
 		Drop: pos,
@@ -2612,7 +2617,7 @@ func (p *Parser) parseForeignKey() *ast.ForeignKey {
 	columns := parseCommaSeparatedList(p, p.parseIdent)
 	p.expect(")")
 	p.expectKeywordLike("REFERENCES")
-	refTable := p.parseIdent()
+	refTable := p.parsePath()
 
 	p.expect("(")
 	refColumns := parseCommaSeparatedList(p, p.parseIdent)
@@ -2732,7 +2737,7 @@ func (p *Parser) tryParseCluster() *ast.Cluster {
 	p.nextToken()
 	p.expect("IN")
 	p.expectKeywordLike("PARENT")
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	onDelete, onDeleteEnd := p.tryParseOnDeleteAction()
 
@@ -2957,10 +2962,10 @@ func (p *Parser) parseCreateIndex(pos token.Pos) *ast.CreateIndex {
 
 	ifNotExists := p.parseIfNotExists()
 
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	p.expect("ON")
-	tableName := p.parseIdent()
+	tableName := p.parsePath()
 
 	p.expect("(")
 	var keys []*ast.IndexKey
@@ -3132,7 +3137,7 @@ func (p *Parser) tryParseInterleaveIn() *ast.InterleaveIn {
 
 func (p *Parser) parseAlterTable(pos token.Pos) *ast.AlterTable {
 	p.expectKeywordLike("TABLE")
-	name := p.parseIdent()
+	name := p.parsePath()
 
 	var alteration ast.TableAlteration
 	switch {
@@ -3360,7 +3365,7 @@ func (p *Parser) parseAlterColumn() ast.TableAlteration {
 func (p *Parser) parseAlterIndex(pos token.Pos) *ast.AlterIndex {
 	p.expectKeywordLike("INDEX")
 
-	name := p.parseIdent()
+	name := p.parsePath()
 	alteration := p.parseIndexAlteration()
 
 	return &ast.AlterIndex{
@@ -3372,7 +3377,7 @@ func (p *Parser) parseAlterIndex(pos token.Pos) *ast.AlterIndex {
 
 func (p *Parser) parseAlterSequence(pos token.Pos) *ast.AlterSequence {
 	p.expectKeywordLike("SEQUENCE")
-	name := p.parseIdent()
+	name := p.parsePath()
 	p.expect("SET")
 	options := p.parseOptions()
 
@@ -3411,7 +3416,7 @@ func (p *Parser) parseDropStoredColumn() ast.IndexAlteration {
 func (p *Parser) parseDropTable(pos token.Pos) *ast.DropTable {
 	p.expectKeywordLike("TABLE")
 	ifExists := p.parseIfExists()
-	name := p.parseIdent()
+	name := p.parsePath()
 	return &ast.DropTable{
 		Drop:     pos,
 		IfExists: ifExists,
@@ -3422,7 +3427,7 @@ func (p *Parser) parseDropTable(pos token.Pos) *ast.DropTable {
 func (p *Parser) parseDropIndex(pos token.Pos) *ast.DropIndex {
 	p.expectKeywordLike("INDEX")
 	ifExists := p.parseIfExists()
-	name := p.parseIdent()
+	name := p.parsePath()
 	return &ast.DropIndex{
 		Drop:     pos,
 		IfExists: ifExists,
@@ -3445,7 +3450,7 @@ func (p *Parser) parseDropVectorIndex(pos token.Pos) *ast.DropVectorIndex {
 func (p *Parser) parseDropSequence(pos token.Pos) *ast.DropSequence {
 	p.expectKeywordLike("SEQUENCE")
 	ifExists := p.parseIfExists()
-	name := p.parseIdent()
+	name := p.parsePath()
 	return &ast.DropSequence{
 		Drop:     pos,
 		IfExists: ifExists,


Test patch:
diff --git a/testdata/input/ddl/named_schema_create_table_backquoted.sql b/testdata/input/ddl/named_schema_create_table_backquoted.sql
new file mode 100644
index 0000000..6f06ebe
--- /dev/null
+++ b/testdata/input/ddl/named_schema_create_table_backquoted.sql
@@ -0,0 +1,1 @@
+CREATE TABLE `ORDER`.`ORDER`(PK INT64) PRIMARY KEY(PK)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_alter_index.sql b/testdata/input/ddl/named_schemas_alter_index.sql
new file mode 100644
index 0000000..29d0399
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_alter_index.sql
@@ -0,0 +1,1 @@
+ALTER INDEX sch1.indexOnSingers ADD STORED COLUMN SingerInfo
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_alter_sequence.sql b/testdata/input/ddl/named_schemas_alter_sequence.sql
new file mode 100644
index 0000000..ee54afd
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_alter_sequence.sql
@@ -0,0 +1,2 @@
+ALTER SEQUENCE sch1.sequence
+    SET OPTIONS (skip_range_min=1, skip_range_max=1234567)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_alter_table_add_constraint.sql b/testdata/input/ddl/named_schemas_alter_table_add_constraint.sql
new file mode 100644
index 0000000..38731ab
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_alter_table_add_constraint.sql
@@ -0,0 +1,2 @@
+ALTER TABLE sch1.ShoppingCarts ADD CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_alter_table_drop_constraints.sql b/testdata/input/ddl/named_schemas_alter_table_drop_constraints.sql
new file mode 100644
index 0000000..ec317b4
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_alter_table_drop_constraints.sql
@@ -0,0 +1,1 @@
+ALTER TABLE sch1.ShoppingCarts DROP CONSTRAINT FKShoppingCartsCustomers
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_index.sql b/testdata/input/ddl/named_schemas_create_index.sql
new file mode 100644
index 0000000..46e4f7c
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_index.sql
@@ -0,0 +1,1 @@
+CREATE INDEX sch1.indexOnSingers ON sch1.Singers(FirstName)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_sequence.sql b/testdata/input/ddl/named_schemas_create_sequence.sql
new file mode 100644
index 0000000..cb77c50
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_sequence.sql
@@ -0,0 +1,3 @@
+CREATE SEQUENCE sch1.sequence OPTIONS (
+  sequence_kind = 'bit_reversed_positive'
+)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_table.sql b/testdata/input/ddl/named_schemas_create_table.sql
new file mode 100644
index 0000000..7d35b23
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_table.sql
@@ -0,0 +1,6 @@
+CREATE TABLE sch1.Singers (
+    SingerId INT64 NOT NULL,
+    FirstName STRING(1024),
+    LastName STRING(1024),
+    SingerInfo BYTES(MAX),
+) PRIMARY KEY(SingerId)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_table_foreign_key.sql b/testdata/input/ddl/named_schemas_create_table_foreign_key.sql
new file mode 100644
index 0000000..fc9beb1
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_table_foreign_key.sql
@@ -0,0 +1,7 @@
+CREATE TABLE sch1.ShoppingCarts (
+  CartId INT64 NOT NULL,
+  CustomerId INT64 NOT NULL,
+  CustomerName STRING(MAX) NOT NULL,
+  CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE,
+) PRIMARY KEY(CartId)
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_table_interleave.sql b/testdata/input/ddl/named_schemas_create_table_interleave.sql
new file mode 100644
index 0000000..3a203e7
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_table_interleave.sql
@@ -0,0 +1,6 @@
+CREATE TABLE sch1.Albums (
+  SingerId INT64 NOT NULL,
+  AlbumId INT64 NOT NULL,
+  AlbumTitle STRING(MAX),
+) PRIMARY KEY(SingerId, AlbumId),
+  INTERLEAVE IN PARENT sch1.Singers ON DELETE CASCADE
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_create_view.sql b/testdata/input/ddl/named_schemas_create_view.sql
new file mode 100644
index 0000000..9894505
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_create_view.sql
@@ -0,0 +1,3 @@
+CREATE VIEW sch1.SingerView SQL SECURITY INVOKER
+AS Select s.FirstName, s.LastName, s.SingerInfo
+   FROM sch1.Singers AS s WHERE s.SingerId = 123456
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_drop_index.sql b/testdata/input/ddl/named_schemas_drop_index.sql
new file mode 100644
index 0000000..e90fc0a
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_drop_index.sql
@@ -0,0 +1,1 @@
+DROP INDEX sch1.indexOnSingers
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_drop_sequence.sql b/testdata/input/ddl/named_schemas_drop_sequence.sql
new file mode 100644
index 0000000..44589a5
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_drop_sequence.sql
@@ -0,0 +1,1 @@
+DROP SEQUENCE sch1.sequence
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_drop_table.sql b/testdata/input/ddl/named_schemas_drop_table.sql
new file mode 100644
index 0000000..ce8cd23
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_drop_table.sql
@@ -0,0 +1,1 @@
+DROP TABLE sch1.ShoppingCarts
\ No newline at end of file
diff --git a/testdata/input/ddl/named_schemas_drop_view.sql b/testdata/input/ddl/named_schemas_drop_view.sql
new file mode 100644
index 0000000..3aafc9b
--- /dev/null
+++ b/testdata/input/ddl/named_schemas_drop_view.sql
@@ -0,0 +1,1 @@
+DROP VIEW sch1.SingerView
\ No newline at end of file
diff --git a/testdata/result/ddl/alter_index_add_stored_column.sql.txt b/testdata/result/ddl/alter_index_add_stored_column.sql.txt
index c050f94..ae278e4 100644
--- a/testdata/result/ddl/alter_index_add_stored_column.sql.txt
+++ b/testdata/result/ddl/alter_index_add_stored_column.sql.txt
@@ -4,10 +4,14 @@ alter index foo add stored column bar
 --- AST
 &ast.AlterIndex{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   IndexAlteration: &ast.AddStoredColumn{
     Add:  16,
diff --git a/testdata/result/ddl/alter_index_drop_stored_column.sql.txt b/testdata/result/ddl/alter_index_drop_stored_column.sql.txt
index 0255727..1a54ff4 100644
--- a/testdata/result/ddl/alter_index_drop_stored_column.sql.txt
+++ b/testdata/result/ddl/alter_index_drop_stored_column.sql.txt
@@ -4,10 +4,14 @@ alter index foo drop stored column bar
 --- AST
 &ast.AlterIndex{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   IndexAlteration: &ast.DropStoredColumn{
     Drop: 16,
diff --git a/testdata/result/ddl/alter_sequence.sql.txt b/testdata/result/ddl/alter_sequence.sql.txt
index dd88bf9..0183cc1 100644
--- a/testdata/result/ddl/alter_sequence.sql.txt
+++ b/testdata/result/ddl/alter_sequence.sql.txt
@@ -4,10 +4,14 @@ ALTER SEQUENCE my_sequence SET OPTIONS (skip_range_min=1, skip_range_max=1234567
 --- AST
 &ast.AlterSequence{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 15,
-    NameEnd: 26,
-    Name:    "my_sequence",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 26,
+        Name:    "my_sequence",
+      },
+    },
   },
   Options: &ast.Options{
     Options: 31,
diff --git a/testdata/result/ddl/alter_table_add_check.sql.txt b/testdata/result/ddl/alter_table_add_check.sql.txt
index 5ecdaf7..12790e8 100644
--- a/testdata/result/ddl/alter_table_add_check.sql.txt
+++ b/testdata/result/ddl/alter_table_add_check.sql.txt
@@ -4,10 +4,14 @@ alter table foo add check (c1 > 0)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
diff --git a/testdata/result/ddl/alter_table_add_column.sql.txt b/testdata/result/ddl/alter_table_add_column.sql.txt
index b4b8830..c146057 100644
--- a/testdata/result/ddl/alter_table_add_column.sql.txt
+++ b/testdata/result/ddl/alter_table_add_column.sql.txt
@@ -3,10 +3,14 @@ alter table foo add column baz string(max) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/ddl/alter_table_add_column_if_not_exists.sql.txt b/testdata/result/ddl/alter_table_add_column_if_not_exists.sql.txt
index f4158ba..4945c62 100644
--- a/testdata/result/ddl/alter_table_add_column_if_not_exists.sql.txt
+++ b/testdata/result/ddl/alter_table_add_column_if_not_exists.sql.txt
@@ -4,10 +4,14 @@ alter table foo add column if not exists baz string(max) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/ddl/alter_table_add_column_with_if_expression.sql.txt b/testdata/result/ddl/alter_table_add_column_with_if_expression.sql.txt
index 8726d65..9188ae2 100644
--- a/testdata/result/ddl/alter_table_add_column_with_if_expression.sql.txt
+++ b/testdata/result/ddl/alter_table_add_column_with_if_expression.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE foo ADD COLUMN expired_at TIMESTAMP AS (IF (status != "OPEN" AND sta
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/ddl/alter_table_add_constraint_check.sql.txt b/testdata/result/ddl/alter_table_add_constraint_check.sql.txt
index 187b07e..c7b6bd7 100644
--- a/testdata/result/ddl/alter_table_add_constraint_check.sql.txt
+++ b/testdata/result/ddl/alter_table_add_constraint_check.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint cname check (c1 > 0)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
diff --git a/testdata/result/ddl/alter_table_add_constraint_foreign_key.sql.txt b/testdata/result/ddl/alter_table_add_constraint_foreign_key.sql.txt
index 6c0720c..14f2f1d 100644
--- a/testdata/result/ddl/alter_table_add_constraint_foreign_key.sql.txt
+++ b/testdata/result/ddl/alter_table_add_constraint_foreign_key.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt b/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
index ebb2d03..5763ea7 100644
--- a/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
+++ b/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt b/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
index e7e7251..80052ce 100644
--- a/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
+++ b/testdata/result/ddl/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/ddl/alter_table_add_foreign_key.sql.txt b/testdata/result/ddl/alter_table_add_foreign_key.sql.txt
index 1c01e2f..040d5f2 100644
--- a/testdata/result/ddl/alter_table_add_foreign_key.sql.txt
+++ b/testdata/result/ddl/alter_table_add_foreign_key.sql.txt
@@ -4,10 +4,14 @@ alter table foo add foreign key (bar) references t2 (t2key1)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -25,10 +29,14 @@ alter table foo add foreign key (bar) references t2 (t2key1)
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 49,
-          NameEnd: 51,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 49,
+              NameEnd: 51,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/ddl/alter_table_add_row_deletion_policy.sql.txt b/testdata/result/ddl/alter_table_add_row_deletion_policy.sql.txt
index f04597c..4838ae3 100644
--- a/testdata/result/ddl/alter_table_add_row_deletion_policy.sql.txt
+++ b/testdata/result/ddl/alter_table_add_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo add row deletion policy ( older_than ( bar, interval 30 day ))
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddRowDeletionPolicy{
     Add:               16,
diff --git a/testdata/result/ddl/alter_table_add_synonym.sql.txt b/testdata/result/ddl/alter_table_add_synonym.sql.txt
index 0eda236..0f384a6 100644
--- a/testdata/result/ddl/alter_table_add_synonym.sql.txt
+++ b/testdata/result/ddl/alter_table_add_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers ADD SYNONYM SingersTest
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.AddSynonym{
     Add:  20,
diff --git a/testdata/result/ddl/alter_table_alter_column.sql.txt b/testdata/result/ddl/alter_table_alter_column.sql.txt
index 93422dd..13e95b8 100644
--- a/testdata/result/ddl/alter_table_alter_column.sql.txt
+++ b/testdata/result/ddl/alter_table_alter_column.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo string(256) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/ddl/alter_table_alter_column_drop_default.sql.txt b/testdata/result/ddl/alter_table_alter_column_drop_default.sql.txt
index 3df5dcc..21b4175 100644
--- a/testdata/result/ddl/alter_table_alter_column_drop_default.sql.txt
+++ b/testdata/result/ddl/alter_table_alter_column_drop_default.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo drop default
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/ddl/alter_table_alter_column_set.sql.txt b/testdata/result/ddl/alter_table_alter_column_set.sql.txt
index f5b9d50..79eebcf 100644
--- a/testdata/result/ddl/alter_table_alter_column_set.sql.txt
+++ b/testdata/result/ddl/alter_table_alter_column_set.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo set options(allow_commit_timestamp = true)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/ddl/alter_table_alter_column_set_default.sql.txt b/testdata/result/ddl/alter_table_alter_column_set_default.sql.txt
index af5c786..61bfd3c 100644
--- a/testdata/result/ddl/alter_table_alter_column_set_default.sql.txt
+++ b/testdata/result/ddl/alter_table_alter_column_set_default.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE actions ALTER COLUMN output SET DEFAULT("")
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "actions",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "actions",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 20,
diff --git a/testdata/result/ddl/alter_table_alter_column_with_default.sql.txt b/testdata/result/ddl/alter_table_alter_column_with_default.sql.txt
index b2e5c06..1df2208 100644
--- a/testdata/result/ddl/alter_table_alter_column_with_default.sql.txt
+++ b/testdata/result/ddl/alter_table_alter_column_with_default.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE actions ALTER COLUMN output STRING(MAX) NOT NULL DEFAULT("")
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "actions",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "actions",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 20,
diff --git a/testdata/result/ddl/alter_table_drop_column.sql.txt b/testdata/result/ddl/alter_table_drop_column.sql.txt
index a6d5089..0a21940 100644
--- a/testdata/result/ddl/alter_table_drop_column.sql.txt
+++ b/testdata/result/ddl/alter_table_drop_column.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop column bar
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropColumn{
     Drop: 16,
diff --git a/testdata/result/ddl/alter_table_drop_constraint.sql.txt b/testdata/result/ddl/alter_table_drop_constraint.sql.txt
index 70f0765..cd868b0 100644
--- a/testdata/result/ddl/alter_table_drop_constraint.sql.txt
+++ b/testdata/result/ddl/alter_table_drop_constraint.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop constraint bar
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropConstraint{
     Drop: 16,
diff --git a/testdata/result/ddl/alter_table_drop_row_deletion_policy.sql.txt b/testdata/result/ddl/alter_table_drop_row_deletion_policy.sql.txt
index c3a1244..79604aa 100644
--- a/testdata/result/ddl/alter_table_drop_row_deletion_policy.sql.txt
+++ b/testdata/result/ddl/alter_table_drop_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop row deletion policy
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropRowDeletionPolicy{
     Drop:   16,
diff --git a/testdata/result/ddl/alter_table_drop_synonym.sql.txt b/testdata/result/ddl/alter_table_drop_synonym.sql.txt
index ffd6045..f523321 100644
--- a/testdata/result/ddl/alter_table_drop_synonym.sql.txt
+++ b/testdata/result/ddl/alter_table_drop_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers DROP SYNONYM SingersTest
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.DropSynonym{
     Drop: 20,
diff --git a/testdata/result/ddl/alter_table_rename_to.sql.txt b/testdata/result/ddl/alter_table_rename_to.sql.txt
index 9e109a7..1e7c36a 100644
--- a/testdata/result/ddl/alter_table_rename_to.sql.txt
+++ b/testdata/result/ddl/alter_table_rename_to.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers RENAME TO SingersNew
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.RenameTo{
     Rename: 20,
diff --git a/testdata/result/ddl/alter_table_rename_to_add_synonym.sql.txt b/testdata/result/ddl/alter_table_rename_to_add_synonym.sql.txt
index 3171ea5..868eeb4 100644
--- a/testdata/result/ddl/alter_table_rename_to_add_synonym.sql.txt
+++ b/testdata/result/ddl/alter_table_rename_to_add_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers RENAME TO SingersNew, ADD SYNONYM Singers
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.RenameTo{
     Rename: 20,
diff --git a/testdata/result/ddl/alter_table_replace_row_deletion_policy.sql.txt b/testdata/result/ddl/alter_table_replace_row_deletion_policy.sql.txt
index ab3d373..3fe645b 100644
--- a/testdata/result/ddl/alter_table_replace_row_deletion_policy.sql.txt
+++ b/testdata/result/ddl/alter_table_replace_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo replace row deletion policy ( older_than ( bar, interval 30 day
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.ReplaceRowDeletionPolicy{
     Replace:           16,
diff --git a/testdata/result/ddl/alter_table_set_on_delete.sql.txt b/testdata/result/ddl/alter_table_set_on_delete.sql.txt
index 9817f83..366965f 100644
--- a/testdata/result/ddl/alter_table_set_on_delete.sql.txt
+++ b/testdata/result/ddl/alter_table_set_on_delete.sql.txt
@@ -3,10 +3,14 @@ alter table foo set on delete cascade
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.SetOnDelete{
     Set:         16,
diff --git a/testdata/result/ddl/alter_table_set_on_delete_no_action.sql.txt b/testdata/result/ddl/alter_table_set_on_delete_no_action.sql.txt
index bd058ca..3338676 100644
--- a/testdata/result/ddl/alter_table_set_on_delete_no_action.sql.txt
+++ b/testdata/result/ddl/alter_table_set_on_delete_no_action.sql.txt
@@ -3,10 +3,14 @@ alter table foo set on delete no action
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.SetOnDelete{
     Set:         16,
diff --git a/testdata/result/ddl/create_index.sql.txt b/testdata/result/ddl/create_index.sql.txt
index aa14baa..568a898 100644
--- a/testdata/result/ddl/create_index.sql.txt
+++ b/testdata/result/ddl/create_index.sql.txt
@@ -11,15 +11,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/ddl/create_index_if_not_exists.sql.txt b/testdata/result/ddl/create_index_if_not_exists.sql.txt
index d188cb1..760d3db 100644
--- a/testdata/result/ddl/create_index_if_not_exists.sql.txt
+++ b/testdata/result/ddl/create_index_if_not_exists.sql.txt
@@ -8,15 +8,23 @@ create index if not exists foo_bar on foo (bar)
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  true,
-  Name:         &ast.Ident{
-    NamePos: 27,
-    NameEnd: 34,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 27,
+        NameEnd: 34,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 38,
-    NameEnd: 41,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 38,
+        NameEnd: 41,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/ddl/create_index_interleave.sql.txt b/testdata/result/ddl/create_index_interleave.sql.txt
index 7084414..c4efd04 100644
--- a/testdata/result/ddl/create_index_interleave.sql.txt
+++ b/testdata/result/ddl/create_index_interleave.sql.txt
@@ -11,15 +11,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/ddl/create_index_storing.sql.txt b/testdata/result/ddl/create_index_storing.sql.txt
index bc0784e..3c538de 100644
--- a/testdata/result/ddl/create_index_storing.sql.txt
+++ b/testdata/result/ddl/create_index_storing.sql.txt
@@ -10,15 +10,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/ddl/create_or_replace_view.sql.txt b/testdata/result/ddl/create_or_replace_view.sql.txt
index f3b3880..f66ace7 100644
--- a/testdata/result/ddl/create_or_replace_view.sql.txt
+++ b/testdata/result/ddl/create_or_replace_view.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 23,
-    NameEnd: 34,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 23,
+        NameEnd: 34,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    true,
   SecurityType: "INVOKER",
diff --git a/testdata/result/ddl/create_sequance.sql.txt b/testdata/result/ddl/create_sequance.sql.txt
index e0bf76d..c9b733f 100644
--- a/testdata/result/ddl/create_sequance.sql.txt
+++ b/testdata/result/ddl/create_sequance.sql.txt
@@ -8,10 +8,14 @@ CREATE SEQUENCE IF NOT EXISTS MySequence OPTIONS (
 --- AST
 &ast.CreateSequence{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 30,
-    NameEnd: 40,
-    Name:    "MySequence",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 30,
+        NameEnd: 40,
+        Name:    "MySequence",
+      },
+    },
   },
   IfNotExists: true,
   Options:     &ast.Options{
diff --git a/testdata/result/ddl/create_table.sql.txt b/testdata/result/ddl/create_table.sql.txt
index 5cbba1f..955ce48 100644
--- a/testdata/result/ddl/create_table.sql.txt
+++ b/testdata/result/ddl/create_table.sql.txt
@@ -19,10 +19,14 @@ create table foo (
   Create:      0,
   Rparen:      573,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -222,10 +226,14 @@ create table foo (
             Name:    "foo",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 211,
-          NameEnd: 213,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 211,
+              NameEnd: 213,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -251,10 +259,14 @@ create table foo (
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 255,
-          NameEnd: 257,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 255,
+              NameEnd: 257,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -280,10 +292,14 @@ create table foo (
             Name:    "baz",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 317,
-          NameEnd: 319,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 317,
+              NameEnd: 319,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -318,10 +334,14 @@ create table foo (
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 404,
-          NameEnd: 406,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 404,
+              NameEnd: 406,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/ddl/create_table_cluster.sql.txt b/testdata/result/ddl/create_table_cluster.sql.txt
index 0d6a5d5..d68c4f4 100644
--- a/testdata/result/ddl/create_table_cluster.sql.txt
+++ b/testdata/result/ddl/create_table_cluster.sql.txt
@@ -10,10 +10,14 @@ create table foo (
   Create:      0,
   Rparen:      59,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -57,10 +61,14 @@ create table foo (
   Cluster:          &ast.Cluster{
     Comma:       60,
     OnDeleteEnd: -1,
-    TableName:   &ast.Ident{
-      NamePos: 85,
-      NameEnd: 91,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 85,
+          NameEnd: 91,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "",
   },
diff --git a/testdata/result/ddl/create_table_cluster_and_row_deletion_policy.sql.txt b/testdata/result/ddl/create_table_cluster_and_row_deletion_policy.sql.txt
index e27a41d..654d7ab 100644
--- a/testdata/result/ddl/create_table_cluster_and_row_deletion_policy.sql.txt
+++ b/testdata/result/ddl/create_table_cluster_and_row_deletion_policy.sql.txt
@@ -12,10 +12,14 @@ create table foo (
   Create:      0,
   Rparen:      77,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -76,10 +80,14 @@ create table foo (
   Cluster:          &ast.Cluster{
     Comma:       78,
     OnDeleteEnd: -1,
-    TableName:   &ast.Ident{
-      NamePos: 103,
-      NameEnd: 109,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 103,
+          NameEnd: 109,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "",
   },
diff --git a/testdata/result/ddl/create_table_cluster_on_delete_no_action.sql.txt b/testdata/result/ddl/create_table_cluster_on_delete_no_action.sql.txt
index 7681612..df38046 100644
--- a/testdata/result/ddl/create_table_cluster_on_delete_no_action.sql.txt
+++ b/testdata/result/ddl/create_table_cluster_on_delete_no_action.sql.txt
@@ -9,10 +9,14 @@ create table foo (
   Create:      0,
   Rparen:      50,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -49,10 +53,14 @@ create table foo (
   Cluster:  &ast.Cluster{
     Comma:       51,
     OnDeleteEnd: 115,
-    TableName:   &ast.Ident{
-      NamePos: 76,
-      NameEnd: 82,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 76,
+          NameEnd: 82,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "ON DELETE NO ACTION",
   },
diff --git a/testdata/result/ddl/create_table_cluster_set_on_delete.sql.txt b/testdata/result/ddl/create_table_cluster_set_on_delete.sql.txt
index 56a2e62..615cc4a 100644
--- a/testdata/result/ddl/create_table_cluster_set_on_delete.sql.txt
+++ b/testdata/result/ddl/create_table_cluster_set_on_delete.sql.txt
@@ -9,10 +9,14 @@ create table foo (
   Create:      0,
   Rparen:      49,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -49,10 +53,14 @@ create table foo (
   Cluster:  &ast.Cluster{
     Comma:       50,
     OnDeleteEnd: 112,
-    TableName:   &ast.Ident{
-      NamePos: 75,
-      NameEnd: 81,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 75,
+          NameEnd: 81,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "ON DELETE CASCADE",
   },
diff --git a/testdata/result/ddl/create_table_fulltext_albums.sql.txt b/testdata/result/ddl/create_table_fulltext_albums.sql.txt
index 26d125f..f4a4b23 100644
--- a/testdata/result/ddl/create_table_fulltext_albums.sql.txt
+++ b/testdata/result/ddl/create_table_fulltext_albums.sql.txt
@@ -14,10 +14,14 @@ CREATE TABLE Albums (
   Create:      105,
   Rparen:      575,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 118,
-    NameEnd: 124,
-    Name:    "Albums",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 118,
+        NameEnd: 124,
+        Name:    "Albums",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_if_not_exists.sql.txt b/testdata/result/ddl/create_table_if_not_exists.sql.txt
index a3bce8e..ede4a61 100644
--- a/testdata/result/ddl/create_table_if_not_exists.sql.txt
+++ b/testdata/result/ddl/create_table_if_not_exists.sql.txt
@@ -9,10 +9,14 @@ create table if not exists foo (
   Create:      0,
   Rparen:      93,
   IfNotExists: true,
-  Name:        &ast.Ident{
-    NamePos: 27,
-    NameEnd: 30,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 27,
+        NameEnd: 30,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_row_deletion_policy.sql.txt b/testdata/result/ddl/create_table_row_deletion_policy.sql.txt
index c528214..3d17e37 100644
--- a/testdata/result/ddl/create_table_row_deletion_policy.sql.txt
+++ b/testdata/result/ddl/create_table_row_deletion_policy.sql.txt
@@ -11,10 +11,14 @@ create table foo (
   Create:      0,
   Rparen:      77,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_synonyms.sql.txt b/testdata/result/ddl/create_table_synonyms.sql.txt
index 9264d6f..00ce0aa 100644
--- a/testdata/result/ddl/create_table_synonyms.sql.txt
+++ b/testdata/result/ddl/create_table_synonyms.sql.txt
@@ -9,10 +9,14 @@ CREATE TABLE Singers (
   Create:      0,
   Rparen:      126,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "Singers",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "Singers",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_synonyms_abnormal.sql.txt b/testdata/result/ddl/create_table_synonyms_abnormal.sql.txt
index 412d563..f63129a 100644
--- a/testdata/result/ddl/create_table_synonyms_abnormal.sql.txt
+++ b/testdata/result/ddl/create_table_synonyms_abnormal.sql.txt
@@ -11,10 +11,14 @@ CREATE TABLE Singers (
   Create:      45,
   Rparen:      194,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 58,
-    NameEnd: 65,
-    Name:    "Singers",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 58,
+        NameEnd: 65,
+        Name:    "Singers",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_trailing_comma.sql.txt b/testdata/result/ddl/create_table_trailing_comma.sql.txt
index 8bded18..0a81242 100644
--- a/testdata/result/ddl/create_table_trailing_comma.sql.txt
+++ b/testdata/result/ddl/create_table_trailing_comma.sql.txt
@@ -12,10 +12,14 @@ create table foo (
   Create:      0,
   Rparen:      83,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_types.sql.txt b/testdata/result/ddl/create_table_types.sql.txt
index ee43900..c789d70 100644
--- a/testdata/result/ddl/create_table_types.sql.txt
+++ b/testdata/result/ddl/create_table_types.sql.txt
@@ -20,10 +20,14 @@ create table types (
   Create:      0,
   Rparen:      252,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 18,
-    Name:    "types",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 18,
+        Name:    "types",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_table_with_sequence_function.sql.txt b/testdata/result/ddl/create_table_with_sequence_function.sql.txt
index 0aea069..a98ac02 100644
--- a/testdata/result/ddl/create_table_with_sequence_function.sql.txt
+++ b/testdata/result/ddl/create_table_with_sequence_function.sql.txt
@@ -11,10 +11,14 @@ CREATE TABLE foo
   Create:      0,
   Rparen:      143,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/ddl/create_uniq_null_filtered_index.sql.txt b/testdata/result/ddl/create_uniq_null_filtered_index.sql.txt
index 6c944be..8337e5b 100644
--- a/testdata/result/ddl/create_uniq_null_filtered_index.sql.txt
+++ b/testdata/result/ddl/create_uniq_null_filtered_index.sql.txt
@@ -8,15 +8,23 @@ create unique null_filtered index foo_bar on foo (foo)
   Unique:       true,
   NullFiltered: true,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 34,
-    NameEnd: 41,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 34,
+        NameEnd: 41,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 45,
-    NameEnd: 48,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 45,
+        NameEnd: 48,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/ddl/create_view.sql.txt b/testdata/result/ddl/create_view.sql.txt
index e96ff6c..09d3e5f 100644
--- a/testdata/result/ddl/create_view.sql.txt
+++ b/testdata/result/ddl/create_view.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 12,
-    NameEnd: 23,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 23,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    false,
   SecurityType: "INVOKER",
diff --git a/testdata/result/ddl/create_view_sql_security_definer.sql.txt b/testdata/result/ddl/create_view_sql_security_definer.sql.txt
index 6d134f8..345b29a 100644
--- a/testdata/result/ddl/create_view_sql_security_definer.sql.txt
+++ b/testdata/result/ddl/create_view_sql_security_definer.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 12,
-    NameEnd: 23,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 23,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    false,
   SecurityType: "DEFINER",
diff --git a/testdata/result/ddl/drop_index.sql.txt b/testdata/result/ddl/drop_index.sql.txt
index 517bda8..47ac657 100644
--- a/testdata/result/ddl/drop_index.sql.txt
+++ b/testdata/result/ddl/drop_index.sql.txt
@@ -5,10 +5,14 @@ drop index foo_bar
 &ast.DropIndex{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 11,
-    NameEnd: 18,
-    Name:    "foo_bar",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 18,
+        Name:    "foo_bar",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_index_if_exists.sql.txt b/testdata/result/ddl/drop_index_if_exists.sql.txt
index 5549fd1..54cf0a6 100644
--- a/testdata/result/ddl/drop_index_if_exists.sql.txt
+++ b/testdata/result/ddl/drop_index_if_exists.sql.txt
@@ -5,10 +5,14 @@ drop index if exists foo_bar
 &ast.DropIndex{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 21,
-    NameEnd: 28,
-    Name:    "foo_bar",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 28,
+        Name:    "foo_bar",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_sequence.sql.txt b/testdata/result/ddl/drop_sequence.sql.txt
index 5cf3fb9..74d0585 100644
--- a/testdata/result/ddl/drop_sequence.sql.txt
+++ b/testdata/result/ddl/drop_sequence.sql.txt
@@ -5,10 +5,14 @@ DROP SEQUENCE my_sequence
 &ast.DropSequence{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 14,
-    NameEnd: 25,
-    Name:    "my_sequence",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 14,
+        NameEnd: 25,
+        Name:    "my_sequence",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_sequence_if_exits.sql.txt b/testdata/result/ddl/drop_sequence_if_exits.sql.txt
index 8d420cb..f8dd573 100644
--- a/testdata/result/ddl/drop_sequence_if_exits.sql.txt
+++ b/testdata/result/ddl/drop_sequence_if_exits.sql.txt
@@ -5,10 +5,14 @@ DROP SEQUENCE IF EXISTS my_sequence
 &ast.DropSequence{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 24,
-    NameEnd: 35,
-    Name:    "my_sequence",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 35,
+        Name:    "my_sequence",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_table.sql.txt b/testdata/result/ddl/drop_table.sql.txt
index 70ee12d..099b993 100644
--- a/testdata/result/ddl/drop_table.sql.txt
+++ b/testdata/result/ddl/drop_table.sql.txt
@@ -5,10 +5,14 @@ drop table foo
 &ast.DropTable{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 11,
-    NameEnd: 14,
-    Name:    "foo",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 14,
+        Name:    "foo",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_table_if_exists.sql.txt b/testdata/result/ddl/drop_table_if_exists.sql.txt
index 299373d..de5578c 100644
--- a/testdata/result/ddl/drop_table_if_exists.sql.txt
+++ b/testdata/result/ddl/drop_table_if_exists.sql.txt
@@ -5,10 +5,14 @@ drop table if exists foo
 &ast.DropTable{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 21,
-    NameEnd: 24,
-    Name:    "foo",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 24,
+        Name:    "foo",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/drop_view.sql.txt b/testdata/result/ddl/drop_view.sql.txt
index 7003638..959ce82 100644
--- a/testdata/result/ddl/drop_view.sql.txt
+++ b/testdata/result/ddl/drop_view.sql.txt
@@ -3,10 +3,14 @@ DROP VIEW SingersView
 --- AST
 &ast.DropView{
   Drop: 0,
-  Name: &ast.Ident{
-    NamePos: 10,
-    NameEnd: 21,
-    Name:    "SingersView",
+  Name: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 10,
+        NameEnd: 21,
+        Name:    "SingersView",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/ddl/named_schema_create_table_backquoted.sql.txt b/testdata/result/ddl/named_schema_create_table_backquoted.sql.txt
new file mode 100644
index 0000000..df3b75b
--- /dev/null
+++ b/testdata/result/ddl/named_schema_create_table_backquoted.sql.txt
@@ -0,0 +1,59 @@
+--- named_schema_create_table_backquoted.sql
+CREATE TABLE `ORDER`.`ORDER`(PK INT64) PRIMARY KEY(PK)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      53,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "ORDER",
+      },
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 28,
+        Name:    "ORDER",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 29,
+        NameEnd: 31,
+        Name:    "PK",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 32,
+        Name:    "INT64",
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 51,
+        NameEnd: 53,
+        Name:    "PK",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE `ORDER`.`ORDER` (PK INT64) PRIMARY KEY (PK)
diff --git a/testdata/result/ddl/named_schemas_alter_index.sql.txt b/testdata/result/ddl/named_schemas_alter_index.sql.txt
new file mode 100644
index 0000000..9d5151d
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_alter_index.sql.txt
@@ -0,0 +1,31 @@
+--- named_schemas_alter_index.sql
+ALTER INDEX sch1.indexOnSingers ADD STORED COLUMN SingerInfo
+--- AST
+&ast.AlterIndex{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 31,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+  IndexAlteration: &ast.AddStoredColumn{
+    Add:  32,
+    Name: &ast.Ident{
+      NamePos: 50,
+      NameEnd: 60,
+      Name:    "SingerInfo",
+    },
+  },
+}
+
+--- SQL
+ALTER INDEX sch1.indexOnSingers ADD STORED COLUMN SingerInfo
diff --git a/testdata/result/ddl/named_schemas_alter_sequence.sql.txt b/testdata/result/ddl/named_schemas_alter_sequence.sql.txt
new file mode 100644
index 0000000..5f90e6c
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_alter_sequence.sql.txt
@@ -0,0 +1,56 @@
+--- named_schemas_alter_sequence.sql
+ALTER SEQUENCE sch1.sequence
+    SET OPTIONS (skip_range_min=1, skip_range_max=1234567)
+--- AST
+&ast.AlterSequence{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 19,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 20,
+        NameEnd: 28,
+        Name:    "sequence",
+      },
+    },
+  },
+  Options: &ast.Options{
+    Options: 37,
+    Rparen:  86,
+    Records: []*ast.OptionsDef{
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 46,
+          NameEnd: 60,
+          Name:    "skip_range_min",
+        },
+        Value: &ast.IntLiteral{
+          ValuePos: 61,
+          ValueEnd: 62,
+          Base:     10,
+          Value:    "1",
+        },
+      },
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 64,
+          NameEnd: 78,
+          Name:    "skip_range_max",
+        },
+        Value: &ast.IntLiteral{
+          ValuePos: 79,
+          ValueEnd: 86,
+          Base:     10,
+          Value:    "1234567",
+        },
+      },
+    },
+  },
+}
+
+--- SQL
+ALTER SEQUENCE sch1.sequence SET OPTIONS (skip_range_min = 1, skip_range_max = 1234567)
diff --git a/testdata/result/ddl/named_schemas_alter_table_add_constraint.sql.txt b/testdata/result/ddl/named_schemas_alter_table_add_constraint.sql.txt
new file mode 100644
index 0000000..92b6c59
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_alter_table_add_constraint.sql.txt
@@ -0,0 +1,79 @@
+--- named_schemas_alter_table_add_constraint.sql
+ALTER TABLE sch1.ShoppingCarts ADD CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE
+--- AST
+&ast.AlterTable{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 30,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  TableAlteration: &ast.AddTableConstraint{
+    Add:             31,
+    TableConstraint: &ast.TableConstraint{
+      ConstraintPos: 35,
+      Name:          &ast.Ident{
+        NamePos: 46,
+        NameEnd: 70,
+        Name:    "FKShoppingCartsCustomers",
+      },
+      Constraint: &ast.ForeignKey{
+        Foreign:     71,
+        Rparen:      163,
+        OnDeleteEnd: 182,
+        Columns:     []*ast.Ident{
+          &ast.Ident{
+            NamePos: 83,
+            NameEnd: 93,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 95,
+            NameEnd: 107,
+            Name:    "CustomerName",
+          },
+        },
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 124,
+              NameEnd: 128,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 129,
+              NameEnd: 138,
+              Name:    "Customers",
+            },
+          },
+        },
+        ReferenceColumns: []*ast.Ident{
+          &ast.Ident{
+            NamePos: 139,
+            NameEnd: 149,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 151,
+            NameEnd: 163,
+            Name:    "CustomerName",
+          },
+        },
+        OnDelete: "ON DELETE CASCADE",
+      },
+    },
+  },
+}
+
+--- SQL
+ALTER TABLE sch1.ShoppingCarts ADD CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY (CustomerId, CustomerName) REFERENCES sch1.Customers (CustomerId, CustomerName) ON DELETE CASCADE
diff --git a/testdata/result/ddl/named_schemas_alter_table_drop_constraints.sql.txt b/testdata/result/ddl/named_schemas_alter_table_drop_constraints.sql.txt
new file mode 100644
index 0000000..e76de6a
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_alter_table_drop_constraints.sql.txt
@@ -0,0 +1,31 @@
+--- named_schemas_alter_table_drop_constraints.sql
+ALTER TABLE sch1.ShoppingCarts DROP CONSTRAINT FKShoppingCartsCustomers
+--- AST
+&ast.AlterTable{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 30,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  TableAlteration: &ast.DropConstraint{
+    Drop: 31,
+    Name: &ast.Ident{
+      NamePos: 47,
+      NameEnd: 71,
+      Name:    "FKShoppingCartsCustomers",
+    },
+  },
+}
+
+--- SQL
+ALTER TABLE sch1.ShoppingCarts DROP CONSTRAINT FKShoppingCartsCustomers
diff --git a/testdata/result/ddl/named_schemas_create_index.sql.txt b/testdata/result/ddl/named_schemas_create_index.sql.txt
new file mode 100644
index 0000000..7f58a8e
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_index.sql.txt
@@ -0,0 +1,54 @@
+--- named_schemas_create_index.sql
+CREATE INDEX sch1.indexOnSingers ON sch1.Singers(FirstName)
+--- AST
+&ast.CreateIndex{
+  Create:       0,
+  Rparen:       58,
+  Unique:       false,
+  NullFiltered: false,
+  IfNotExists:  false,
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 32,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 36,
+        NameEnd: 40,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 41,
+        NameEnd: 48,
+        Name:    "Singers",
+      },
+    },
+  },
+  Keys: []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 49,
+        NameEnd: 58,
+        Name:    "FirstName",
+      },
+      Dir: "",
+    },
+  },
+  Storing:      (*ast.Storing)(nil),
+  InterleaveIn: (*ast.InterleaveIn)(nil),
+}
+
+--- SQL
+CREATE INDEX sch1.indexOnSingers ON sch1.Singers (FirstName)
diff --git a/testdata/result/ddl/named_schemas_create_sequence.sql.txt b/testdata/result/ddl/named_schemas_create_sequence.sql.txt
new file mode 100644
index 0000000..3fbcbdb
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_sequence.sql.txt
@@ -0,0 +1,44 @@
+--- named_schemas_create_sequence.sql
+CREATE SEQUENCE sch1.sequence OPTIONS (
+  sequence_kind = 'bit_reversed_positive'
+)
+--- AST
+&ast.CreateSequence{
+  Create: 0,
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 20,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 29,
+        Name:    "sequence",
+      },
+    },
+  },
+  IfNotExists: false,
+  Options:     &ast.Options{
+    Options: 30,
+    Rparen:  82,
+    Records: []*ast.OptionsDef{
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 42,
+          NameEnd: 55,
+          Name:    "sequence_kind",
+        },
+        Value: &ast.StringLiteral{
+          ValuePos: 58,
+          ValueEnd: 81,
+          Value:    "bit_reversed_positive",
+        },
+      },
+    },
+  },
+}
+
+--- SQL
+CREATE SEQUENCE sch1.sequence OPTIONS (sequence_kind = "bit_reversed_positive")
diff --git a/testdata/result/ddl/named_schemas_create_table.sql.txt b/testdata/result/ddl/named_schemas_create_table.sql.txt
new file mode 100644
index 0000000..9d03839
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_table.sql.txt
@@ -0,0 +1,134 @@
+--- named_schemas_create_table.sql
+CREATE TABLE sch1.Singers (
+    SingerId INT64 NOT NULL,
+    FirstName STRING(1024),
+    LastName STRING(1024),
+    SingerInfo BYTES(MAX),
+) PRIMARY KEY(SingerId)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      161,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 25,
+        Name:    "Singers",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 51,
+      Name: &ast.Ident{
+        NamePos: 32,
+        NameEnd: 40,
+        Name:    "SingerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 41,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 61,
+        NameEnd: 70,
+        Name:    "FirstName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 71,
+        Rparen:  82,
+        Name:    "STRING",
+        Max:     false,
+        Size:    &ast.IntLiteral{
+          ValuePos: 78,
+          ValueEnd: 82,
+          Base:     10,
+          Value:    "1024",
+        },
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 89,
+        NameEnd: 97,
+        Name:    "LastName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 98,
+        Rparen:  109,
+        Name:    "STRING",
+        Max:     false,
+        Size:    &ast.IntLiteral{
+          ValuePos: 105,
+          ValueEnd: 109,
+          Base:     10,
+          Value:    "1024",
+        },
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 116,
+        NameEnd: 126,
+        Name:    "SingerInfo",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 127,
+        Rparen:  136,
+        Name:    "BYTES",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 153,
+        NameEnd: 161,
+        Name:    "SingerId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.Singers (SingerId INT64 NOT NULL, FirstName STRING(1024), LastName STRING(1024), SingerInfo BYTES(MAX)) PRIMARY KEY (SingerId)
diff --git a/testdata/result/ddl/named_schemas_create_table_foreign_key.sql.txt b/testdata/result/ddl/named_schemas_create_table_foreign_key.sql.txt
new file mode 100644
index 0000000..47a97bb
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_table_foreign_key.sql.txt
@@ -0,0 +1,155 @@
+--- named_schemas_create_table_foreign_key.sql
+CREATE TABLE sch1.ShoppingCarts (
+  CartId INT64 NOT NULL,
+  CustomerId INT64 NOT NULL,
+  CustomerName STRING(MAX) NOT NULL,
+  CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE,
+) PRIMARY KEY(CartId)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      296,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 31,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 53,
+      Name: &ast.Ident{
+        NamePos: 36,
+        NameEnd: 42,
+        Name:    "CartId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 43,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 82,
+      Name: &ast.Ident{
+        NamePos: 61,
+        NameEnd: 71,
+        Name:    "CustomerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 72,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 119,
+      Name: &ast.Ident{
+        NamePos: 90,
+        NameEnd: 102,
+        Name:    "CustomerName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 103,
+        Rparen:  113,
+        Name:    "STRING",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint{
+    &ast.TableConstraint{
+      ConstraintPos: 127,
+      Name:          &ast.Ident{
+        NamePos: 138,
+        NameEnd: 162,
+        Name:    "FKShoppingCartsCustomers",
+      },
+      Constraint: &ast.ForeignKey{
+        Foreign:     163,
+        Rparen:      255,
+        OnDeleteEnd: 274,
+        Columns:     []*ast.Ident{
+          &ast.Ident{
+            NamePos: 175,
+            NameEnd: 185,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 187,
+            NameEnd: 199,
+            Name:    "CustomerName",
+          },
+        },
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 216,
+              NameEnd: 220,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 221,
+              NameEnd: 230,
+              Name:    "Customers",
+            },
+          },
+        },
+        ReferenceColumns: []*ast.Ident{
+          &ast.Ident{
+            NamePos: 231,
+            NameEnd: 241,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 243,
+            NameEnd: 255,
+            Name:    "CustomerName",
+          },
+        },
+        OnDelete: "ON DELETE CASCADE",
+      },
+    },
+  },
+  PrimaryKeys: []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 290,
+        NameEnd: 296,
+        Name:    "CartId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.ShoppingCarts (CartId INT64 NOT NULL, CustomerId INT64 NOT NULL, CustomerName STRING(MAX) NOT NULL, CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY (CustomerId, CustomerName) REFERENCES sch1.Customers (CustomerId, CustomerName) ON DELETE CASCADE) PRIMARY KEY (CartId)
diff --git a/testdata/result/ddl/named_schemas_create_table_interleave.sql.txt b/testdata/result/ddl/named_schemas_create_table_interleave.sql.txt
new file mode 100644
index 0000000..2f909ec
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_table_interleave.sql.txt
@@ -0,0 +1,128 @@
+--- named_schemas_create_table_interleave.sql
+CREATE TABLE sch1.Albums (
+  SingerId INT64 NOT NULL,
+  AlbumId INT64 NOT NULL,
+  AlbumTitle STRING(MAX),
+) PRIMARY KEY(SingerId, AlbumId),
+  INTERLEAVE IN PARENT sch1.Singers ON DELETE CASCADE
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      137,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 24,
+        Name:    "Albums",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 48,
+      Name: &ast.Ident{
+        NamePos: 29,
+        NameEnd: 37,
+        Name:    "SingerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 38,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 74,
+      Name: &ast.Ident{
+        NamePos: 56,
+        NameEnd: 63,
+        Name:    "AlbumId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 64,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 82,
+        NameEnd: 92,
+        Name:    "AlbumTitle",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 93,
+        Rparen:  103,
+        Name:    "STRING",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 120,
+        NameEnd: 128,
+        Name:    "SingerId",
+      },
+      Dir: "",
+    },
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 130,
+        NameEnd: 137,
+        Name:    "AlbumId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms: []*ast.Synonym(nil),
+  Cluster:  &ast.Cluster{
+    Comma:       138,
+    OnDeleteEnd: 193,
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 163,
+          NameEnd: 167,
+          Name:    "sch1",
+        },
+        &ast.Ident{
+          NamePos: 168,
+          NameEnd: 175,
+          Name:    "Singers",
+        },
+      },
+    },
+    OnDelete: "ON DELETE CASCADE",
+  },
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.Albums (SingerId INT64 NOT NULL, AlbumId INT64 NOT NULL, AlbumTitle STRING(MAX)) PRIMARY KEY (SingerId, AlbumId), INTERLEAVE IN PARENT sch1.Singers ON DELETE CASCADE
diff --git a/testdata/result/ddl/named_schemas_create_view.sql.txt b/testdata/result/ddl/named_schemas_create_view.sql.txt
new file mode 100644
index 0000000..1961594
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_create_view.sql.txt
@@ -0,0 +1,142 @@
+--- named_schemas_create_view.sql
+CREATE VIEW sch1.SingerView SQL SECURITY INVOKER
+AS Select s.FirstName, s.LastName, s.SingerInfo
+   FROM sch1.Singers AS s WHERE s.SingerId = 123456
+--- AST
+&ast.CreateView{
+  Create: 0,
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 27,
+        Name:    "SingerView",
+      },
+    },
+  },
+  OrReplace:    false,
+  SecurityType: "INVOKER",
+  Query:        &ast.Select{
+    Select:   52,
+    Distinct: false,
+    As:       nil,
+    Results:  []ast.SelectItem{
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 59,
+              NameEnd: 60,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 61,
+              NameEnd: 70,
+              Name:    "FirstName",
+            },
+          },
+        },
+      },
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 73,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 74,
+              NameEnd: 82,
+              Name:    "LastName",
+            },
+          },
+        },
+      },
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 84,
+              NameEnd: 85,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 86,
+              NameEnd: 96,
+              Name:    "SingerInfo",
+            },
+          },
+        },
+      },
+    },
+    From: &ast.From{
+      From:   100,
+      Source: &ast.PathTableExpr{
+        Path: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 105,
+              NameEnd: 109,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 110,
+              NameEnd: 117,
+              Name:    "Singers",
+            },
+          },
+        },
+        Hint: (*ast.Hint)(nil),
+        As:   &ast.AsAlias{
+          As:    118,
+          Alias: &ast.Ident{
+            NamePos: 121,
+            NameEnd: 122,
+            Name:    "s",
+          },
+        },
+        WithOffset: (*ast.WithOffset)(nil),
+        Sample:     (*ast.TableSample)(nil),
+      },
+    },
+    Where: &ast.Where{
+      Where: 123,
+      Expr:  &ast.BinaryExpr{
+        Op:   "=",
+        Left: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 129,
+              NameEnd: 130,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 131,
+              NameEnd: 139,
+              Name:    "SingerId",
+            },
+          },
+        },
+        Right: &ast.IntLiteral{
+          ValuePos: 142,
+          ValueEnd: 148,
+          Base:     10,
+          Value:    "123456",
+        },
+      },
+    },
+    GroupBy: (*ast.GroupBy)(nil),
+    Having:  (*ast.Having)(nil),
+    OrderBy: (*ast.OrderBy)(nil),
+    Limit:   (*ast.Limit)(nil),
+  },
+}
+
+--- SQL
+CREATE VIEW sch1.SingerView SQL SECURITY INVOKER AS SELECT s.FirstName, s.LastName, s.SingerInfo FROM sch1.Singers AS s WHERE s.SingerId = 123456
diff --git a/testdata/result/ddl/named_schemas_drop_index.sql.txt b/testdata/result/ddl/named_schemas_drop_index.sql.txt
new file mode 100644
index 0000000..e39e22d
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_drop_index.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_index.sql
+DROP INDEX sch1.indexOnSingers
+--- AST
+&ast.DropIndex{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 15,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 30,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP INDEX sch1.indexOnSingers
diff --git a/testdata/result/ddl/named_schemas_drop_sequence.sql.txt b/testdata/result/ddl/named_schemas_drop_sequence.sql.txt
new file mode 100644
index 0000000..1714e94
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_drop_sequence.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_sequence.sql
+DROP SEQUENCE sch1.sequence
+--- AST
+&ast.DropSequence{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 14,
+        NameEnd: 18,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 19,
+        NameEnd: 27,
+        Name:    "sequence",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP SEQUENCE sch1.sequence
diff --git a/testdata/result/ddl/named_schemas_drop_table.sql.txt b/testdata/result/ddl/named_schemas_drop_table.sql.txt
new file mode 100644
index 0000000..f4a3fc7
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_drop_table.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_table.sql
+DROP TABLE sch1.ShoppingCarts
+--- AST
+&ast.DropTable{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 15,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 29,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP TABLE sch1.ShoppingCarts
diff --git a/testdata/result/ddl/named_schemas_drop_view.sql.txt b/testdata/result/ddl/named_schemas_drop_view.sql.txt
new file mode 100644
index 0000000..0431f46
--- /dev/null
+++ b/testdata/result/ddl/named_schemas_drop_view.sql.txt
@@ -0,0 +1,23 @@
+--- named_schemas_drop_view.sql
+DROP VIEW sch1.SingerView
+--- AST
+&ast.DropView{
+  Drop: 0,
+  Name: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 10,
+        NameEnd: 14,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 25,
+        Name:    "SingerView",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP VIEW sch1.SingerView
diff --git a/testdata/result/statement/alter_index_add_stored_column.sql.txt b/testdata/result/statement/alter_index_add_stored_column.sql.txt
index c050f94..ae278e4 100644
--- a/testdata/result/statement/alter_index_add_stored_column.sql.txt
+++ b/testdata/result/statement/alter_index_add_stored_column.sql.txt
@@ -4,10 +4,14 @@ alter index foo add stored column bar
 --- AST
 &ast.AlterIndex{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   IndexAlteration: &ast.AddStoredColumn{
     Add:  16,
diff --git a/testdata/result/statement/alter_index_drop_stored_column.sql.txt b/testdata/result/statement/alter_index_drop_stored_column.sql.txt
index 0255727..1a54ff4 100644
--- a/testdata/result/statement/alter_index_drop_stored_column.sql.txt
+++ b/testdata/result/statement/alter_index_drop_stored_column.sql.txt
@@ -4,10 +4,14 @@ alter index foo drop stored column bar
 --- AST
 &ast.AlterIndex{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   IndexAlteration: &ast.DropStoredColumn{
     Drop: 16,
diff --git a/testdata/result/statement/alter_sequence.sql.txt b/testdata/result/statement/alter_sequence.sql.txt
index dd88bf9..0183cc1 100644
--- a/testdata/result/statement/alter_sequence.sql.txt
+++ b/testdata/result/statement/alter_sequence.sql.txt
@@ -4,10 +4,14 @@ ALTER SEQUENCE my_sequence SET OPTIONS (skip_range_min=1, skip_range_max=1234567
 --- AST
 &ast.AlterSequence{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 15,
-    NameEnd: 26,
-    Name:    "my_sequence",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 26,
+        Name:    "my_sequence",
+      },
+    },
   },
   Options: &ast.Options{
     Options: 31,
diff --git a/testdata/result/statement/alter_table_add_check.sql.txt b/testdata/result/statement/alter_table_add_check.sql.txt
index 5ecdaf7..12790e8 100644
--- a/testdata/result/statement/alter_table_add_check.sql.txt
+++ b/testdata/result/statement/alter_table_add_check.sql.txt
@@ -4,10 +4,14 @@ alter table foo add check (c1 > 0)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
diff --git a/testdata/result/statement/alter_table_add_column.sql.txt b/testdata/result/statement/alter_table_add_column.sql.txt
index b4b8830..c146057 100644
--- a/testdata/result/statement/alter_table_add_column.sql.txt
+++ b/testdata/result/statement/alter_table_add_column.sql.txt
@@ -3,10 +3,14 @@ alter table foo add column baz string(max) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/statement/alter_table_add_column_if_not_exists.sql.txt b/testdata/result/statement/alter_table_add_column_if_not_exists.sql.txt
index f4158ba..4945c62 100644
--- a/testdata/result/statement/alter_table_add_column_if_not_exists.sql.txt
+++ b/testdata/result/statement/alter_table_add_column_if_not_exists.sql.txt
@@ -4,10 +4,14 @@ alter table foo add column if not exists baz string(max) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/statement/alter_table_add_column_with_if_expression.sql.txt b/testdata/result/statement/alter_table_add_column_with_if_expression.sql.txt
index 8726d65..9188ae2 100644
--- a/testdata/result/statement/alter_table_add_column_with_if_expression.sql.txt
+++ b/testdata/result/statement/alter_table_add_column_with_if_expression.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE foo ADD COLUMN expired_at TIMESTAMP AS (IF (status != "OPEN" AND sta
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddColumn{
     Add:         16,
diff --git a/testdata/result/statement/alter_table_add_constraint_check.sql.txt b/testdata/result/statement/alter_table_add_constraint_check.sql.txt
index 187b07e..c7b6bd7 100644
--- a/testdata/result/statement/alter_table_add_constraint_check.sql.txt
+++ b/testdata/result/statement/alter_table_add_constraint_check.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint cname check (c1 > 0)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
diff --git a/testdata/result/statement/alter_table_add_constraint_foreign_key.sql.txt b/testdata/result/statement/alter_table_add_constraint_foreign_key.sql.txt
index 6c0720c..14f2f1d 100644
--- a/testdata/result/statement/alter_table_add_constraint_foreign_key.sql.txt
+++ b/testdata/result/statement/alter_table_add_constraint_foreign_key.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt b/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
index ebb2d03..5763ea7 100644
--- a/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
+++ b/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_cascade.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt b/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
index e7e7251..80052ce 100644
--- a/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
+++ b/testdata/result/statement/alter_table_add_constraint_foreign_key_on_delete_no_action.sql.txt
@@ -4,10 +4,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -34,10 +38,14 @@ alter table foo add constraint fkname foreign key (foo, bar) references t2 (t2ke
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 72,
-          NameEnd: 74,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 74,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/statement/alter_table_add_foreign_key.sql.txt b/testdata/result/statement/alter_table_add_foreign_key.sql.txt
index 1c01e2f..040d5f2 100644
--- a/testdata/result/statement/alter_table_add_foreign_key.sql.txt
+++ b/testdata/result/statement/alter_table_add_foreign_key.sql.txt
@@ -4,10 +4,14 @@ alter table foo add foreign key (bar) references t2 (t2key1)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddTableConstraint{
     Add:             16,
@@ -25,10 +29,14 @@ alter table foo add foreign key (bar) references t2 (t2key1)
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 49,
-          NameEnd: 51,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 49,
+              NameEnd: 51,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/statement/alter_table_add_row_deletion_policy.sql.txt b/testdata/result/statement/alter_table_add_row_deletion_policy.sql.txt
index f04597c..4838ae3 100644
--- a/testdata/result/statement/alter_table_add_row_deletion_policy.sql.txt
+++ b/testdata/result/statement/alter_table_add_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo add row deletion policy ( older_than ( bar, interval 30 day ))
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AddRowDeletionPolicy{
     Add:               16,
diff --git a/testdata/result/statement/alter_table_add_synonym.sql.txt b/testdata/result/statement/alter_table_add_synonym.sql.txt
index 0eda236..0f384a6 100644
--- a/testdata/result/statement/alter_table_add_synonym.sql.txt
+++ b/testdata/result/statement/alter_table_add_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers ADD SYNONYM SingersTest
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.AddSynonym{
     Add:  20,
diff --git a/testdata/result/statement/alter_table_alter_column.sql.txt b/testdata/result/statement/alter_table_alter_column.sql.txt
index 93422dd..13e95b8 100644
--- a/testdata/result/statement/alter_table_alter_column.sql.txt
+++ b/testdata/result/statement/alter_table_alter_column.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo string(256) not null
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/statement/alter_table_alter_column_drop_default.sql.txt b/testdata/result/statement/alter_table_alter_column_drop_default.sql.txt
index 3df5dcc..21b4175 100644
--- a/testdata/result/statement/alter_table_alter_column_drop_default.sql.txt
+++ b/testdata/result/statement/alter_table_alter_column_drop_default.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo drop default
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/statement/alter_table_alter_column_set.sql.txt b/testdata/result/statement/alter_table_alter_column_set.sql.txt
index f5b9d50..79eebcf 100644
--- a/testdata/result/statement/alter_table_alter_column_set.sql.txt
+++ b/testdata/result/statement/alter_table_alter_column_set.sql.txt
@@ -3,10 +3,14 @@ alter table foo alter column foo set options(allow_commit_timestamp = true)
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 16,
diff --git a/testdata/result/statement/alter_table_alter_column_set_default.sql.txt b/testdata/result/statement/alter_table_alter_column_set_default.sql.txt
index af5c786..61bfd3c 100644
--- a/testdata/result/statement/alter_table_alter_column_set_default.sql.txt
+++ b/testdata/result/statement/alter_table_alter_column_set_default.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE actions ALTER COLUMN output SET DEFAULT("")
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "actions",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "actions",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 20,
diff --git a/testdata/result/statement/alter_table_alter_column_with_default.sql.txt b/testdata/result/statement/alter_table_alter_column_with_default.sql.txt
index b2e5c06..1df2208 100644
--- a/testdata/result/statement/alter_table_alter_column_with_default.sql.txt
+++ b/testdata/result/statement/alter_table_alter_column_with_default.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE actions ALTER COLUMN output STRING(MAX) NOT NULL DEFAULT("")
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "actions",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "actions",
+      },
+    },
   },
   TableAlteration: &ast.AlterColumn{
     Alter: 20,
diff --git a/testdata/result/statement/alter_table_drop_column.sql.txt b/testdata/result/statement/alter_table_drop_column.sql.txt
index a6d5089..0a21940 100644
--- a/testdata/result/statement/alter_table_drop_column.sql.txt
+++ b/testdata/result/statement/alter_table_drop_column.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop column bar
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropColumn{
     Drop: 16,
diff --git a/testdata/result/statement/alter_table_drop_constraint.sql.txt b/testdata/result/statement/alter_table_drop_constraint.sql.txt
index 70f0765..cd868b0 100644
--- a/testdata/result/statement/alter_table_drop_constraint.sql.txt
+++ b/testdata/result/statement/alter_table_drop_constraint.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop constraint bar
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropConstraint{
     Drop: 16,
diff --git a/testdata/result/statement/alter_table_drop_row_deletion_policy.sql.txt b/testdata/result/statement/alter_table_drop_row_deletion_policy.sql.txt
index c3a1244..79604aa 100644
--- a/testdata/result/statement/alter_table_drop_row_deletion_policy.sql.txt
+++ b/testdata/result/statement/alter_table_drop_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo drop row deletion policy
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.DropRowDeletionPolicy{
     Drop:   16,
diff --git a/testdata/result/statement/alter_table_drop_synonym.sql.txt b/testdata/result/statement/alter_table_drop_synonym.sql.txt
index ffd6045..f523321 100644
--- a/testdata/result/statement/alter_table_drop_synonym.sql.txt
+++ b/testdata/result/statement/alter_table_drop_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers DROP SYNONYM SingersTest
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.DropSynonym{
     Drop: 20,
diff --git a/testdata/result/statement/alter_table_rename_to.sql.txt b/testdata/result/statement/alter_table_rename_to.sql.txt
index 9e109a7..1e7c36a 100644
--- a/testdata/result/statement/alter_table_rename_to.sql.txt
+++ b/testdata/result/statement/alter_table_rename_to.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers RENAME TO SingersNew
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.RenameTo{
     Rename: 20,
diff --git a/testdata/result/statement/alter_table_rename_to_add_synonym.sql.txt b/testdata/result/statement/alter_table_rename_to_add_synonym.sql.txt
index 3171ea5..868eeb4 100644
--- a/testdata/result/statement/alter_table_rename_to_add_synonym.sql.txt
+++ b/testdata/result/statement/alter_table_rename_to_add_synonym.sql.txt
@@ -3,10 +3,14 @@ ALTER TABLE Singers RENAME TO SingersNew, ADD SYNONYM Singers
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 19,
-    Name:    "Singers",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 19,
+        Name:    "Singers",
+      },
+    },
   },
   TableAlteration: &ast.RenameTo{
     Rename: 20,
diff --git a/testdata/result/statement/alter_table_replace_row_deletion_policy.sql.txt b/testdata/result/statement/alter_table_replace_row_deletion_policy.sql.txt
index ab3d373..3fe645b 100644
--- a/testdata/result/statement/alter_table_replace_row_deletion_policy.sql.txt
+++ b/testdata/result/statement/alter_table_replace_row_deletion_policy.sql.txt
@@ -4,10 +4,14 @@ alter table foo replace row deletion policy ( older_than ( bar, interval 30 day
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.ReplaceRowDeletionPolicy{
     Replace:           16,
diff --git a/testdata/result/statement/alter_table_set_on_delete.sql.txt b/testdata/result/statement/alter_table_set_on_delete.sql.txt
index 9817f83..366965f 100644
--- a/testdata/result/statement/alter_table_set_on_delete.sql.txt
+++ b/testdata/result/statement/alter_table_set_on_delete.sql.txt
@@ -3,10 +3,14 @@ alter table foo set on delete cascade
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.SetOnDelete{
     Set:         16,
diff --git a/testdata/result/statement/alter_table_set_on_delete_no_action.sql.txt b/testdata/result/statement/alter_table_set_on_delete_no_action.sql.txt
index bd058ca..3338676 100644
--- a/testdata/result/statement/alter_table_set_on_delete_no_action.sql.txt
+++ b/testdata/result/statement/alter_table_set_on_delete_no_action.sql.txt
@@ -3,10 +3,14 @@ alter table foo set on delete no action
 --- AST
 &ast.AlterTable{
   Alter: 0,
-  Name:  &ast.Ident{
-    NamePos: 12,
-    NameEnd: 15,
-    Name:    "foo",
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 15,
+        Name:    "foo",
+      },
+    },
   },
   TableAlteration: &ast.SetOnDelete{
     Set:         16,
diff --git a/testdata/result/statement/create_index.sql.txt b/testdata/result/statement/create_index.sql.txt
index aa14baa..568a898 100644
--- a/testdata/result/statement/create_index.sql.txt
+++ b/testdata/result/statement/create_index.sql.txt
@@ -11,15 +11,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/statement/create_index_if_not_exists.sql.txt b/testdata/result/statement/create_index_if_not_exists.sql.txt
index d188cb1..760d3db 100644
--- a/testdata/result/statement/create_index_if_not_exists.sql.txt
+++ b/testdata/result/statement/create_index_if_not_exists.sql.txt
@@ -8,15 +8,23 @@ create index if not exists foo_bar on foo (bar)
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  true,
-  Name:         &ast.Ident{
-    NamePos: 27,
-    NameEnd: 34,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 27,
+        NameEnd: 34,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 38,
-    NameEnd: 41,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 38,
+        NameEnd: 41,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/statement/create_index_interleave.sql.txt b/testdata/result/statement/create_index_interleave.sql.txt
index 7084414..c4efd04 100644
--- a/testdata/result/statement/create_index_interleave.sql.txt
+++ b/testdata/result/statement/create_index_interleave.sql.txt
@@ -11,15 +11,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/statement/create_index_storing.sql.txt b/testdata/result/statement/create_index_storing.sql.txt
index bc0784e..3c538de 100644
--- a/testdata/result/statement/create_index_storing.sql.txt
+++ b/testdata/result/statement/create_index_storing.sql.txt
@@ -10,15 +10,23 @@ create index foo_bar on foo (
   Unique:       false,
   NullFiltered: false,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 24,
-    NameEnd: 27,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 27,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/statement/create_or_replace_view.sql.txt b/testdata/result/statement/create_or_replace_view.sql.txt
index f3b3880..f66ace7 100644
--- a/testdata/result/statement/create_or_replace_view.sql.txt
+++ b/testdata/result/statement/create_or_replace_view.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 23,
-    NameEnd: 34,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 23,
+        NameEnd: 34,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    true,
   SecurityType: "INVOKER",
diff --git a/testdata/result/statement/create_sequance.sql.txt b/testdata/result/statement/create_sequance.sql.txt
index e0bf76d..c9b733f 100644
--- a/testdata/result/statement/create_sequance.sql.txt
+++ b/testdata/result/statement/create_sequance.sql.txt
@@ -8,10 +8,14 @@ CREATE SEQUENCE IF NOT EXISTS MySequence OPTIONS (
 --- AST
 &ast.CreateSequence{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 30,
-    NameEnd: 40,
-    Name:    "MySequence",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 30,
+        NameEnd: 40,
+        Name:    "MySequence",
+      },
+    },
   },
   IfNotExists: true,
   Options:     &ast.Options{
diff --git a/testdata/result/statement/create_table.sql.txt b/testdata/result/statement/create_table.sql.txt
index 5cbba1f..955ce48 100644
--- a/testdata/result/statement/create_table.sql.txt
+++ b/testdata/result/statement/create_table.sql.txt
@@ -19,10 +19,14 @@ create table foo (
   Create:      0,
   Rparen:      573,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -222,10 +226,14 @@ create table foo (
             Name:    "foo",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 211,
-          NameEnd: 213,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 211,
+              NameEnd: 213,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -251,10 +259,14 @@ create table foo (
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 255,
-          NameEnd: 257,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 255,
+              NameEnd: 257,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -280,10 +292,14 @@ create table foo (
             Name:    "baz",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 317,
-          NameEnd: 319,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 317,
+              NameEnd: 319,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
@@ -318,10 +334,14 @@ create table foo (
             Name:    "bar",
           },
         },
-        ReferenceTable: &ast.Ident{
-          NamePos: 404,
-          NameEnd: 406,
-          Name:    "t2",
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 404,
+              NameEnd: 406,
+              Name:    "t2",
+            },
+          },
         },
         ReferenceColumns: []*ast.Ident{
           &ast.Ident{
diff --git a/testdata/result/statement/create_table_cluster.sql.txt b/testdata/result/statement/create_table_cluster.sql.txt
index 0d6a5d5..d68c4f4 100644
--- a/testdata/result/statement/create_table_cluster.sql.txt
+++ b/testdata/result/statement/create_table_cluster.sql.txt
@@ -10,10 +10,14 @@ create table foo (
   Create:      0,
   Rparen:      59,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -57,10 +61,14 @@ create table foo (
   Cluster:          &ast.Cluster{
     Comma:       60,
     OnDeleteEnd: -1,
-    TableName:   &ast.Ident{
-      NamePos: 85,
-      NameEnd: 91,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 85,
+          NameEnd: 91,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "",
   },
diff --git a/testdata/result/statement/create_table_cluster_and_row_deletion_policy.sql.txt b/testdata/result/statement/create_table_cluster_and_row_deletion_policy.sql.txt
index e27a41d..654d7ab 100644
--- a/testdata/result/statement/create_table_cluster_and_row_deletion_policy.sql.txt
+++ b/testdata/result/statement/create_table_cluster_and_row_deletion_policy.sql.txt
@@ -12,10 +12,14 @@ create table foo (
   Create:      0,
   Rparen:      77,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -76,10 +80,14 @@ create table foo (
   Cluster:          &ast.Cluster{
     Comma:       78,
     OnDeleteEnd: -1,
-    TableName:   &ast.Ident{
-      NamePos: 103,
-      NameEnd: 109,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 103,
+          NameEnd: 109,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "",
   },
diff --git a/testdata/result/statement/create_table_cluster_on_delete_no_action.sql.txt b/testdata/result/statement/create_table_cluster_on_delete_no_action.sql.txt
index 7681612..df38046 100644
--- a/testdata/result/statement/create_table_cluster_on_delete_no_action.sql.txt
+++ b/testdata/result/statement/create_table_cluster_on_delete_no_action.sql.txt
@@ -9,10 +9,14 @@ create table foo (
   Create:      0,
   Rparen:      50,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -49,10 +53,14 @@ create table foo (
   Cluster:  &ast.Cluster{
     Comma:       51,
     OnDeleteEnd: 115,
-    TableName:   &ast.Ident{
-      NamePos: 76,
-      NameEnd: 82,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 76,
+          NameEnd: 82,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "ON DELETE NO ACTION",
   },
diff --git a/testdata/result/statement/create_table_cluster_set_on_delete.sql.txt b/testdata/result/statement/create_table_cluster_set_on_delete.sql.txt
index 56a2e62..615cc4a 100644
--- a/testdata/result/statement/create_table_cluster_set_on_delete.sql.txt
+++ b/testdata/result/statement/create_table_cluster_set_on_delete.sql.txt
@@ -9,10 +9,14 @@ create table foo (
   Create:      0,
   Rparen:      49,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
@@ -49,10 +53,14 @@ create table foo (
   Cluster:  &ast.Cluster{
     Comma:       50,
     OnDeleteEnd: 112,
-    TableName:   &ast.Ident{
-      NamePos: 75,
-      NameEnd: 81,
-      Name:    "foobar",
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 75,
+          NameEnd: 81,
+          Name:    "foobar",
+        },
+      },
     },
     OnDelete: "ON DELETE CASCADE",
   },
diff --git a/testdata/result/statement/create_table_fulltext_albums.sql.txt b/testdata/result/statement/create_table_fulltext_albums.sql.txt
index 26d125f..f4a4b23 100644
--- a/testdata/result/statement/create_table_fulltext_albums.sql.txt
+++ b/testdata/result/statement/create_table_fulltext_albums.sql.txt
@@ -14,10 +14,14 @@ CREATE TABLE Albums (
   Create:      105,
   Rparen:      575,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 118,
-    NameEnd: 124,
-    Name:    "Albums",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 118,
+        NameEnd: 124,
+        Name:    "Albums",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_if_not_exists.sql.txt b/testdata/result/statement/create_table_if_not_exists.sql.txt
index a3bce8e..ede4a61 100644
--- a/testdata/result/statement/create_table_if_not_exists.sql.txt
+++ b/testdata/result/statement/create_table_if_not_exists.sql.txt
@@ -9,10 +9,14 @@ create table if not exists foo (
   Create:      0,
   Rparen:      93,
   IfNotExists: true,
-  Name:        &ast.Ident{
-    NamePos: 27,
-    NameEnd: 30,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 27,
+        NameEnd: 30,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_row_deletion_policy.sql.txt b/testdata/result/statement/create_table_row_deletion_policy.sql.txt
index c528214..3d17e37 100644
--- a/testdata/result/statement/create_table_row_deletion_policy.sql.txt
+++ b/testdata/result/statement/create_table_row_deletion_policy.sql.txt
@@ -11,10 +11,14 @@ create table foo (
   Create:      0,
   Rparen:      77,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_synonyms.sql.txt b/testdata/result/statement/create_table_synonyms.sql.txt
index 9264d6f..00ce0aa 100644
--- a/testdata/result/statement/create_table_synonyms.sql.txt
+++ b/testdata/result/statement/create_table_synonyms.sql.txt
@@ -9,10 +9,14 @@ CREATE TABLE Singers (
   Create:      0,
   Rparen:      126,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 20,
-    Name:    "Singers",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "Singers",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_synonyms_abnormal.sql.txt b/testdata/result/statement/create_table_synonyms_abnormal.sql.txt
index 412d563..f63129a 100644
--- a/testdata/result/statement/create_table_synonyms_abnormal.sql.txt
+++ b/testdata/result/statement/create_table_synonyms_abnormal.sql.txt
@@ -11,10 +11,14 @@ CREATE TABLE Singers (
   Create:      45,
   Rparen:      194,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 58,
-    NameEnd: 65,
-    Name:    "Singers",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 58,
+        NameEnd: 65,
+        Name:    "Singers",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_trailing_comma.sql.txt b/testdata/result/statement/create_table_trailing_comma.sql.txt
index 8bded18..0a81242 100644
--- a/testdata/result/statement/create_table_trailing_comma.sql.txt
+++ b/testdata/result/statement/create_table_trailing_comma.sql.txt
@@ -12,10 +12,14 @@ create table foo (
   Create:      0,
   Rparen:      83,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_types.sql.txt b/testdata/result/statement/create_table_types.sql.txt
index ee43900..c789d70 100644
--- a/testdata/result/statement/create_table_types.sql.txt
+++ b/testdata/result/statement/create_table_types.sql.txt
@@ -20,10 +20,14 @@ create table types (
   Create:      0,
   Rparen:      252,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 18,
-    Name:    "types",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 18,
+        Name:    "types",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_table_with_sequence_function.sql.txt b/testdata/result/statement/create_table_with_sequence_function.sql.txt
index 0aea069..a98ac02 100644
--- a/testdata/result/statement/create_table_with_sequence_function.sql.txt
+++ b/testdata/result/statement/create_table_with_sequence_function.sql.txt
@@ -11,10 +11,14 @@ CREATE TABLE foo
   Create:      0,
   Rparen:      143,
   IfNotExists: false,
-  Name:        &ast.Ident{
-    NamePos: 13,
-    NameEnd: 16,
-    Name:    "foo",
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 16,
+        Name:    "foo",
+      },
+    },
   },
   Columns: []*ast.ColumnDef{
     &ast.ColumnDef{
diff --git a/testdata/result/statement/create_uniq_null_filtered_index.sql.txt b/testdata/result/statement/create_uniq_null_filtered_index.sql.txt
index 6c944be..8337e5b 100644
--- a/testdata/result/statement/create_uniq_null_filtered_index.sql.txt
+++ b/testdata/result/statement/create_uniq_null_filtered_index.sql.txt
@@ -8,15 +8,23 @@ create unique null_filtered index foo_bar on foo (foo)
   Unique:       true,
   NullFiltered: true,
   IfNotExists:  false,
-  Name:         &ast.Ident{
-    NamePos: 34,
-    NameEnd: 41,
-    Name:    "foo_bar",
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 34,
+        NameEnd: 41,
+        Name:    "foo_bar",
+      },
+    },
   },
-  TableName: &ast.Ident{
-    NamePos: 45,
-    NameEnd: 48,
-    Name:    "foo",
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 45,
+        NameEnd: 48,
+        Name:    "foo",
+      },
+    },
   },
   Keys: []*ast.IndexKey{
     &ast.IndexKey{
diff --git a/testdata/result/statement/create_view.sql.txt b/testdata/result/statement/create_view.sql.txt
index e96ff6c..09d3e5f 100644
--- a/testdata/result/statement/create_view.sql.txt
+++ b/testdata/result/statement/create_view.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 12,
-    NameEnd: 23,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 23,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    false,
   SecurityType: "INVOKER",
diff --git a/testdata/result/statement/create_view_sql_security_definer.sql.txt b/testdata/result/statement/create_view_sql_security_definer.sql.txt
index 6d134f8..345b29a 100644
--- a/testdata/result/statement/create_view_sql_security_definer.sql.txt
+++ b/testdata/result/statement/create_view_sql_security_definer.sql.txt
@@ -9,10 +9,14 @@ from singers
 --- AST
 &ast.CreateView{
   Create: 0,
-  Name:   &ast.Ident{
-    NamePos: 12,
-    NameEnd: 23,
-    Name:    "singernames",
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 23,
+        Name:    "singernames",
+      },
+    },
   },
   OrReplace:    false,
   SecurityType: "DEFINER",
diff --git a/testdata/result/statement/drop_index.sql.txt b/testdata/result/statement/drop_index.sql.txt
index 517bda8..47ac657 100644
--- a/testdata/result/statement/drop_index.sql.txt
+++ b/testdata/result/statement/drop_index.sql.txt
@@ -5,10 +5,14 @@ drop index foo_bar
 &ast.DropIndex{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 11,
-    NameEnd: 18,
-    Name:    "foo_bar",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 18,
+        Name:    "foo_bar",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_index_if_exists.sql.txt b/testdata/result/statement/drop_index_if_exists.sql.txt
index 5549fd1..54cf0a6 100644
--- a/testdata/result/statement/drop_index_if_exists.sql.txt
+++ b/testdata/result/statement/drop_index_if_exists.sql.txt
@@ -5,10 +5,14 @@ drop index if exists foo_bar
 &ast.DropIndex{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 21,
-    NameEnd: 28,
-    Name:    "foo_bar",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 28,
+        Name:    "foo_bar",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_sequence.sql.txt b/testdata/result/statement/drop_sequence.sql.txt
index 5cf3fb9..74d0585 100644
--- a/testdata/result/statement/drop_sequence.sql.txt
+++ b/testdata/result/statement/drop_sequence.sql.txt
@@ -5,10 +5,14 @@ DROP SEQUENCE my_sequence
 &ast.DropSequence{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 14,
-    NameEnd: 25,
-    Name:    "my_sequence",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 14,
+        NameEnd: 25,
+        Name:    "my_sequence",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_sequence_if_exits.sql.txt b/testdata/result/statement/drop_sequence_if_exits.sql.txt
index 8d420cb..f8dd573 100644
--- a/testdata/result/statement/drop_sequence_if_exits.sql.txt
+++ b/testdata/result/statement/drop_sequence_if_exits.sql.txt
@@ -5,10 +5,14 @@ DROP SEQUENCE IF EXISTS my_sequence
 &ast.DropSequence{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 24,
-    NameEnd: 35,
-    Name:    "my_sequence",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 24,
+        NameEnd: 35,
+        Name:    "my_sequence",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_table.sql.txt b/testdata/result/statement/drop_table.sql.txt
index 70ee12d..099b993 100644
--- a/testdata/result/statement/drop_table.sql.txt
+++ b/testdata/result/statement/drop_table.sql.txt
@@ -5,10 +5,14 @@ drop table foo
 &ast.DropTable{
   Drop:     0,
   IfExists: false,
-  Name:     &ast.Ident{
-    NamePos: 11,
-    NameEnd: 14,
-    Name:    "foo",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 14,
+        Name:    "foo",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_table_if_exists.sql.txt b/testdata/result/statement/drop_table_if_exists.sql.txt
index 299373d..de5578c 100644
--- a/testdata/result/statement/drop_table_if_exists.sql.txt
+++ b/testdata/result/statement/drop_table_if_exists.sql.txt
@@ -5,10 +5,14 @@ drop table if exists foo
 &ast.DropTable{
   Drop:     0,
   IfExists: true,
-  Name:     &ast.Ident{
-    NamePos: 21,
-    NameEnd: 24,
-    Name:    "foo",
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 24,
+        Name:    "foo",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/drop_view.sql.txt b/testdata/result/statement/drop_view.sql.txt
index 7003638..959ce82 100644
--- a/testdata/result/statement/drop_view.sql.txt
+++ b/testdata/result/statement/drop_view.sql.txt
@@ -3,10 +3,14 @@ DROP VIEW SingersView
 --- AST
 &ast.DropView{
   Drop: 0,
-  Name: &ast.Ident{
-    NamePos: 10,
-    NameEnd: 21,
-    Name:    "SingersView",
+  Name: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 10,
+        NameEnd: 21,
+        Name:    "SingersView",
+      },
+    },
   },
 }
 
diff --git a/testdata/result/statement/named_schema_create_table_backquoted.sql.txt b/testdata/result/statement/named_schema_create_table_backquoted.sql.txt
new file mode 100644
index 0000000..df3b75b
--- /dev/null
+++ b/testdata/result/statement/named_schema_create_table_backquoted.sql.txt
@@ -0,0 +1,59 @@
+--- named_schema_create_table_backquoted.sql
+CREATE TABLE `ORDER`.`ORDER`(PK INT64) PRIMARY KEY(PK)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      53,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 20,
+        Name:    "ORDER",
+      },
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 28,
+        Name:    "ORDER",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 29,
+        NameEnd: 31,
+        Name:    "PK",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 32,
+        Name:    "INT64",
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 51,
+        NameEnd: 53,
+        Name:    "PK",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE `ORDER`.`ORDER` (PK INT64) PRIMARY KEY (PK)
diff --git a/testdata/result/statement/named_schemas_alter_index.sql.txt b/testdata/result/statement/named_schemas_alter_index.sql.txt
new file mode 100644
index 0000000..9d5151d
--- /dev/null
+++ b/testdata/result/statement/named_schemas_alter_index.sql.txt
@@ -0,0 +1,31 @@
+--- named_schemas_alter_index.sql
+ALTER INDEX sch1.indexOnSingers ADD STORED COLUMN SingerInfo
+--- AST
+&ast.AlterIndex{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 31,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+  IndexAlteration: &ast.AddStoredColumn{
+    Add:  32,
+    Name: &ast.Ident{
+      NamePos: 50,
+      NameEnd: 60,
+      Name:    "SingerInfo",
+    },
+  },
+}
+
+--- SQL
+ALTER INDEX sch1.indexOnSingers ADD STORED COLUMN SingerInfo
diff --git a/testdata/result/statement/named_schemas_alter_sequence.sql.txt b/testdata/result/statement/named_schemas_alter_sequence.sql.txt
new file mode 100644
index 0000000..5f90e6c
--- /dev/null
+++ b/testdata/result/statement/named_schemas_alter_sequence.sql.txt
@@ -0,0 +1,56 @@
+--- named_schemas_alter_sequence.sql
+ALTER SEQUENCE sch1.sequence
+    SET OPTIONS (skip_range_min=1, skip_range_max=1234567)
+--- AST
+&ast.AlterSequence{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 19,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 20,
+        NameEnd: 28,
+        Name:    "sequence",
+      },
+    },
+  },
+  Options: &ast.Options{
+    Options: 37,
+    Rparen:  86,
+    Records: []*ast.OptionsDef{
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 46,
+          NameEnd: 60,
+          Name:    "skip_range_min",
+        },
+        Value: &ast.IntLiteral{
+          ValuePos: 61,
+          ValueEnd: 62,
+          Base:     10,
+          Value:    "1",
+        },
+      },
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 64,
+          NameEnd: 78,
+          Name:    "skip_range_max",
+        },
+        Value: &ast.IntLiteral{
+          ValuePos: 79,
+          ValueEnd: 86,
+          Base:     10,
+          Value:    "1234567",
+        },
+      },
+    },
+  },
+}
+
+--- SQL
+ALTER SEQUENCE sch1.sequence SET OPTIONS (skip_range_min = 1, skip_range_max = 1234567)
diff --git a/testdata/result/statement/named_schemas_alter_table_add_constraint.sql.txt b/testdata/result/statement/named_schemas_alter_table_add_constraint.sql.txt
new file mode 100644
index 0000000..92b6c59
--- /dev/null
+++ b/testdata/result/statement/named_schemas_alter_table_add_constraint.sql.txt
@@ -0,0 +1,79 @@
+--- named_schemas_alter_table_add_constraint.sql
+ALTER TABLE sch1.ShoppingCarts ADD CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE
+--- AST
+&ast.AlterTable{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 30,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  TableAlteration: &ast.AddTableConstraint{
+    Add:             31,
+    TableConstraint: &ast.TableConstraint{
+      ConstraintPos: 35,
+      Name:          &ast.Ident{
+        NamePos: 46,
+        NameEnd: 70,
+        Name:    "FKShoppingCartsCustomers",
+      },
+      Constraint: &ast.ForeignKey{
+        Foreign:     71,
+        Rparen:      163,
+        OnDeleteEnd: 182,
+        Columns:     []*ast.Ident{
+          &ast.Ident{
+            NamePos: 83,
+            NameEnd: 93,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 95,
+            NameEnd: 107,
+            Name:    "CustomerName",
+          },
+        },
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 124,
+              NameEnd: 128,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 129,
+              NameEnd: 138,
+              Name:    "Customers",
+            },
+          },
+        },
+        ReferenceColumns: []*ast.Ident{
+          &ast.Ident{
+            NamePos: 139,
+            NameEnd: 149,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 151,
+            NameEnd: 163,
+            Name:    "CustomerName",
+          },
+        },
+        OnDelete: "ON DELETE CASCADE",
+      },
+    },
+  },
+}
+
+--- SQL
+ALTER TABLE sch1.ShoppingCarts ADD CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY (CustomerId, CustomerName) REFERENCES sch1.Customers (CustomerId, CustomerName) ON DELETE CASCADE
diff --git a/testdata/result/statement/named_schemas_alter_table_drop_constraints.sql.txt b/testdata/result/statement/named_schemas_alter_table_drop_constraints.sql.txt
new file mode 100644
index 0000000..e76de6a
--- /dev/null
+++ b/testdata/result/statement/named_schemas_alter_table_drop_constraints.sql.txt
@@ -0,0 +1,31 @@
+--- named_schemas_alter_table_drop_constraints.sql
+ALTER TABLE sch1.ShoppingCarts DROP CONSTRAINT FKShoppingCartsCustomers
+--- AST
+&ast.AlterTable{
+  Alter: 0,
+  Name:  &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 30,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  TableAlteration: &ast.DropConstraint{
+    Drop: 31,
+    Name: &ast.Ident{
+      NamePos: 47,
+      NameEnd: 71,
+      Name:    "FKShoppingCartsCustomers",
+    },
+  },
+}
+
+--- SQL
+ALTER TABLE sch1.ShoppingCarts DROP CONSTRAINT FKShoppingCartsCustomers
diff --git a/testdata/result/statement/named_schemas_create_index.sql.txt b/testdata/result/statement/named_schemas_create_index.sql.txt
new file mode 100644
index 0000000..7f58a8e
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_index.sql.txt
@@ -0,0 +1,54 @@
+--- named_schemas_create_index.sql
+CREATE INDEX sch1.indexOnSingers ON sch1.Singers(FirstName)
+--- AST
+&ast.CreateIndex{
+  Create:       0,
+  Rparen:       58,
+  Unique:       false,
+  NullFiltered: false,
+  IfNotExists:  false,
+  Name:         &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 32,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+  TableName: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 36,
+        NameEnd: 40,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 41,
+        NameEnd: 48,
+        Name:    "Singers",
+      },
+    },
+  },
+  Keys: []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 49,
+        NameEnd: 58,
+        Name:    "FirstName",
+      },
+      Dir: "",
+    },
+  },
+  Storing:      (*ast.Storing)(nil),
+  InterleaveIn: (*ast.InterleaveIn)(nil),
+}
+
+--- SQL
+CREATE INDEX sch1.indexOnSingers ON sch1.Singers (FirstName)
diff --git a/testdata/result/statement/named_schemas_create_sequence.sql.txt b/testdata/result/statement/named_schemas_create_sequence.sql.txt
new file mode 100644
index 0000000..3fbcbdb
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_sequence.sql.txt
@@ -0,0 +1,44 @@
+--- named_schemas_create_sequence.sql
+CREATE SEQUENCE sch1.sequence OPTIONS (
+  sequence_kind = 'bit_reversed_positive'
+)
+--- AST
+&ast.CreateSequence{
+  Create: 0,
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 20,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 21,
+        NameEnd: 29,
+        Name:    "sequence",
+      },
+    },
+  },
+  IfNotExists: false,
+  Options:     &ast.Options{
+    Options: 30,
+    Rparen:  82,
+    Records: []*ast.OptionsDef{
+      &ast.OptionsDef{
+        Name: &ast.Ident{
+          NamePos: 42,
+          NameEnd: 55,
+          Name:    "sequence_kind",
+        },
+        Value: &ast.StringLiteral{
+          ValuePos: 58,
+          ValueEnd: 81,
+          Value:    "bit_reversed_positive",
+        },
+      },
+    },
+  },
+}
+
+--- SQL
+CREATE SEQUENCE sch1.sequence OPTIONS (sequence_kind = "bit_reversed_positive")
diff --git a/testdata/result/statement/named_schemas_create_table.sql.txt b/testdata/result/statement/named_schemas_create_table.sql.txt
new file mode 100644
index 0000000..9d03839
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_table.sql.txt
@@ -0,0 +1,134 @@
+--- named_schemas_create_table.sql
+CREATE TABLE sch1.Singers (
+    SingerId INT64 NOT NULL,
+    FirstName STRING(1024),
+    LastName STRING(1024),
+    SingerInfo BYTES(MAX),
+) PRIMARY KEY(SingerId)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      161,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 25,
+        Name:    "Singers",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 51,
+      Name: &ast.Ident{
+        NamePos: 32,
+        NameEnd: 40,
+        Name:    "SingerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 41,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 61,
+        NameEnd: 70,
+        Name:    "FirstName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 71,
+        Rparen:  82,
+        Name:    "STRING",
+        Max:     false,
+        Size:    &ast.IntLiteral{
+          ValuePos: 78,
+          ValueEnd: 82,
+          Base:     10,
+          Value:    "1024",
+        },
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 89,
+        NameEnd: 97,
+        Name:    "LastName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 98,
+        Rparen:  109,
+        Name:    "STRING",
+        Max:     false,
+        Size:    &ast.IntLiteral{
+          ValuePos: 105,
+          ValueEnd: 109,
+          Base:     10,
+          Value:    "1024",
+        },
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 116,
+        NameEnd: 126,
+        Name:    "SingerInfo",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 127,
+        Rparen:  136,
+        Name:    "BYTES",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 153,
+        NameEnd: 161,
+        Name:    "SingerId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.Singers (SingerId INT64 NOT NULL, FirstName STRING(1024), LastName STRING(1024), SingerInfo BYTES(MAX)) PRIMARY KEY (SingerId)
diff --git a/testdata/result/statement/named_schemas_create_table_foreign_key.sql.txt b/testdata/result/statement/named_schemas_create_table_foreign_key.sql.txt
new file mode 100644
index 0000000..47a97bb
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_table_foreign_key.sql.txt
@@ -0,0 +1,155 @@
+--- named_schemas_create_table_foreign_key.sql
+CREATE TABLE sch1.ShoppingCarts (
+  CartId INT64 NOT NULL,
+  CustomerId INT64 NOT NULL,
+  CustomerName STRING(MAX) NOT NULL,
+  CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY(CustomerId, CustomerName)
+    REFERENCES sch1.Customers(CustomerId, CustomerName) ON DELETE CASCADE,
+) PRIMARY KEY(CartId)
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      296,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 31,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 53,
+      Name: &ast.Ident{
+        NamePos: 36,
+        NameEnd: 42,
+        Name:    "CartId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 43,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 82,
+      Name: &ast.Ident{
+        NamePos: 61,
+        NameEnd: 71,
+        Name:    "CustomerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 72,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 119,
+      Name: &ast.Ident{
+        NamePos: 90,
+        NameEnd: 102,
+        Name:    "CustomerName",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 103,
+        Rparen:  113,
+        Name:    "STRING",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint{
+    &ast.TableConstraint{
+      ConstraintPos: 127,
+      Name:          &ast.Ident{
+        NamePos: 138,
+        NameEnd: 162,
+        Name:    "FKShoppingCartsCustomers",
+      },
+      Constraint: &ast.ForeignKey{
+        Foreign:     163,
+        Rparen:      255,
+        OnDeleteEnd: 274,
+        Columns:     []*ast.Ident{
+          &ast.Ident{
+            NamePos: 175,
+            NameEnd: 185,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 187,
+            NameEnd: 199,
+            Name:    "CustomerName",
+          },
+        },
+        ReferenceTable: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 216,
+              NameEnd: 220,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 221,
+              NameEnd: 230,
+              Name:    "Customers",
+            },
+          },
+        },
+        ReferenceColumns: []*ast.Ident{
+          &ast.Ident{
+            NamePos: 231,
+            NameEnd: 241,
+            Name:    "CustomerId",
+          },
+          &ast.Ident{
+            NamePos: 243,
+            NameEnd: 255,
+            Name:    "CustomerName",
+          },
+        },
+        OnDelete: "ON DELETE CASCADE",
+      },
+    },
+  },
+  PrimaryKeys: []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 290,
+        NameEnd: 296,
+        Name:    "CartId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms:          []*ast.Synonym(nil),
+  Cluster:           (*ast.Cluster)(nil),
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.ShoppingCarts (CartId INT64 NOT NULL, CustomerId INT64 NOT NULL, CustomerName STRING(MAX) NOT NULL, CONSTRAINT FKShoppingCartsCustomers FOREIGN KEY (CustomerId, CustomerName) REFERENCES sch1.Customers (CustomerId, CustomerName) ON DELETE CASCADE) PRIMARY KEY (CartId)
diff --git a/testdata/result/statement/named_schemas_create_table_interleave.sql.txt b/testdata/result/statement/named_schemas_create_table_interleave.sql.txt
new file mode 100644
index 0000000..2f909ec
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_table_interleave.sql.txt
@@ -0,0 +1,128 @@
+--- named_schemas_create_table_interleave.sql
+CREATE TABLE sch1.Albums (
+  SingerId INT64 NOT NULL,
+  AlbumId INT64 NOT NULL,
+  AlbumTitle STRING(MAX),
+) PRIMARY KEY(SingerId, AlbumId),
+  INTERLEAVE IN PARENT sch1.Singers ON DELETE CASCADE
+--- AST
+&ast.CreateTable{
+  Create:      0,
+  Rparen:      137,
+  IfNotExists: false,
+  Name:        &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 13,
+        NameEnd: 17,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 18,
+        NameEnd: 24,
+        Name:    "Albums",
+      },
+    },
+  },
+  Columns: []*ast.ColumnDef{
+    &ast.ColumnDef{
+      Null: 48,
+      Name: &ast.Ident{
+        NamePos: 29,
+        NameEnd: 37,
+        Name:    "SingerId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 38,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: 74,
+      Name: &ast.Ident{
+        NamePos: 56,
+        NameEnd: 63,
+        Name:    "AlbumId",
+      },
+      Type: &ast.ScalarSchemaType{
+        NamePos: 64,
+        Name:    "INT64",
+      },
+      NotNull:       true,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+    &ast.ColumnDef{
+      Null: -1,
+      Name: &ast.Ident{
+        NamePos: 82,
+        NameEnd: 92,
+        Name:    "AlbumTitle",
+      },
+      Type: &ast.SizedSchemaType{
+        NamePos: 93,
+        Rparen:  103,
+        Name:    "STRING",
+        Max:     true,
+        Size:    nil,
+      },
+      NotNull:       false,
+      DefaultExpr:   (*ast.ColumnDefaultExpr)(nil),
+      GeneratedExpr: (*ast.GeneratedColumnExpr)(nil),
+      Hidden:        -1,
+      Options:       (*ast.Options)(nil),
+    },
+  },
+  TableConstraints: []*ast.TableConstraint(nil),
+  PrimaryKeys:      []*ast.IndexKey{
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 120,
+        NameEnd: 128,
+        Name:    "SingerId",
+      },
+      Dir: "",
+    },
+    &ast.IndexKey{
+      DirPos: -1,
+      Name:   &ast.Ident{
+        NamePos: 130,
+        NameEnd: 137,
+        Name:    "AlbumId",
+      },
+      Dir: "",
+    },
+  },
+  Synonyms: []*ast.Synonym(nil),
+  Cluster:  &ast.Cluster{
+    Comma:       138,
+    OnDeleteEnd: 193,
+    TableName:   &ast.Path{
+      Idents: []*ast.Ident{
+        &ast.Ident{
+          NamePos: 163,
+          NameEnd: 167,
+          Name:    "sch1",
+        },
+        &ast.Ident{
+          NamePos: 168,
+          NameEnd: 175,
+          Name:    "Singers",
+        },
+      },
+    },
+    OnDelete: "ON DELETE CASCADE",
+  },
+  RowDeletionPolicy: (*ast.CreateRowDeletionPolicy)(nil),
+}
+
+--- SQL
+CREATE TABLE sch1.Albums (SingerId INT64 NOT NULL, AlbumId INT64 NOT NULL, AlbumTitle STRING(MAX)) PRIMARY KEY (SingerId, AlbumId), INTERLEAVE IN PARENT sch1.Singers ON DELETE CASCADE
diff --git a/testdata/result/statement/named_schemas_create_view.sql.txt b/testdata/result/statement/named_schemas_create_view.sql.txt
new file mode 100644
index 0000000..1961594
--- /dev/null
+++ b/testdata/result/statement/named_schemas_create_view.sql.txt
@@ -0,0 +1,142 @@
+--- named_schemas_create_view.sql
+CREATE VIEW sch1.SingerView SQL SECURITY INVOKER
+AS Select s.FirstName, s.LastName, s.SingerInfo
+   FROM sch1.Singers AS s WHERE s.SingerId = 123456
+--- AST
+&ast.CreateView{
+  Create: 0,
+  Name:   &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 12,
+        NameEnd: 16,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 17,
+        NameEnd: 27,
+        Name:    "SingerView",
+      },
+    },
+  },
+  OrReplace:    false,
+  SecurityType: "INVOKER",
+  Query:        &ast.Select{
+    Select:   52,
+    Distinct: false,
+    As:       nil,
+    Results:  []ast.SelectItem{
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 59,
+              NameEnd: 60,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 61,
+              NameEnd: 70,
+              Name:    "FirstName",
+            },
+          },
+        },
+      },
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 72,
+              NameEnd: 73,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 74,
+              NameEnd: 82,
+              Name:    "LastName",
+            },
+          },
+        },
+      },
+      &ast.ExprSelectItem{
+        Expr: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 84,
+              NameEnd: 85,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 86,
+              NameEnd: 96,
+              Name:    "SingerInfo",
+            },
+          },
+        },
+      },
+    },
+    From: &ast.From{
+      From:   100,
+      Source: &ast.PathTableExpr{
+        Path: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 105,
+              NameEnd: 109,
+              Name:    "sch1",
+            },
+            &ast.Ident{
+              NamePos: 110,
+              NameEnd: 117,
+              Name:    "Singers",
+            },
+          },
+        },
+        Hint: (*ast.Hint)(nil),
+        As:   &ast.AsAlias{
+          As:    118,
+          Alias: &ast.Ident{
+            NamePos: 121,
+            NameEnd: 122,
+            Name:    "s",
+          },
+        },
+        WithOffset: (*ast.WithOffset)(nil),
+        Sample:     (*ast.TableSample)(nil),
+      },
+    },
+    Where: &ast.Where{
+      Where: 123,
+      Expr:  &ast.BinaryExpr{
+        Op:   "=",
+        Left: &ast.Path{
+          Idents: []*ast.Ident{
+            &ast.Ident{
+              NamePos: 129,
+              NameEnd: 130,
+              Name:    "s",
+            },
+            &ast.Ident{
+              NamePos: 131,
+              NameEnd: 139,
+              Name:    "SingerId",
+            },
+          },
+        },
+        Right: &ast.IntLiteral{
+          ValuePos: 142,
+          ValueEnd: 148,
+          Base:     10,
+          Value:    "123456",
+        },
+      },
+    },
+    GroupBy: (*ast.GroupBy)(nil),
+    Having:  (*ast.Having)(nil),
+    OrderBy: (*ast.OrderBy)(nil),
+    Limit:   (*ast.Limit)(nil),
+  },
+}
+
+--- SQL
+CREATE VIEW sch1.SingerView SQL SECURITY INVOKER AS SELECT s.FirstName, s.LastName, s.SingerInfo FROM sch1.Singers AS s WHERE s.SingerId = 123456
diff --git a/testdata/result/statement/named_schemas_drop_index.sql.txt b/testdata/result/statement/named_schemas_drop_index.sql.txt
new file mode 100644
index 0000000..e39e22d
--- /dev/null
+++ b/testdata/result/statement/named_schemas_drop_index.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_index.sql
+DROP INDEX sch1.indexOnSingers
+--- AST
+&ast.DropIndex{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 15,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 30,
+        Name:    "indexOnSingers",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP INDEX sch1.indexOnSingers
diff --git a/testdata/result/statement/named_schemas_drop_sequence.sql.txt b/testdata/result/statement/named_schemas_drop_sequence.sql.txt
new file mode 100644
index 0000000..1714e94
--- /dev/null
+++ b/testdata/result/statement/named_schemas_drop_sequence.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_sequence.sql
+DROP SEQUENCE sch1.sequence
+--- AST
+&ast.DropSequence{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 14,
+        NameEnd: 18,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 19,
+        NameEnd: 27,
+        Name:    "sequence",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP SEQUENCE sch1.sequence
diff --git a/testdata/result/statement/named_schemas_drop_table.sql.txt b/testdata/result/statement/named_schemas_drop_table.sql.txt
new file mode 100644
index 0000000..f4a3fc7
--- /dev/null
+++ b/testdata/result/statement/named_schemas_drop_table.sql.txt
@@ -0,0 +1,24 @@
+--- named_schemas_drop_table.sql
+DROP TABLE sch1.ShoppingCarts
+--- AST
+&ast.DropTable{
+  Drop:     0,
+  IfExists: false,
+  Name:     &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 11,
+        NameEnd: 15,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 16,
+        NameEnd: 29,
+        Name:    "ShoppingCarts",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP TABLE sch1.ShoppingCarts
diff --git a/testdata/result/statement/named_schemas_drop_view.sql.txt b/testdata/result/statement/named_schemas_drop_view.sql.txt
new file mode 100644
index 0000000..0431f46
--- /dev/null
+++ b/testdata/result/statement/named_schemas_drop_view.sql.txt
@@ -0,0 +1,23 @@
+--- named_schemas_drop_view.sql
+DROP VIEW sch1.SingerView
+--- AST
+&ast.DropView{
+  Drop: 0,
+  Name: &ast.Path{
+    Idents: []*ast.Ident{
+      &ast.Ident{
+        NamePos: 10,
+        NameEnd: 14,
+        Name:    "sch1",
+      },
+      &ast.Ident{
+        NamePos: 15,
+        NameEnd: 25,
+        Name:    "SingerView",
+      },
+    },
+  },
+}
+
+--- SQL
+DROP VIEW sch1.SingerView