MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / convertDropQuery

Method convertDropQuery

internal/engine/clickhouse/convert.go:912–942  ·  view source on GitHub ↗
(n *chast.DropQuery)

Source from the content-addressed store, hash-verified

910}
911
912func (c *cc) convertDropQuery(n *chast.DropQuery) ast.Node {
913 // Handle DROP TABLE
914 if n.Table != "" {
915 tableName := &ast.TableName{
916 Name: identifier(n.Table),
917 }
918 if n.Database != "" {
919 tableName.Schema = identifier(n.Database)
920 }
921 return &ast.DropTableStmt{
922 IfExists: n.IfExists,
923 Tables: []*ast.TableName{tableName},
924 }
925 }
926
927 // Handle DROP TABLE with multiple tables
928 if len(n.Tables) > 0 {
929 tables := make([]*ast.TableName, 0, len(n.Tables))
930 for _, t := range n.Tables {
931 tables = append(tables, parseTableName(t))
932 }
933 return &ast.DropTableStmt{
934 IfExists: n.IfExists,
935 Tables: tables,
936 }
937 }
938
939 // Handle DROP DATABASE - return TODO for now
940 // Handle DROP VIEW - return TODO for now
941 return &ast.TODO{}
942}
943
944func (c *cc) convertAlterQuery(n *chast.AlterQuery) ast.Node {
945 alt := &ast.AlterTableStmt{

Callers 1

convertMethod · 0.95

Calls 2

identifierFunction · 0.70
parseTableNameFunction · 0.70

Tested by

no test coverage detected