Skip to content

Commit

Permalink
SELECT got you down? Try JOIN today!
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Dec 6, 2023
1 parent 7e779a0 commit 9859e12
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use diesel::query_builder::{AstPass, Query, QueryFragment, QueryId};
use diesel::result::Error as DieselError;
use diesel::{
sql_types, BoolExpressionMethods, CombineDsl, ExpressionMethods, IntoSql,
NullableExpressionMethods, QueryDsl, RunQueryDsl, SelectableHelper,
JoinOnDsl, NullableExpressionMethods, QueryDsl, RunQueryDsl,
SelectableHelper,
};
use nexus_db_model::queries::virtual_provisioning_collection_update::{
all_collections, do_update, parent_silo, quotas, silo_provisioned,
Expand Down Expand Up @@ -272,12 +273,10 @@ impl Quotas {
Self {
query: Box::new(
dsl::silo_quotas
.filter(
dsl::silo_id.eq(parent_silo
.inner_join(
parent_silo
.query_source()
.select(parent_silo::id)
.single_value()
.assume_not_null()),
.on(dsl::silo_id.eq(parent_silo::id)),
)
.select((
dsl::silo_id,
Expand Down Expand Up @@ -306,12 +305,10 @@ impl SiloProvisioned {
Self {
query: Box::new(
dsl::virtual_provisioning_collection
.filter(
dsl::id.eq(parent_silo
.inner_join(
parent_silo
.query_source()
.select(parent_silo::id)
.single_value()
.assume_not_null()),
.on(dsl::id.eq(parent_silo::id)),
)
.select((
dsl::id,
Expand Down
41 changes: 41 additions & 0 deletions nexus/preprocessed_configs/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- This file was generated automatically.

This comment has been minimized.

Copy link
@bnaecker

bnaecker Dec 6, 2023

Collaborator

Ugh, this is unfortunate junk from some ClickHouse test not exiting cleanly. I believe the replicated tests don't quite clean themselves up, though I haven't looked into it in detail.

This comment has been minimized.

Copy link
@smklein

smklein Dec 6, 2023

Author Collaborator

Yeah, removed in a follow-up commit. But I've definitely accidentally committed this file a few times

This comment has been minimized.

Copy link
@smklein

smklein Dec 6, 2023

Author Collaborator

Yeah, removed in a follow-up commit. But I've definitely accidentally committed this file a few times

This comment has been minimized.

Copy link
@bnaecker

bnaecker Dec 6, 2023

Collaborator

Same, I made #4634 to track

Do not edit it: it is likely to be discarded and generated again before it's read next time.
Files used to generate this file:
config.xml -->

<!-- Config that is used when server is run without config file. --><clickhouse>
<logger>
<level>trace</level>
<console>true</console>
</logger>

<http_port>8123</http_port>
<tcp_port>9000</tcp_port>
<mysql_port>9004</mysql_port>

<path>./</path>

<mlock_executable>true</mlock_executable>

<users>
<default>
<password/>

<networks>
<ip>::/0</ip>
</networks>

<profile>default</profile>
<quota>default</quota>
<access_management>1</access_management>
</default>
</users>

<profiles>
<default/>
</profiles>

<quotas>
<default/>
</quotas>
</clickhouse>

0 comments on commit 9859e12

Please sign in to comment.