MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / getTableName

Function getTableName

IceFireDB-SQLite/internal/sqlite/db.go:183–196  ·  view source on GitHub ↗
(sql string)

Source from the content-addressed store, hash-verified

181}
182
183func getTableName(sql string) string {
184 s := strings.ToLower(sql)
185
186 fromIndex := strings.Index(s, "from")
187 if fromIndex == -1 {
188 return ""
189 }
190 behindSQL := strings.Trim(s[fromIndex+4:], " \t")
191 spaceIndex := strings.Index(behindSQL, " ")
192 if spaceIndex == -1 {
193 return behindSQL
194 }
195 return behindSQL[:spaceIndex]
196}
197
198func getColumnTypeAndLen(columnType string) (byte, uint32) {
199 index := strings.Index(columnType, "(")

Callers 2

ExecFunction · 0.85
TestGetTableFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetTableFunction · 0.68