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

Function getOwners

console/src/api/materialize/expressionBuilders.ts:21–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19export { semverParseGte };
20
21export function getOwners() {
22 return queryBuilder.selectFrom("mz_roles as r").select((eb) => [
23 "r.id",
24 "r.name",
25 eb
26 .or([
27 sql<boolean>`(${hasSuperUserPrivileges()})`,
28 eb.fn<boolean>("has_role", [
29 sql.id("current_user"),
30 "r.oid",
31 sql.lit("USAGE"),
32 ]),
33 ])
34 .$castTo<boolean>()
35 .as("isOwner"),
36 ]);
37}
38
39// Note(SangJunBak): This is a helper function to convert an expression to a JSON array.
40// We need to explicitly type the output and cannot generically use the type of the

Callers 8

buildIsOwnerQueryFunction · 0.90
buildConnectionsQueryFunction · 0.90
buildSinkListQueryFunction · 0.90
buildSchemaDetailsQueryFunction · 0.90
buildSourceListQueryFunction · 0.90
buildSecretsListQueryFunction · 0.90
buildClustersQueryFunction · 0.90

Calls 4

hasSuperUserPrivilegesFunction · 0.85
selectMethod · 0.45
orMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected