Skip to content

Commit d9b9fb6

Browse files
authored
#114 collection / query cache (#285) - Bump to v0.31.0
* #114 WIP collection cache * #114 WIP collection cache working but slow * #114 try different approach * WIP tests passing, but sorting not working * WIP * Sorting one way works... * Fix sorting * mostly working * Move db tests to file * Move some utility functions * Cleanup * authorization tests * Add authorization tests, get them green * Cache invalidation test passing * Add test for delting, fix temp path gitignore * Refactor commit opts * Fix query index * Change TPF, fix test * Tests passing * Improve sorting * Bump to v0.31.0
1 parent 49f8663 commit d9b9fb6

37 files changed

+1668
-587
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
.env
33
trace-*.json
4+
.temp

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33
List of changes for this repo, including `atomic-cli`, `atomic-server` and `atomic-lib`.
44
By far most changes relate to `atomic-server`, so if not specified, assume the changes are relevant only for the server.
55

6-
## [v0.30.4] - 2021-01-15
6+
## [v0.31.0] - 2022-01-25
7+
8+
- Huge performance increase for queries! Added sortable index, big refactor #114
9+
- Added `store.query()` function with better query options, such as `starts_at` and `limit`. Under the hood, this powers `Collection`s,
10+
- `Resource.save` returns a `CommitResponse`.
11+
- Refactor `Commit.apply_opts`, structure options.
12+
- Remove the potentially confusing `commit.apply` method.
13+
- `store.tpf` now takes a `Value` instead of `String`.
14+
- Improved sorting logic. Still has some problems.
15+
16+
## [v0.30.4] - 2022-01-15
717

818
Run with `--rebuild-index` the first time, if you use an existing database.
919
Note that due to an issue in actix, I'm unable to publish the `atomic-server` crate at this moment.

Cargo.lock

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

cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ license = "MIT"
66
name = "atomic-cli"
77
readme = "README.md"
88
repository = "https://github.com/joepio/atomic-data-rust"
9-
version = "0.30.0"
9+
version = "0.31.0"
1010

1111
[dependencies]
12-
atomic_lib = {version = "0.30.0", path = "../lib", features = ["config", "rdf"]}
12+
atomic_lib = {version = "0.31.0", path = "../lib", features = ["config", "rdf"]}
1313
clap = "2.33.3"
1414
colored = "2.0.0"
1515
dirs = "3.0.1"

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Context<'_> {
3737
self.store.set_default_agent(Agent {
3838
subject: write_ctx.agent.clone(),
3939
private_key: Some(write_ctx.private_key.clone()),
40-
created_at: atomic_lib::datetime_helpers::now(),
40+
created_at: atomic_lib::utils::now(),
4141
name: None,
4242
public_key: generate_public_key(&write_ctx.private_key).public,
4343
});

lib/.DS_Store

0 Bytes
Binary file not shown.

lib/.tmp/db/conf

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

lib/.tmp/db/db

-90.1 KB
Binary file not shown.

lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "MIT"
66
name = "atomic_lib"
77
readme = "README.md"
88
repository = "https://github.com/joepio/atomic-data-rust"
9-
version = "0.30.4"
9+
version = "0.31.0"
1010

1111
[dependencies]
1212
base64 = "0.13.0"

lib/src/agents.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Agents are actors (such as users) that can edit content.
33
//! https://docs.atomicdata.dev/commits/concepts.html
44
5-
use crate::{datetime_helpers, errors::AtomicResult, urls, Resource, Storelike};
5+
use crate::{errors::AtomicResult, urls, Resource, Storelike};
66

77
#[derive(Clone, Debug)]
88
pub struct Agent {
@@ -60,7 +60,7 @@ impl Agent {
6060
public_key: keypair.public.clone(),
6161
subject: format!("{}/agents/{}", store.get_server_url(), keypair.public),
6262
name: name.map(|x| x.to_owned()),
63-
created_at: datetime_helpers::now(),
63+
created_at: crate::utils::now(),
6464
}
6565
}
6666

@@ -72,7 +72,7 @@ impl Agent {
7272
public_key: public_key.into(),
7373
subject: format!("{}/agents/{}", store.get_server_url(), public_key),
7474
name: None,
75-
created_at: datetime_helpers::now(),
75+
created_at: crate::utils::now(),
7676
})
7777
}
7878
}

0 commit comments

Comments
 (0)