Skip to content

Commit 74fe060

Browse files
committed
refactor(server): rename sql flag to raw_sql
1 parent d40f424 commit 74fe060

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

crates/cli/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub struct ServerOptions {
336336
default_value_t = true,
337337
help = "Enable the SQL playground and query endpoint at /sql."
338338
)]
339-
pub sql_api_enabled: bool,
339+
pub raw_sql: bool,
340340

341341
/// Path to the SSL certificate file (.pem)
342342
#[arg(
@@ -368,7 +368,7 @@ impl Default for ServerOptions {
368368
http_addr: DEFAULT_HTTP_ADDR,
369369
http_port: DEFAULT_HTTP_PORT,
370370
http_cors_origins: None,
371-
sql_api_enabled: true,
371+
raw_sql: true,
372372
tls_cert_path: None,
373373
tls_key_path: None,
374374
mkcert: false,

crates/grpc/server/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ impl<P: Provider + Sync + Send + 'static> proto::world::world_server::World for
11831183
&self,
11841184
request: Request<proto::types::SqlQueryRequest>,
11851185
) -> Result<Response<proto::types::SqlQueryResponse>, Status> {
1186-
if !self._config.sql_api_enabled {
1186+
if !self._config.raw_sql {
11871187
return Err(Status::permission_denied("SQL endpoint is disabled."));
11881188
}
11891189

@@ -1231,7 +1231,7 @@ pub struct GrpcConfig {
12311231
pub http2_keepalive_interval: Duration,
12321232
pub http2_keepalive_timeout: Duration,
12331233
pub max_message_size: usize,
1234-
pub sql_api_enabled: bool,
1234+
pub raw_sql: bool,
12351235
}
12361236

12371237
impl Default for GrpcConfig {
@@ -1243,7 +1243,7 @@ impl Default for GrpcConfig {
12431243
http2_keepalive_interval: Duration::from_secs(30),
12441244
http2_keepalive_timeout: Duration::from_secs(10),
12451245
max_message_size: 16 * 1024 * 1024,
1246-
sql_api_enabled: true,
1246+
raw_sql: true,
12471247
}
12481248
}
12491249
}

crates/runner/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ impl Runner {
740740
self.args.grpc.http2_keepalive_timeout,
741741
),
742742
max_message_size: self.args.grpc.max_message_size,
743-
sql_api_enabled: self.args.server.sql_api_enabled,
743+
raw_sql: self.args.server.raw_sql,
744744
},
745745
Some(grpc_bind_addr),
746746
)
@@ -758,7 +758,7 @@ impl Runner {
758758
None,
759759
absolute_path.clone(),
760760
Arc::new(readonly_pool.clone()),
761-
self.args.server.sql_api_enabled,
761+
self.args.server.raw_sql,
762762
storage.clone(),
763763
provider.clone(),
764764
self.version_spec.clone(),
@@ -839,7 +839,7 @@ impl Runner {
839839
info!(target: LOG_TARGET, endpoint = %addr, protocol = %protocol, "Starting torii endpoint.");
840840
info!(target: LOG_TARGET, endpoint = %grpc_addr, "Serving gRPC endpoint.");
841841
info!(target: LOG_TARGET, endpoint = %gql_endpoint, "Serving Graphql playground.");
842-
if self.args.server.sql_api_enabled {
842+
if self.args.server.raw_sql {
843843
info!(target: LOG_TARGET, endpoint = %sql_endpoint, "Serving SQL playground.");
844844
} else {
845845
info!(target: LOG_TARGET, "SQL endpoint is disabled.");

crates/server/src/proxy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<P: Provider + Sync + Send + Debug + 'static> Proxy<P> {
167167
graphql_addr: Option<SocketAddr>,
168168
artifacts_dir: Utf8PathBuf,
169169
pool: Arc<SqlitePool>,
170-
sql_api_enabled: bool,
170+
raw_sql: bool,
171171
storage: Arc<S>,
172172
provider: P,
173173
version_spec: String,
@@ -186,7 +186,7 @@ impl<P: Provider + Sync + Send + Debug + 'static> Proxy<P> {
186186
Box::new(GrpcHandler::new(grpc_addr, grpc_proxy_client.clone())),
187187
Box::new(McpHandler::new(pool.clone())),
188188
Box::new(MetadataHandler::new(storage.clone(), provider)),
189-
Box::new(SqlHandler::new(pool.clone(), sql_api_enabled)),
189+
Box::new(SqlHandler::new(pool.clone(), raw_sql)),
190190
Box::new(StaticHandler::new(artifacts_dir, (*pool).clone())),
191191
];
192192

0 commit comments

Comments
 (0)