MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / name

Method name

misc/python/materialize/optbench/sql.py:37–42  ·  view source on GitHub ↗

Extracts and returns the name of this query from a '-- name: {name}' comment. Returns 'anonymous' if the name is not set.

(self)

Source from the content-addressed store, hash-verified

35 return self.query
36
37 def name(self) -> str:
38 """Extracts and returns the name of this query from a '-- name: {name}' comment.
39 Returns 'anonymous' if the name is not set."""
40 p = r"-- name\: (?P<name>.+)"
41 m = re.search(p, self.query, re.MULTILINE)
42 return m.group("name") if m else "anonoymous"
43
44 def explain(self, timing: bool, dialect: Dialect = Dialect.MZ) -> str:
45 """Prepends 'EXPLAIN ...' to the query respecting the given dialect."""

Callers 2

waitMethod · 0.45
mz_procFunction · 0.45

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected