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

Method shell

src/mz/src/sql_client.rs:131–145  ·  view source on GitHub ↗

Returns a sql shell command associated with this context

(&self, region_info: &RegionInfo, user: &str, cluster: Option<String>)

Source from the content-addressed store, hash-verified

129
130 /// Returns a sql shell command associated with this context
131 pub fn shell(&self, region_info: &RegionInfo, user: &str, cluster: Option<String>) -> Command {
132 // Feels ok to avoid stopping the executing if
133 // we can't configure the file.
134 // Worst case scenario timing will not be enabled.
135 let _ = self.configure_psqlrc();
136
137 let mut command = Command::new("psql");
138 command
139 .arg(self.build_psql_url(region_info, user, cluster).as_str())
140 .env("PGPASSWORD", &self.app_password.to_string())
141 .env("PGAPPNAME", PG_APPLICATION_NAME)
142 .env("PSQLRC", "~/.psqlrc-mz");
143
144 command
145 }
146
147 fn find<P>(&self, exe_name: P) -> Option<PathBuf>
148 where

Callers 2

runFunction · 0.80
createFunction · 0.80

Calls 4

configure_psqlrcMethod · 0.80
build_psql_urlMethod · 0.80
as_strMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected