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

Function run

src/mz/src/command/sql.rs:35–47  ·  view source on GitHub ↗

Creates an interactive SQL shell connection to the profile context environment. The SQL shell command is running `psql` behind the scenes.

(cx: &RegionContext, RunArgs { cluster, psql_args }: RunArgs)

Source from the content-addressed store, hash-verified

33/// Creates an interactive SQL shell connection to the profile context environment.
34/// The SQL shell command is running `psql` behind the scenes.
35pub async fn run(cx: &RegionContext, RunArgs { cluster, psql_args }: RunArgs) -> Result<(), Error> {
36 let sql_client = cx.sql_client();
37 let claims = cx.admin_client().claims().await?;
38 let region_info = cx.get_region_info().await?;
39 let user = claims.user()?;
40
41 let _error = sql_client
42 .shell(&region_info, user, cluster)
43 .args(psql_args)
44 .exec();
45
46 Ok(())
47}

Callers

nothing calls this directly

Calls 8

sql_clientMethod · 0.80
claimsMethod · 0.80
admin_clientMethod · 0.80
get_region_infoMethod · 0.80
execMethod · 0.80
shellMethod · 0.80
userMethod · 0.45
argsMethod · 0.45

Tested by

no test coverage detected