MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / isCreateTableDDL

Function isCreateTableDDL

statement.go:496–505  ·  view source on GitHub ↗
(ddl string, schema string, table string)

Source from the content-addressed store, hash-verified

494}
495
496func isCreateTableDDL(ddl string, schema string, table string) bool {
497 table = regexp.QuoteMeta(table)
498 var re string
499 if schema == "" {
500 re = fmt.Sprintf("(?i)^CREATE TABLE (%s|`%s`)\\s*\\(", table, table)
501 } else {
502 re = fmt.Sprintf("(?i)^CREATE TABLE (%s|`%s`)\\.(%s|`%s`)\\s*\\(", schema, schema, table, table)
503 }
504 return regexp.MustCompile(re).MatchString(ddl)
505}
506
507type ShowTablesStatement struct {
508 Schema string

Callers 2

ExecuteMethod · 0.85
TestIsCreateTableDDLFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsCreateTableDDLFunction · 0.68