Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 4712916

Browse files
committed
Annihilate all unsued migrations and queries in the dal
This is it. Since merging the new engine onto main, we have kept around migrations and queries to help restore functionality in the system. We're now at a point where we can destroy the bulk of our old migrations and queries. You all served us well. Additional or noteworthy changes: - Move and rename all remaining queries to subdirectories based on which tables they reference - Remove dead code related to migrations and queries - Modify func-related and validation-related migrations to work since they are still used a hybrid fashion - Make FuncBinding methods private that can be made private - Fix "todo" for missing builtin workspace - Fix "get_diff" integration test final assertion Signed-off-by: Nick Gerace <nick@systeminit.com>
1 parent d283252 commit 4712916

120 files changed

Lines changed: 78 additions & 12321 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/dal/src/func/binding.rs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use tokio::sync::mpsc;
88
use veritech_client::{BeforeFunction, OutputStream, ResolverFunctionComponent};
99

1010
use super::FuncError;
11-
use crate::func::execution::FuncExecutionPk;
1211
use crate::{
1312
func::backend::FuncBackendError, impl_standard_model, pk, standard_model,
1413
standard_model_accessor, Func, FuncBackendKind, HistoryEventError, StandardModel,
@@ -145,28 +144,6 @@ impl FuncBinding {
145144
Ok(object)
146145
}
147146

148-
pub async fn create_with_existing_value(
149-
ctx: &DalContext,
150-
args: serde_json::Value,
151-
value: Option<serde_json::Value>,
152-
func_id: FuncId,
153-
) -> FuncBindingResult<(Self, FuncBindingReturnValue)> {
154-
let func = Func::get_by_id(ctx, func_id).await?;
155-
let func_binding = Self::new(ctx, args, func_id, func.backend_kind).await?;
156-
157-
let func_binding_return_value = FuncBindingReturnValue::new(
158-
ctx,
159-
value.clone(),
160-
value,
161-
func_id,
162-
*func_binding.id(),
163-
FuncExecutionPk::NONE,
164-
)
165-
.await?;
166-
167-
Ok((func_binding, func_binding_return_value))
168-
}
169-
170147
/// Runs [`Self::new()`] and executes.
171148
///
172149
/// Use this function if you would like to receive the
@@ -191,7 +168,8 @@ impl FuncBinding {
191168
standard_model_accessor!(backend_kind, Enum(FuncBackendKind), FuncBindingResult);
192169
standard_model_accessor!(code_blake3, String, FuncBindingResult);
193170
standard_model_accessor!(func_id, Pk(FuncId), FuncBindingResult);
194-
// For a given [`FuncBinding`](Self), execute using veritech.
171+
172+
/// Execute using veritech.
195173
async fn execute(
196174
&self,
197175
ctx: &DalContext,
@@ -213,7 +191,7 @@ impl FuncBinding {
213191

214192
/// Perform function execution to veritech for a given [`Func`](crate::Func) and
215193
/// [`FuncDispatchContext`](crate::func::backend::FuncDispatchContext).
216-
pub async fn execute_critical_section(
194+
async fn execute_critical_section(
217195
&self,
218196
func: Func,
219197
context: FuncDispatchContext,
@@ -290,7 +268,7 @@ impl FuncBinding {
290268
}
291269
}
292270

293-
pub async fn postprocess_execution(
271+
async fn postprocess_execution(
294272
&self,
295273
ctx: &DalContext,
296274
output_stream: Vec<OutputStream>,
@@ -323,7 +301,7 @@ impl FuncBinding {
323301
Ok(func_binding_return_value)
324302
}
325303

326-
pub async fn prepare_execution(
304+
async fn prepare_execution(
327305
&self,
328306
ctx: &DalContext,
329307
) -> FuncBindingResult<(

lib/dal/src/installed_pkg/asset.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ use strum::{AsRefStr, Display, EnumIter, EnumString};
1111
const LIST_FOR_KIND_AND_HASH: &str =
1212
include_str!("../queries/installed_pkg/list_asset_for_kind_and_hash.sql");
1313

14-
const LIST_FOR_INSTALLED_PKG_ID: &str =
15-
include_str!("../queries/installed_pkg/list_asset_for_installed_pkg_id.sql");
16-
1714
pk!(InstalledPkgAssetPk);
1815
pk!(InstalledPkgAssetId);
1916
pk!(InstalledPkgAssetAssetId);
@@ -346,23 +343,6 @@ impl InstalledPkgAsset {
346343
}
347344
}
348345

349-
pub async fn list_for_installed_pkg_id(
350-
ctx: &DalContext,
351-
installed_pkg_id: InstalledPkgId,
352-
) -> InstalledPkgResult<Vec<Self>> {
353-
let rows = ctx
354-
.txns()
355-
.await?
356-
.pg()
357-
.query(
358-
LIST_FOR_INSTALLED_PKG_ID,
359-
&[ctx.tenancy(), ctx.visibility(), &installed_pkg_id],
360-
)
361-
.await?;
362-
363-
Ok(standard_model::objects_from_rows(rows)?)
364-
}
365-
366346
pub async fn list_for_kind_and_hash(
367347
ctx: &DalContext,
368348
kind: InstalledPkgAssetKind,

lib/dal/src/key_pair.rs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use crate::{
1717

1818
mod key_pair_box_public_key_serde;
1919

20-
const PUBLIC_KEY_GET_CURRENT: &str = include_str!("./queries/public_key_get_current.sql");
21-
const KEY_PAIR_GET_BY_PK: &str = include_str!("queries/key_pair_get_by_pk.sql");
20+
const GET_BY_PK: &str = include_str!("queries/key_pair/get_by_pk.sql");
21+
const PUBLIC_KEY_GET_CURRENT: &str = include_str!("./queries/key_pair/public_key_get_current.sql");
2222

2323
#[remain::sorted]
2424
#[derive(Error, Debug)]
@@ -107,26 +107,7 @@ impl KeyPair {
107107
}
108108

109109
pub async fn get_by_pk(ctx: &DalContext, pk: KeyPairPk) -> KeyPairResult<Self> {
110-
let row = ctx
111-
.txns()
112-
.await?
113-
.pg()
114-
.query_one(KEY_PAIR_GET_BY_PK, &[&pk])
115-
.await?;
116-
let json: serde_json::Value = row.try_get("object")?;
117-
let key_pair_row: KeyPairRow = serde_json::from_value(json)?;
118-
let key_pair = key_pair_row.decrypt_into(ctx.symmetric_crypto_service())?;
119-
Ok(key_pair)
120-
}
121-
122-
pub async fn get_current(ctx: &DalContext) -> KeyPairResult<Self> {
123-
let row = ctx
124-
.txns()
125-
.await?
126-
.pg()
127-
.query_one(PUBLIC_KEY_GET_CURRENT, &[&ctx.tenancy().workspace_pk()])
128-
.await?;
129-
110+
let row = ctx.txns().await?.pg().query_one(GET_BY_PK, &[&pk]).await?;
130111
let json: serde_json::Value = row.try_get("object")?;
131112
let key_pair_row: KeyPairRow = serde_json::from_value(json)?;
132113
let key_pair = key_pair_row.decrypt_into(ctx.symmetric_crypto_service())?;

lib/dal/src/migrations/U0031__schema.sql

Lines changed: 0 additions & 53 deletions
This file was deleted.

lib/dal/src/migrations/U0032__schema_ui_menus.sql

Lines changed: 0 additions & 53 deletions
This file was deleted.

lib/dal/src/migrations/U0033__schema_variants.sql

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib/dal/src/migrations/U0034__sockets.sql

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)