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

Function getMaterializeEndpoints

console/src/test/sql/mzcompose.ts:27–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27export async function getMaterializeEndpoints() {
28 // When running inside the Docker composition (via mzcompose), endpoints are
29 // passed as environment variables so we can reach services by hostname.
30 if (process.env.MZ_INTERNAL_SQL_HOST && process.env.MZ_INTERNAL_HTTP_HOST) {
31 return {
32 internalSql: {
33 host: process.env.MZ_INTERNAL_SQL_HOST,
34 port: parseInt(process.env.MZ_INTERNAL_SQL_PORT ?? "6877"),
35 },
36 internalHttp: {
37 host: process.env.MZ_INTERNAL_HTTP_HOST,
38 port: parseInt(process.env.MZ_INTERNAL_HTTP_PORT ?? "6878"),
39 },
40 };
41 }
42
43 // Fallback: resolve host-mapped ports via mzcompose (for local development).
44 const internalSql = await getMaterializeEndpoint(6877);
45 const internalHttp = await getMaterializeEndpoint(6878);
46
47 return { internalSql, internalHttp };
48}
49
50export const dedenterWithEscapeSpecialCharacters = dedent.withOptions({
51 escapeSpecialCharacters: true,

Callers 1

setupFunction · 0.90

Calls 2

parseIntFunction · 0.85
getMaterializeEndpointFunction · 0.85

Tested by

no test coverage detected