()
| 19 | export { semverParseGte }; |
| 20 | |
| 21 | export 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 |
no test coverage detected