Skip to content

Commit 09828ee

Browse files
authored
Revert "[teams 1/5] Reset database (#3496)" (#3580)
# Description of Changes This reverts commit #3496. # API and ABI breaking changes Technically maybe yes? But definitely nothing is using the new code yet. # Expected complexity level and risk 1 # Testing CI only Co-authored-by: Zeke Foppa <[email protected]>
1 parent f5d3bcd commit 09828ee

File tree

10 files changed

+156
-344
lines changed

10 files changed

+156
-344
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cli/src/subcommands/publish.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::path::PathBuf;
88
use std::{env, fs};
99

1010
use crate::config::Config;
11-
use crate::util::{add_auth_header_opt, get_auth_header, unauth_error_context, AuthHeader, ResponseExt};
12-
use crate::util::{decode_identity, y_or_n};
11+
use crate::util::{add_auth_header_opt, get_auth_header, AuthHeader, ResponseExt};
12+
use crate::util::{decode_identity, unauth_error_context, y_or_n};
1313
use crate::{build, common_args};
1414

1515
pub fn cli() -> clap::Command {

crates/client-api/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ scopeguard.workspace = true
5353
serde_with.workspace = true
5454
async-stream.workspace = true
5555
humantime.workspace = true
56-
thiserror.workspace = true
5756

5857
[target.'cfg(not(target_env = "msvc"))'.dependencies]
5958
jemalloc_pprof.workspace = true

crates/client-api/src/lib.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::sync::Arc;
33

44
use async_trait::async_trait;
55
use axum::response::ErrorResponse;
6-
use bytes::Bytes;
76
use http::StatusCode;
87

98
use spacetimedb::client::ClientActorIndex;
@@ -163,7 +162,7 @@ pub struct DatabaseDef {
163162
/// The [`Identity`] the database shall have.
164163
pub database_identity: Identity,
165164
/// The compiled program of the database module.
166-
pub program_bytes: Bytes,
165+
pub program_bytes: Vec<u8>,
167166
/// The desired number of replicas the database shall have.
168167
///
169168
/// If `None`, the edition default is used.
@@ -172,14 +171,6 @@ pub struct DatabaseDef {
172171
pub host_type: HostType,
173172
}
174173

175-
/// Parameters for resetting a database via [`ControlStateDelegate::reset_database`].
176-
pub struct DatabaseResetDef {
177-
pub database_identity: Identity,
178-
pub program_bytes: Option<Bytes>,
179-
pub num_replicas: Option<NonZeroU8>,
180-
pub host_type: Option<HostType>,
181-
}
182-
183174
/// API of the SpacetimeDB control plane.
184175
///
185176
/// The trait is the composition of [`ControlStateReadAccess`] and
@@ -249,10 +240,6 @@ pub trait ControlStateWriteAccess: Send + Sync {
249240

250241
async fn delete_database(&self, caller_identity: &Identity, database_identity: &Identity) -> anyhow::Result<()>;
251242

252-
/// Remove all data from a database, and reset it according to the
253-
/// given [DatabaseResetDef].
254-
async fn reset_database(&self, caller_identity: &Identity, spec: DatabaseResetDef) -> anyhow::Result<()>;
255-
256243
// Energy
257244
async fn add_energy(&self, identity: &Identity, amount: EnergyQuanta) -> anyhow::Result<()>;
258245
async fn withdraw_energy(&self, identity: &Identity, amount: EnergyQuanta) -> anyhow::Result<()>;
@@ -352,10 +339,6 @@ impl<T: ControlStateWriteAccess + ?Sized> ControlStateWriteAccess for Arc<T> {
352339
(**self).delete_database(caller_identity, database_identity).await
353340
}
354341

355-
async fn reset_database(&self, caller_identity: &Identity, spec: DatabaseResetDef) -> anyhow::Result<()> {
356-
(**self).reset_database(caller_identity, spec).await
357-
}
358-
359342
async fn add_energy(&self, identity: &Identity, amount: EnergyQuanta) -> anyhow::Result<()> {
360343
(**self).add_energy(identity, amount).await
361344
}

0 commit comments

Comments
 (0)