awesomeapp-dev/rust-desktop-app

Compile Error for SurrealDB

Closed this issue · 1 comments

I'm on linux and tried to follow your yt video

Error:
failed to verify the checksum of surrealdb v1.0.0-beta.9+20230402

Seems to be connected with this issue:
surrealdb/surrealdb#1850

I tried to use a newer version of surrealdb, but this leads to other compilation errors.
With SurrealDB v1.0:

==== Running runner: tauri_icons
Skip running runner 'tauri_icons' because Path 'src-tauri/icons/32x32.png' found.
==== Running runner: cargo_build
> executing: cargo build
   Compiling app v0.1.0 (/home/peschu/code/rs/test/awesome-app/src-tauri)
error[E0061]: this method takes 3 arguments but 4 arguments were supplied
   --> src/model/store/surreal_store.rs:39:22
    |
39  |         let ress = self.ds.execute(sql, &self.ses, Some(vars), true).await?;
    |                            ^^^^^^^                           ------
    |                                                              | |
    |                                                              | unexpected argument of type `bool`
    |                                                              help: remove the extra argument
    |
note: method defined here
   --> /home/peschu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/surrealdb-1.0.0/src/kvs/ds.rs:806:15
    |
806 |     pub async fn execute(
    |                  ^^^^^^^

error[E0061]: this method takes 3 arguments but 4 arguments were supplied
   --> src/model/store/surreal_store.rs:61:22
    |
61  |         let ress = self.ds.execute(sql, &self.ses, Some(vars), false).await?;
    |                            ^^^^^^^                           -------
    |                                                              | |
    |                                                              | unexpected argument of type `bool`
    |                                                              help: remove the extra argument
    |
note: method defined here
   --> /home/peschu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/surrealdb-1.0.0/src/kvs/ds.rs:806:15
    |
806 |     pub async fn execute(
    |                  ^^^^^^^

error[E0061]: this method takes 3 arguments but 4 arguments were supplied
   --> src/model/store/surreal_store.rs:89:22
    |
89  |         let ress = self.ds.execute(sql, &self.ses, Some(vars), true).await?;
    |                            ^^^^^^^                           ------
    |                                                              | |
    |                                                              | unexpected argument of type `bool`
    |                                                              help: remove the extra argument
    |
note: method defined here
   --> /home/peschu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/surrealdb-1.0.0/src/kvs/ds.rs:806:15
    |
806 |     pub async fn execute(
    |                  ^^^^^^^

error[E0061]: this method takes 3 arguments but 4 arguments were supplied
   --> src/model/store/surreal_store.rs:109:22
    |
109 |         let ress = self.ds.execute(sql, &self.ses, Some(vars), false).await?;
    |                            ^^^^^^^                           -------
    |                                                              | |
    |                                                              | unexpected argument of type `bool`
    |                                                              help: remove the extra argument
    |
note: method defined here
   --> /home/peschu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/surrealdb-1.0.0/src/kvs/ds.rs:806:15
    |
806 |     pub async fn execute(
    |                  ^^^^^^^

error[E0061]: this method takes 3 arguments but 4 arguments were supplied
   --> src/model/store/surreal_store.rs:129:22
    |
129 |         let ress = self.ds.execute(&sql, &self.ses, Some(vars), false).await?;
    |                            ^^^^^^^                            -------
    |                                                               | |
    |                                                               | unexpected argument of type `bool`
    |                                                               help: remove the extra argument
    |
note: method defined here
   --> /home/peschu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/surrealdb-1.0.0/src/kvs/ds.rs:806:15
    |
806 |     pub async fn execute(
    |                  ^^^^^^^

error[E0599]: no function or associated item named `for_db` found for struct `Session` in the current scope
  --> src/model/store/surreal_store.rs:30:22
   |
30 |         let ses = Session::for_db("appns", "appdb");
   |                            ^^^^^^ function or associated item not found in `Session`

error[E0599]: no variant or associated item named `False` found for enum `surrealdb::sql::Value` in the current scope
  --> src/model/store/try_froms.rs:41:11
   |
41 |             Value::False => Ok(false),
   |                    ^^^^^ variant or associated item not found in `Value`

error[E0599]: no variant or associated item named `True` found for enum `surrealdb::sql::Value` in the current scope
  --> src/model/store/try_froms.rs:42:11
   |
42 |             Value::True => Ok(true),
   |                    ^^^^ variant or associated item not found in `Value`

Some errors have detailed explanations: E0061, E0599.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `app` (bin "app") due to 8 previous errors

I was able to solve this by changing the src-tauri/Cargo.toml

#surrealdb = {version = "1.0.0-beta.9", default-features=false, features = ['kv-mem'] }
surrealdb = { git = "https://github.com/surrealdb/surrealdb.git", tag = "v1.0.0-beta.9", features = ['kv-mem']}