changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: rocksdb alien functions and cargo fmt

changeset 268: a52d42f30617
parent 267: f3d814fb136a
child 269: 87f503c7a365
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 06 Apr 2024 23:30:32 -0400
files: lisp/ffi/rocksdb/db.lisp lisp/ffi/rocksdb/types.lisp rust/app/cli/alik/graphql.rs rust/app/cli/alik/http.rs rust/app/cli/alik/lib.rs rust/app/cli/alik/main.rs rust/app/cli/alik/ping.rs rust/app/cli/alik/udp.rs rust/lib/audio/dsp/lib.rs rust/lib/ui/build.rs rust/lib/ui/main.rs rust/lib/ui/src/lib.rs
description: rocksdb alien functions and cargo fmt
     1.1--- a/lisp/ffi/rocksdb/db.lisp	Sat Apr 06 22:53:46 2024 -0400
     1.2+++ b/lisp/ffi/rocksdb/db.lisp	Sat Apr 06 23:30:32 2024 -0400
     1.3@@ -310,20 +310,95 @@
     1.4 (export '(rocksdb-backup-engine-close))
     1.5 
     1.6 ;;; Transactions
     1.7-(define-alien-routine rocksdb-transaction-begin (* rocksdb-transaction)
     1.8-  (wopts (* rocksdb-writeoptions))
     1.9-  (topts (* rocksdb-transaction-options))
    1.10-  (told (* rocksdb-transaction)))
    1.11+(def-with-errptr rocksdb-transactiondb-create-column-family (* rocksdb-column-family-handle)
    1.12+  (txn-db (* rocksdb-transactiondb))
    1.13+  (cf-options (* rocksdb-options))
    1.14+  (cf-name c-string))
    1.15 
    1.16 (def-with-errptr rocksdb-transactiondb-open (* rocksdb-transactiondb)
    1.17   (opts (* rocksdb-options))
    1.18   (topts (* rocksdb-transactiondb-options))
    1.19   (name c-string))
    1.20 
    1.21+(def-with-errptr rocksdb-transactiondb-open-column-families (* rocksdb-transactiondb)
    1.22+  (opts (* rocksdb-options))
    1.23+  (txn-db-opts (* rocksdb-transactiondb-options))
    1.24+  (name c-string)
    1.25+  (num-cfs int)
    1.26+  (cf-names (array c-string))
    1.27+  (cf-opfs (* rocksdb-options))
    1.28+  (cf-handles (array (* rocksdb-column-family-handle))))
    1.29+
    1.30+(define-alien-routine rocksdb-transactiondb-create-snapshot (* rocksdb-snapshot)
    1.31+  (txn-db (* rocksdb-transactiondb))
    1.32+  (snapshot (* rocksdb-snapshot)))
    1.33+
    1.34+(define-alien-routine rocksdb-transactiondb-release-snapshot void
    1.35+  (txn-db (* rocksdb-transactiondb))
    1.36+  (snapshot (* rocksdb-snapshot)))
    1.37+
    1.38+(define-alien-routine rocksdb-transactiondb-property-value c-string
    1.39+  (db (* rocksdb-transactiondb))
    1.40+  (propname c-string))
    1.41+
    1.42+(define-alien-routine rocksdb-transactiondb-property-int int
    1.43+  (db (* rocksdb-transactiondb))
    1.44+  (propname c-string)
    1.45+  (out-val (unsigned 64)))
    1.46+
    1.47+(define-alien-routine rocksdb-transactiondb-get-base-db (* rocksdb)
    1.48+  (txn-db (* rocksdb-transactiondb)))
    1.49+
    1.50+(define-alien-routine rocksdb-transactiondb-get-close-db void
    1.51+  (base-db (* rocksdb)))
    1.52+
    1.53+(define-alien-routine rocksdb-transaction-begin (* rocksdb-transaction)
    1.54+  (wopts (* rocksdb-writeoptions))
    1.55+  (topts (* rocksdb-transaction-options))
    1.56+  (told (* rocksdb-transaction)))
    1.57+
    1.58+(define-alien-routine rocksdb-transactiondb-get-prepared-transactions (array (* rocksdb-transaction))
    1.59+  (txn-db (* rocksdb-transactiondb))
    1.60+  (cnt (* size-t)))
    1.61+
    1.62+(def-with-errptr rocksdb-transaction-set-name void
    1.63+  (txn (* rocksdb-transaction))
    1.64+  (name c-string)
    1.65+  (name-len size-t))
    1.66+
    1.67+(define-alien-routine rocksdb-transaction-get-name c-string
    1.68+  (txn (* rocksdb-transaction))
    1.69+  (name-len (* size-t)))
    1.70+
    1.71+(def-with-errptr rocksdb-transaction-prepare void
    1.72+  (txn (* rocksdb-transaction)))
    1.73+
    1.74+(def-with-errptr rocksdb-transaction-commit void
    1.75+  (txn (* rocksdb-transaction)))
    1.76+
    1.77+(def-with-errptr rocksdb-transaction-rollback void
    1.78+  (txn (* rocksdb-transaction)))
    1.79+
    1.80+(define-alien-routine rocksdb-transaction-set-savepoint void
    1.81+  (txn (* rocksdb-transaction)))
    1.82+
    1.83+(def-with-errptr rocksdb-transaction-rollback-to-savepoint void
    1.84+  (txn (* rocksdb-transaction)))
    1.85+
    1.86+(define-alien-routine rocksdb-transaction-destroy void
    1.87+  (txn (* rocksdb-transaction)))
    1.88+
    1.89+(define-alien-routine rocksdb-transaction-get-writebach-wi (* rocksdb-writebatch-wi)
    1.90+  (txn (* rocksdb-transaction)))
    1.91+
    1.92 (define-alien-routine rocksdb-transactiondb-close void
    1.93   (tdb (* rocksdb-transactiondb)))
    1.94 
    1.95-(export '(rocksdb-transaction-begin rocksdb-transaction-close))
    1.96+(export '(rocksdb-transaction-begin rocksdb-transaction-close rocksdb-transactiondb-create-snapshot
    1.97+          rocksdb-transactiondb-release-snapshot rocksdb-transactiondb-property-value
    1.98+          rocksdb-transactiondb-property-int rocksdb-transactiondb-get-base-db
    1.99+          rocksdb-transactiondb-get-close-db rocksdb-transaction-get-name
   1.100+          rocksdb-transaction-set-savepoint rocksdb-transaction-destroy))
   1.101 
   1.102 ;;; Perfcontext
   1.103 (define-alien-routine rocksdb-set-perf-level void (val int))
     2.1--- a/lisp/ffi/rocksdb/types.lisp	Sat Apr 06 22:53:46 2024 -0400
     2.2+++ b/lisp/ffi/rocksdb/types.lisp	Sat Apr 06 23:30:32 2024 -0400
     2.3@@ -24,6 +24,7 @@
     2.4 (define-opaque rocksdb-snapshot)
     2.5 (define-opaque rocksdb-writeablefile)
     2.6 (define-opaque rocksdb-writebatch)
     2.7+(define-opaque rocksdb-writebatch-wi)
     2.8 (define-opaque rocksdb-livefiles)
     2.9 (define-opaque rocksdb-column-family-handle)
    2.10 (define-opaque rocksdb-column-family-metadata)
     3.1--- a/rust/app/cli/alik/graphql.rs	Sat Apr 06 22:53:46 2024 -0400
     3.2+++ b/rust/app/cli/alik/graphql.rs	Sat Apr 06 23:30:32 2024 -0400
     3.3@@ -2,11 +2,13 @@
     3.4 
     3.5 //
     3.6 
     3.7+use net::axum::{
     3.8+  response::{self, IntoResponse},
     3.9+  routing::get,
    3.10+  Router,
    3.11+};
    3.12 /// Code:
    3.13 use net::http::graphql::http::GraphiQLSource;
    3.14-use net::axum::response::{self, IntoResponse};
    3.15-use net::axum::Router;
    3.16-use net::axum::routing::get;
    3.17 use tokio::net::TcpListener;
    3.18 // use net::http::graphql::http::{EmptyMutation, EmptySubscription, Schema};
    3.19 // use net::http::graphql_axum::GraphQL;
     4.1--- a/rust/app/cli/alik/http.rs	Sat Apr 06 22:53:46 2024 -0400
     4.2+++ b/rust/app/cli/alik/http.rs	Sat Apr 06 23:30:32 2024 -0400
     4.3@@ -0,0 +1,1 @@
     4.4+
     5.1--- a/rust/app/cli/alik/lib.rs	Sat Apr 06 22:53:46 2024 -0400
     5.2+++ b/rust/app/cli/alik/lib.rs	Sat Apr 06 23:30:32 2024 -0400
     5.3@@ -4,14 +4,12 @@
     5.4 
     5.5 /// Code:
     5.6 pub mod graphql;
     5.7+pub mod http;
     5.8 pub mod ping;
     5.9-pub mod http;
    5.10 pub mod udp;
    5.11 
    5.12-use db::{Db, DbConfigExt, rocksdb};
    5.13+use db::{rocksdb, Db, DbConfigExt};
    5.14 use net::{
    5.15-  http::tower::trace::TraceLayer,
    5.16-  reqwest::Client,
    5.17   axum::{
    5.18     body::{Body, Bytes},
    5.19     extract::State,
    5.20@@ -20,15 +18,17 @@
    5.21     routing::get,
    5.22     Router,
    5.23   },
    5.24+  http::tower::trace::TraceLayer,
    5.25+  reqwest::Client,
    5.26 };
    5.27 
    5.28 use serde::{Deserialize, Serialize};
    5.29 
    5.30 use std::{
    5.31-  sync::Arc,
    5.32   collections::HashMap,
    5.33   fs,
    5.34   path::{Path, PathBuf},
    5.35+  sync::Arc,
    5.36 };
    5.37 
    5.38 pub use krypt::KryptConfig;
    5.39@@ -111,8 +111,8 @@
    5.40   fn db_init(&self) -> Result<rocksdb::DB, db::Error> {
    5.41     let path = self.config.db_path.as_ref();
    5.42     let opts = &self.config.db_opts;
    5.43-    info!("{:?}",opts);
    5.44-    rocksdb::DB::open(&rocksdb::Options::default(),path.unwrap()).unwrap();
    5.45+    info!("{:?}", opts);
    5.46+    rocksdb::DB::open(&rocksdb::Options::default(), path.unwrap()).unwrap();
    5.47     Ok(rocksdb::DB::open_default("").unwrap())
    5.48   }
    5.49   fn db_init_mut(&mut self) -> Result<(), db::Error> {
     6.1--- a/rust/app/cli/alik/main.rs	Sat Apr 06 22:53:46 2024 -0400
     6.2+++ b/rust/app/cli/alik/main.rs	Sat Apr 06 23:30:32 2024 -0400
     6.3@@ -81,8 +81,9 @@
     6.4         } else {
     6.5           let http_proxy =
     6.6             tokio::spawn(async move { start_http_proxy("127.0.0.1:0").await });
     6.7-          let graphiql =
     6.8-            tokio::spawn(async move { graphql::start_graphiql("127.0.0.1:0").await });
     6.9+          let graphiql = tokio::spawn(async move {
    6.10+            graphql::start_graphiql("127.0.0.1:0").await
    6.11+          });
    6.12 
    6.13           tokio::try_join!(graphiql, http_proxy)?;
    6.14           Ok(())
     7.1--- a/rust/app/cli/alik/ping.rs	Sat Apr 06 22:53:46 2024 -0400
     7.2+++ b/rust/app/cli/alik/ping.rs	Sat Apr 06 23:30:32 2024 -0400
     7.3@@ -3,4 +3,3 @@
     7.4 //
     7.5 
     7.6 // /// Code:
     7.7-
     8.1--- a/rust/app/cli/alik/udp.rs	Sat Apr 06 22:53:46 2024 -0400
     8.2+++ b/rust/app/cli/alik/udp.rs	Sat Apr 06 23:30:32 2024 -0400
     8.3@@ -0,0 +1,1 @@
     8.4+
     9.1--- a/rust/lib/audio/dsp/lib.rs	Sat Apr 06 22:53:46 2024 -0400
     9.2+++ b/rust/lib/audio/dsp/lib.rs	Sat Apr 06 23:30:32 2024 -0400
     9.3@@ -0,0 +1,1 @@
     9.4+
    10.1--- a/rust/lib/ui/build.rs	Sat Apr 06 22:53:46 2024 -0400
    10.2+++ b/rust/lib/ui/build.rs	Sat Apr 06 23:30:32 2024 -0400
    10.3@@ -1,7 +1,5 @@
    10.4 fn main() {
    10.5-  let cfg = slint_build::CompilerConfiguration::new().with_style("material-dark".into());
    10.6-  slint_build::compile_with_config(
    10.7-    "base.slint",
    10.8-    cfg
    10.9-  ).unwrap();
   10.10+  let cfg = slint_build::CompilerConfiguration::new()
   10.11+    .with_style("material-dark".into());
   10.12+  slint_build::compile_with_config("base.slint", cfg).unwrap();
   10.13 }
    11.1--- a/rust/lib/ui/main.rs	Sat Apr 06 22:53:46 2024 -0400
    11.2+++ b/rust/lib/ui/main.rs	Sat Apr 06 23:30:32 2024 -0400
    11.3@@ -1,5 +1,5 @@
    11.4 use ui::*;
    11.5 
    11.6-fn main () {
    11.7+fn main() {
    11.8   MainWindow::new().unwrap().run().unwrap();
    11.9 }
    12.1--- a/rust/lib/ui/src/lib.rs	Sat Apr 06 22:53:46 2024 -0400
    12.2+++ b/rust/lib/ui/src/lib.rs	Sat Apr 06 23:30:32 2024 -0400
    12.3@@ -1,2 +1,1 @@
    12.4 slint::include_modules!();
    12.5-