From 9ba8c4989814d80ff1d90c6cac6929bc18b9b0c3 Mon Sep 17 00:00:00 2001 From: boneyard93501 <4523011+boneyard93501@users.noreply.github.com> Date: Sun, 13 Jun 2021 14:00:21 -0500 Subject: [PATCH] update to marine, marine-test, bump versions --- sqlite/Cargo.toml | 5 +++-- sqlite/build.sh | 11 ++++++----- sqlite/src/main.rs | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/sqlite/Cargo.toml b/sqlite/Cargo.toml index 615db8c..ff499e6 100644 --- a/sqlite/Cargo.toml +++ b/sqlite/Cargo.toml @@ -10,5 +10,6 @@ name = "sqlite_test" path = "src/main.rs" [dependencies] -fluence = "0.5.0" -fce-sqlite-connector = "0.2.0" +fluence = "0.6.9" +marine-sqlite-connector = "0.4.1" + diff --git a/sqlite/build.sh b/sqlite/build.sh index 59d63a8..76d931a 100755 --- a/sqlite/build.sh +++ b/sqlite/build.sh @@ -2,10 +2,11 @@ set -o errexit -o nounset -o pipefail # This script builds all subprojects and puts all created Wasm modules in one dir -cargo update -fce build --release +cargo update --aggressive +marine build --release -rm artifacts/* -cp ../../target/wasm32-wasi/release/sqlite_test.wasm artifacts/ -wget https://github.com/fluencelabs/sqlite/releases/download/v0.10.0_w/sqlite3.wasm +mkdir -p artifacts +rm -f artifacts/*.wasm +cp target/wasm32-wasi/release/sqlite_test.wasm artifacts/ +wget https://github.com/fluencelabs/sqlite/releases/download/v0.14.0_w/sqlite3.wasm mv sqlite3.wasm artifacts/ diff --git a/sqlite/src/main.rs b/sqlite/src/main.rs index 2e13782..db0cc51 100644 --- a/sqlite/src/main.rs +++ b/sqlite/src/main.rs @@ -14,19 +14,19 @@ * limitations under the License. */ -use fluence::fce; +use fluence::marine; use fluence::module_manifest; -use fce_sqlite_connector; -use fce_sqlite_connector::State; +use marine_sqlite_connector; +use marine_sqlite_connector::State; module_manifest!(); pub fn main() {} -#[fce] +#[marine] pub fn test1(age: i64) { - let connection = fce_sqlite_connector::open(":memory:").unwrap(); + let connection = marine_sqlite_connector::open(":memory:").unwrap(); connection .execute( @@ -50,11 +50,11 @@ pub fn test1(age: i64) { } } -#[fce] +#[marine] pub fn test2(age: i64) { - use fce_sqlite_connector::Value; + use marine_sqlite_connector::Value; - let connection = fce_sqlite_connector::open(":memory:").unwrap(); + let connection = marine_sqlite_connector::open(":memory:").unwrap(); connection .execute( @@ -85,10 +85,10 @@ pub fn test2(age: i64) { } } -#[fce] +#[marine] pub fn test3() { let db_path = "/tmp/users.sqlite"; - let connection = fce_sqlite_connector::open(db_path).expect("db should be opened"); + let connection = marine_sqlite_connector::open(db_path).expect("db should be opened"); connection .execute( @@ -100,7 +100,7 @@ pub fn test3() { ) .expect("table should be created successfully"); - let connection = fce_sqlite_connector::open(db_path).expect("db should be opened"); + let connection = marine_sqlite_connector::open(db_path).expect("db should be opened"); let cursor = connection.prepare("SELECT * FROM users").unwrap().cursor(); println!("table size is: {:?}", cursor.count());