Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
Fix/update interfaces (#94)
Browse files Browse the repository at this point in the history
* bump rust edition to 2021

Signed-off-by: stevelr <steve@cosmonic.com>

* bump sqldb interface to 0.8.0 for execute/Statement; added into() method for Statement

Signed-off-by: stevelr <steve@cosmonic.com>

* sqldb changed to patch bump 0.7.1

Signed-off-by: stevelr <steve@cosmonic.com>

Signed-off-by: stevelr <steve@cosmonic.com>
  • Loading branch information
stevelr authored Oct 4, 2022
1 parent f24afb0 commit b9aa48b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sqldb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async fn create_table(ctx: &Context) -> Result<(), SqlDbError> {
);"#,
TABLE_NAME
);
let _resp = db.execute(ctx, &sql).await?;
let _resp = db.execute(ctx, sql.into()).await?;
Ok(())
}
```
Expand Down
4 changes: 2 additions & 2 deletions sqldb/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmcloud-interface-sqldb"
version = "0.7.0"
version = "0.7.1"
description = "Interface for wasmCloud actors to connect to a relational database using the capability wasmcloud:sqldb"
repository = "https://github.com/wasmcloud/interfaces"
homepage = "https://github.com/wasmcloud/wasmcloud"
Expand All @@ -27,7 +27,7 @@ serde = { version = "1.0" , features = ["derive"] }
serde_json = "1.0"
serde_bytes = "0.11"
minicbor = { version = "0.17", features = ["derive", "std", "half"] }
wasmbus-rpc = "0.10.0"
wasmbus-rpc = "0.10.1"

[dev-dependencies]
base64 = "0.13"
Expand Down
11 changes: 11 additions & 0 deletions sqldb/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ impl From<RpcError> for SqlDbError {
SqlDbError::new("rpc", e.to_string())
}
}

/// Generates Statement from sql using default values for database (use current) and parameters (none)
impl From<String> for Statement {
fn from(sql: String) -> Statement {
Statement {
database: None,
parameters: None,
sql,
}
}
}
2 changes: 1 addition & 1 deletion tests/actor/builtins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "builtins-test-actor"
version = "0.2.1"
authors = [ "wasmcloud Team" ]
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down

0 comments on commit b9aa48b

Please sign in to comment.