Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database #178

Merged
merged 98 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
5f8d4db
Add `nostr-sdk-db` crate
yukibtc Oct 11, 2023
441c9ae
db: add `event_id_already_seen` method
yukibtc Oct 12, 2023
46adec3
db: add `save_events` and rename `event_id_already_seen` and `save_ev…
yukibtc Oct 12, 2023
e211026
sdk: init integration of `NostrDatabase`
yukibtc Oct 12, 2023
9ba7b9f
ffi: remove `clear_already_seen_events` method
yukibtc Oct 12, 2023
ced3c67
sdk: save event in database if never seen before
yukibtc Oct 12, 2023
d2e478d
sdk: add `with_database` constructor to `RelayPool`
yukibtc Oct 16, 2023
24876c0
sdk: add `ClientBuilder`
yukibtc Oct 16, 2023
19cfd24
db: save events in `MemoryDatabase`
yukibtc Oct 17, 2023
7e44cc3
db: add `event_by_id` method
yukibtc Oct 17, 2023
22ad6d4
sdk: fix clippy
yukibtc Oct 17, 2023
019603a
sdk: add `database` method to `Client`
yukibtc Oct 17, 2023
f502a9a
db: improve `save_event` method
yukibtc Oct 17, 2023
4d9f52d
db: remove `save_events` method
yukibtc Oct 17, 2023
e7eb985
sdk: remove `RelayPoolMessage::BatchEvent`
yukibtc Oct 17, 2023
287cdfa
db: add `memory` example
yukibtc Oct 20, 2023
ebb84e5
db: add `wipe` method
yukibtc Oct 23, 2023
26163ec
db: allow to disable `events` store in `MemoryDatabase`
yukibtc Oct 23, 2023
d7d07e5
db: add `DatabaseOptions`
yukibtc Oct 23, 2023
625bcb8
db: add `negentropy_items` database
yukibtc Oct 23, 2023
65e6976
sdk: add `reconcile` method to `Client`
yukibtc Oct 23, 2023
3d49b84
db: update `negentropy_items` method for `MemoryDatabase`
yukibtc Oct 23, 2023
b1c386f
sdk: add `reconcile_with_items` method to `Client`
yukibtc Oct 23, 2023
2e7b06c
db: add `#![forbid(unsafe_code)]`
yukibtc Oct 24, 2023
81eaddc
nostr: add `to_bytes` method to `EventId`
yukibtc Oct 24, 2023
7baab9e
Init `nostr-sdk-fbs` crate
yukibtc Oct 24, 2023
d1feda4
fbs: add `FlatBufferUtils` trait
yukibtc Oct 24, 2023
b96cc70
Add `nostr` dep to `workspace`
yukibtc Oct 26, 2023
0796758
fbs: complete `Event` encoding/decoding
yukibtc Oct 26, 2023
a370fd5
fbs: add `index` schema
yukibtc Oct 27, 2023
31e1569
Init `nostr-sdk-rosckdb` crate
yukibtc Oct 27, 2023
5dedf03
Add `async-trait` to `workspace`
yukibtc Oct 27, 2023
b7ff933
rocksdb: fix `indexes_merge_operator` func
yukibtc Oct 28, 2023
941e753
rocksdb: add `query_single_filter` method
yukibtc Oct 28, 2023
a8a1364
db: init `DatabaseIndexes` struct
yukibtc Oct 28, 2023
220fd4c
nostr: add `build_tags_index` method to `Event`
yukibtc Oct 28, 2023
7c5b079
db: index event tags
yukibtc Oct 28, 2023
d5fbaa6
db: use `BTreeMap` for `created_at_index`
yukibtc Oct 29, 2023
8c7d787
db: add `MappingIdentifier`
yukibtc Oct 29, 2023
ce526b4
db: enable queriying of indexes by list of filter
yukibtc Oct 29, 2023
a3bbd60
rocksdb: remove not needed CFs
yukibtc Oct 29, 2023
babad78
Add `nostr-sdk-db` and `nostr-sdk-fbs` to `pre-push` script
yukibtc Oct 29, 2023
e4d365c
rocksdb: update example
yukibtc Oct 29, 2023
14edb87
db: improve indexes query
yukibtc Nov 3, 2023
c00032a
db: add Makefile
yukibtc Nov 3, 2023
b97a622
db: add `AuthorAndKindIndex`
yukibtc Nov 4, 2023
1e8f1ad
rocksdb: partially complete missing methods for `NostrDatabase` trait
yukibtc Nov 4, 2023
e9100a9
nostr: add `TagIndexes` struct
yukibtc Nov 5, 2023
2916703
nostr: add `expiration` method to `Event`
yukibtc Nov 5, 2023
0f8fa63
fbs: remove `index.fbs`
yukibtc Nov 5, 2023
37f5220
db: rework `DatabaseIndexes`
yukibtc Nov 5, 2023
631e73b
rocksdb: improve `build_indexes` performance
yukibtc Nov 5, 2023
96ea2fc
nostr: add `RawEvent`
yukibtc Nov 6, 2023
2488e4d
nostr: impl `Clone` for `TagIndexes`
yukibtc Nov 6, 2023
fbd0115
db: move `nostr-sdk-fbs` into `flatbuffers` module
yukibtc Nov 6, 2023
4de2649
db: add `profile` method to `NostrDatabase` trait
yukibtc Nov 6, 2023
497f7f4
db: fix `index_event` low performance
yukibtc Nov 6, 2023
61b2a23
db: add `count` method to `NostrDatabase`
yukibtc Nov 6, 2023
7cc5072
rocksdb: add `num_cpus` dep
yukibtc Nov 6, 2023
ef7a87f
db: add `event_seen_by` flatbuffers schema
yukibtc Nov 6, 2023
7fae603
rocksdb: complete `NostrDatabase` impl
yukibtc Nov 6, 2023
40beeae
db: remove `event_ids_seen` method from `NostrDatabase`
yukibtc Nov 6, 2023
0045e7d
db: add WASM support to `NostrDatabase` trait
yukibtc Nov 7, 2023
7a46df9
db: update `event_ids_by_filters` method output
yukibtc Nov 7, 2023
13f129f
db: fix clippy
yukibtc Nov 7, 2023
b3af561
Add `nostr-sdk-indexeddb` crate
yukibtc Nov 7, 2023
bdf339f
rocksdb: auto build indexes when opening store
yukibtc Nov 7, 2023
3272864
indexeddb: add webapp example
yukibtc Nov 7, 2023
859a55f
ci: add `nostr-sdk-indexeddb`
yukibtc Nov 7, 2023
0bdcf7a
Update README.md files
yukibtc Nov 7, 2023
f14ac47
indexeddb: update webapp's README.md
yukibtc Nov 7, 2023
0cb7ab0
Re-export `nostr` and `nostr-sdk-db` from `nostr-sdk-rocksdb` and `no…
yukibtc Nov 7, 2023
3e325b9
indexeddb: allow unknown lints
yukibtc Nov 7, 2023
0a206a7
db: allow `where-clauses-object-safety`
yukibtc Nov 7, 2023
499c781
sdk: update `database` method in `ClientBuilder`
yukibtc Nov 7, 2023
cbfd367
sdk: add `rocksdb` example
yukibtc Nov 7, 2023
f0d2cad
sdk: update README.md features
yukibtc Nov 7, 2023
26aadfe
sdk: add `NegentropyOptions`
yukibtc Nov 7, 2023
f64be69
database: rename `nostr-sdk-db` to `nostr-database`
yukibtc Nov 9, 2023
01c6bf7
database: add `NostrDatabaseExt` trait
yukibtc Nov 9, 2023
834e647
Update README.md files
yukibtc Nov 9, 2023
f3cd63e
Add `nostr-database` to workspace
yukibtc Nov 9, 2023
065ce2b
database: re-export `nostr` crate
yukibtc Nov 9, 2023
3bce5f5
Update email
yukibtc Nov 9, 2023
70d8941
database: add feature flags list
yukibtc Nov 9, 2023
f924467
ci: update build-args
yukibtc Nov 9, 2023
6c3c08d
Set MSRV per crate
yukibtc Nov 9, 2023
85a227e
sdk: allow `bidirectional` negentropy reconciliation
yukibtc Nov 10, 2023
62c406a
db: add `NostrDatabase::has_event_already_been_saved` method
yukibtc Nov 10, 2023
df062df
sdk: improve `handle_relay_message` method
yukibtc Nov 13, 2023
6fd9549
sdk: update `Realy::get_events_of` method
yukibtc Nov 13, 2023
ed714f2
database: update `event_id_seen` method
yukibtc Nov 13, 2023
d462939
database: add `EraseNostrDatabaseError` and `IntoNostrDatabase`
yukibtc Nov 13, 2023
cedbc96
Add `nostr-sqlite`
yukibtc Nov 13, 2023
85a989a
sqlite: fix `Expression tree is too large`
yukibtc Nov 13, 2023
db91337
sdk: add `sqlite` feature
yukibtc Nov 13, 2023
3437369
indexeddb: impl From<IndexedDBError> for DatabaseError
yukibtc Nov 13, 2023
776cc98
sqlite: fix clippy
yukibtc Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ buildargs=(
"-p nostr --no-default-features --features alloc"
"-p nostr --no-default-features --features alloc,all-nips"
"-p nostr --features blocking"
"-p nostr-database"
"-p nostr-sdk-net"
"-p nostr-sdk"
"-p nostr-sdk --no-default-features"
"-p nostr-sdk --features blocking"
"-p nostr-sdk --features sqlite"
#"-p nostr-sdk --features rocksdb"
"-p nostr-ffi"
"-p nostr-sdk-ffi"
)
Expand All @@ -23,6 +26,7 @@ for arg in "${buildargs[@]}"; do
done

buildargs=(
"-p nostr-sdk --features indexeddb --target wasm32-unknown-unknown"
"-p nostr-js --target wasm32-unknown-unknown"
"-p nostr-sdk-js --target wasm32-unknown-unknown"
)
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ jobs:
-p nostr --no-default-features --features alloc,
-p nostr --no-default-features --features "alloc all-nips",
-p nostr --features blocking,
-p nostr-database
-p nostr-sdk,
-p nostr-sdk --no-default-features,
-p nostr-sdk --features blocking,
-p nostr-sdk --features sqlite,
]
steps:
- name: Checkout
Expand All @@ -57,6 +59,40 @@ jobs:
- name: Clippy
run: cargo clippy ${{ matrix.build-args }} -- -D warnings

build-msrv-1660:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable # STABLE
- version: 1.66.0 # MSRV
build-args:
[
-p nostr-sdk --features rocksdb,
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-msrv-1.66.0-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Set profile
run: rustup set profile minimal && rustup component add clippy
- name: Build
run: cargo build ${{ matrix.build-args }}
- name: Tests
run: cargo test ${{ matrix.build-args }}
- name: Clippy
run: cargo clippy ${{ matrix.build-args }} -- -D warnings

build-wasm:
name: Build WASM
runs-on: ubuntu-latest
Expand All @@ -69,6 +105,7 @@ jobs:
[
-p nostr,
-p nostr-sdk,
-p nostr-sdk --features indexeddb,
-p nostr-js,
]
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
db/
.DS_Store
*.db
*.db-shm
Expand Down
Loading