Returns a sql shell command associated with this context
(&self, region_info: &RegionInfo, user: &str, cluster: Option<String>)
| 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 |
no test coverage detected