add: app data query cache option

This commit is contained in:
trisua 2025-08-17 14:52:29 -04:00
parent fdbc08912d
commit 8116307ba0
11 changed files with 100 additions and 49 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "tetratto-core"
description = "The core behind Tetratto"
version = "15.0.0"
version = "15.0.1"
edition = "2024"
authors.workspace = true
repository.workspace = true
@ -23,7 +23,7 @@ default = ["database", "types", "sdk"]
[dependencies]
pathbufd = "0.1.4"
serde = { version = "1.0.219", features = ["derive"] }
toml = "0.9.4"
toml = "0.9.5"
tetratto-shared = { version = "12.0.6", path = "../shared" }
tetratto-l10n = { version = "12.0.0", path = "../l10n" }
serde_json = "1.0.142"
@ -31,16 +31,16 @@ totp-rs = { version = "5.7.0", features = [
"qr",
"gen_secret",
], optional = true }
reqwest = { version = "0.12.22", features = [
reqwest = { version = "0.12.23", features = [
"json",
"multipart",
], optional = true }
bitflags = { version = "2.9.1", optional = true }
bitflags = { version = "2.9.2", optional = true }
async-recursion = { version = "1.1.1", optional = true }
md-5 = { version = "0.10.6", optional = true }
base16ct = { version = "0.2.0", features = ["alloc"], optional = true }
base64 = { version = "0.22.1", optional = true }
emojis = "0.7.1"
emojis = "0.7.2"
regex = "1.11.1"
oiseau = { version = "0.1.2", default-features = false, features = [
"postgres",

View file

@ -28,6 +28,7 @@ pub async fn main() {
.query(&SimplifiedQuery {
query: AppDataSelectQuery::KeyIs("rust_test".to_string()),
mode: AppDataSelectMode::One(0),
cache: false,
})
.await
.unwrap()
@ -49,6 +50,7 @@ pub async fn main() {
.query(&SimplifiedQuery {
query: AppDataSelectQuery::KeyIs("rust_test".to_string()),
mode: AppDataSelectMode::One(0),
cache: false,
})
.await
.unwrap()

View file

@ -32,6 +32,8 @@ pub enum DeveloperPassStorageQuota {
Tier2,
/// The app is limited to 100 MB.
Tier3,
/// The app is not limited.
Unlimited,
}
impl Default for DeveloperPassStorageQuota {
@ -46,6 +48,7 @@ impl DeveloperPassStorageQuota {
DeveloperPassStorageQuota::Tier1 => 26214400,
DeveloperPassStorageQuota::Tier2 => 52428800,
DeveloperPassStorageQuota::Tier3 => 104857600,
DeveloperPassStorageQuota::Unlimited => usize::MAX,
}
}
}

View file

@ -31,6 +31,7 @@ macro_rules! api_return_ok {
pub struct SimplifiedQuery {
pub query: AppDataSelectQuery,
pub mode: AppDataSelectMode,
pub cache: bool,
}
/// The data client is used to access an app's data storage capabilities.