Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cljoly/9075379b8b3133839be2e1c9d055b45a to your computer and use it in GitHub Desktop.
Save cljoly/9075379b8b3133839be2e1c9d055b45a to your computer and use it in GitHub Desktop.
tokio-rusqlite-new-0.8 diff
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/Cargo.toml .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/Cargo.toml
15c15
< version = "0.7.0"
---
> version = "0.8.0"
41a42,44
> [features]
> bundled = ["rusqlite/bundled"]
>
53a57,60
> [[test]]
> name = "tests"
> path = "tests/tests.rs"
>
58c65
< version = "~0.33"
---
> version = "~0.34"
65c72
< version = "~0.33"
---
> version = "~0.34"
70,73c77,80
< features = ["full"]
<
< [features]
< bundled = ["rusqlite/bundled"]
---
> features = [
> "rt-multi-thread",
> "macros",
> ]
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/Cargo.toml.orig .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/Cargo.toml.orig
3c3
< version = "0.7.0"
---
> version = "0.8.0"
18c18
< rusqlite = "~0.33"
---
> rusqlite = "~0.34"
22,23c22,26
< rusqlite = { version = "~0.33", features = ["bundled"] }
< tokio = { version = "^1.43", features = ["full"] }
---
> rusqlite = { version = "~0.34", features = ["bundled"] }
> tokio = { version = "^1.43", features = ["rt-multi-thread", "macros"] }
>
> [[test]]
> name = "tests"
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/.cargo_vcs_info.json .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/.cargo_vcs_info.json
3c3
< "sha1": "4fe5adffbf51acd1abd0ae1af0e3b5b61b74be60"
---
> "sha1": "fc2779b3e3c505efbf224537e68313eaa816ef20"
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/CHANGELOG.md .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/CHANGELOG.md
10a11,15
> # 0.8.0 (6 Mar 2025)
>
> - **updated:** To latest [rusqlite] version (`0.34`).
> - **updated:** Refactor `Error` mainly by https://github.com/programatik29/tokio-rusqlite/pull/39.
>
Common subdirectories: .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/examples and .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/examples
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/.gitignore .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/.gitignore
7a8
> !/tests
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/README.md .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/README.md
1,3c1
< [![License](https://img.shields.io/crates/l/tokio-rusqlite)](https://choosealicense.com/licenses/mit/)
< [![Crates.io](https://img.shields.io/crates/v/tokio-rusqlite)](https://crates.io/crates/tokio-rusqlite)
< [![Docs - Stable](https://img.shields.io/crates/v/tokio-rusqlite?color=blue&label=docs)](https://docs.rs/tokio-rusqlite/)
---
> # Tokio-Rusqlite-New
5c3,9
< # tokio-rusqlite-new
---
> [![Crate](https://img.shields.io/crates/v/tokio-rusqlite-new.svg)](https://crates.io/crates/tokio-rusqlite-new)
> [![GitHub last commit](https://img.shields.io/github/last-commit/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/commits/master)
> [![GitHub issues](https://img.shields.io/github/issues-raw/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/issues)
> [![GitHub pull requests](https://img.shields.io/github/issues-pr/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/pulls)
> [![GitHub](https://img.shields.io/github/license/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/blob/master/LICENSE)
>
> ## Description
11c15,31
< # Usage
---
> ## Guide
>
> This library provides [`Connection`] struct.
> The [`Connection`] struct is a handle to call functions in background thread and can be cloned cheaply.
> [`Connection::call`] method calls provided function in the background thread and returns its result asynchronously.
>
> [`Connection`]: https://docs.rs/tokio-rusqlite-new/latest/tokio_rusqlite_new/struct.Connection.html
> [`Connection::call`]: https://docs.rs/tokio-rusqlite-new/latest/tokio_rusqlite_new/struct.Connection.html#method.call
>
> ## Design
>
> A thread is spawned for each opened connection handle. When `call` method
> is called: provided function is boxed, sent to the thread through mpsc
> channel and executed. Return value is then sent by oneshot channel from
> the thread and then returned from function.
>
> ## Usage
14c34,35
< use tokio_rusqlite::{params, Connection, Result};
---
> use rusqlite::params;
> use tokio_rusqlite_new::{Connection, Result};
27,36c48,56
< let people = conn
< .call(|conn| {
< conn.execute(
< "CREATE TABLE person (
< id INTEGER PRIMARY KEY,
< name TEXT NOT NULL,
< data BLOB
< )",
< [],
< )?;
---
> let people = conn.call(|conn| {
> conn.execute(
> "CREATE TABLE person (
> id INTEGER PRIMARY KEY,
> name TEXT NOT NULL,
> data BLOB
> )",
> [],
> )?;
38,43c58,62
< let steven =
< Person {
< id: 1,
< name: "Steven".to_string(),
< data: None,
< };
---
> let steven = Person {
> id: 1,
> name: "Steven".to_string(),
> data: None,
> };
45,48c64,67
< conn.execute(
< "INSERT INTO person (name, data) VALUES (?1, ?2)",
< params![steven.name, steven.data],
< )?;
---
> conn.execute(
> "INSERT INTO person (id, name, data) VALUES (?1, ?2, ?3)",
> params![steven.id, steven.name, steven.data],
> )?;
50,59c69,78
< let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
< let people = stmt
< .query_map([], |row| {
< Ok(Person {
< id: row.get(0)?,
< name: row.get(1)?,
< data: row.get(2)?,
< })
< })?
< .collect::<std::result::Result<Vec<Person>, rusqlite::Error>>()?;
---
> let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
> let people = stmt
> .query_map([], |row| {
> Ok(Person {
> id: row.get(0)?,
> name: row.get(1)?,
> data: row.get(2)?,
> })
> })?
> .collect::<Result<Vec<Person>, rusqlite::Error>>()?;
61,63c80,82
< Ok(people)
< })
< .await?;
---
> Ok(people)
> })
> .await?;
74c93
< # Safety
---
> ## Safety
78c97
< # License
---
> ## License
Common subdirectories: .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rusqlite-new-0.7.0/src and .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/src
Only in .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/: tests
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/Cargo.toml .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/Cargo.toml
14,15c14,15
< name = "tokio-rusqlite"
< version = "0.6.0"
---
> name = "tokio-rusqlite-new"
> version = "0.8.0"
16a17
> "xuxiaocheng <[email protected]>",
20a22
> autolib = false
26,27c28
< homepage = "https://github.com/programatik29/tokio-rusqlite"
< documentation = "https://docs.rs/tokio-rusqlite"
---
> documentation = "https://docs.rs/tokio-rusqlite-new"
39c40,43
< repository = "https://github.com/programatik29/tokio-rusqlite"
---
> repository = "https://github.com/xuxiaocheng0201/tokio-rusqlite"
>
> [features]
> bundled = ["rusqlite/bundled"]
42c46
< name = "tokio_rusqlite"
---
> name = "tokio_rusqlite_new"
52a57,60
> [[test]]
> name = "tests"
> path = "tests/tests.rs"
>
54c62
< version = "0.5"
---
> version = "~0.5"
57c65
< version = "0.32"
---
> version = "~0.34"
60c68
< version = "1"
---
> version = "^1.43"
64c72
< version = "0.32"
---
> version = "~0.34"
68,72c76,80
< version = "1"
< features = ["full"]
<
< [features]
< bundled = ["rusqlite/bundled"]
---
> version = "^1.43"
> features = [
> "rt-multi-thread",
> "macros",
> ]
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/Cargo.toml.orig .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/Cargo.toml.orig
2,4c2,4
< name = "tokio-rusqlite"
< version = "0.6.0"
< authors = ["Programatik <[email protected]>", "Adi Salimgereev <[email protected]>"]
---
> name = "tokio-rusqlite-new"
> version = "0.8.0"
> authors = ["xuxiaocheng <[email protected]>", "Programatik <[email protected]>", "Adi Salimgereev <[email protected]>"]
7,9c7,8
< documentation = "https://docs.rs/tokio-rusqlite"
< homepage = "https://github.com/programatik29/tokio-rusqlite"
< repository = "https://github.com/programatik29/tokio-rusqlite"
---
> documentation = "https://docs.rs/tokio-rusqlite-new"
> repository = "https://github.com/xuxiaocheng0201/tokio-rusqlite"
18,20c17,19
< crossbeam-channel = "0.5"
< rusqlite = "0.32"
< tokio = { version = "1", features = ["sync"] }
---
> crossbeam-channel = "~0.5"
> rusqlite = "~0.34"
> tokio = { version = "^1.43", features = ["sync"] }
23,24c22,26
< rusqlite = { version = "0.32", features = ["bundled"] }
< tokio = { version = "1", features = ["full"] }
---
> rusqlite = { version = "~0.34", features = ["bundled"] }
> tokio = { version = "^1.43", features = ["rt-multi-thread", "macros"] }
>
> [[test]]
> name = "tests"
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/.cargo_vcs_info.json .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/.cargo_vcs_info.json
3c3
< "sha1": "168e9c47fd6c7c9f8032b660f62084e16ade7bac"
---
> "sha1": "fc2779b3e3c505efbf224537e68313eaa816ef20"
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/CHANGELOG.md .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/CHANGELOG.md
10a11,19
> # 0.8.0 (6 Mar 2025)
>
> - **updated:** To latest [rusqlite] version (`0.34`).
> - **updated:** Refactor `Error` mainly by https://github.com/programatik29/tokio-rusqlite/pull/39.
>
> # 0.7.0 (7 Feb 2025)
>
> - **updated:** To latest [rusqlite] version (`0.33`).
>
Common subdirectories: .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/examples and .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/examples
Only in .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/: .github
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/.gitignore .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/.gitignore
1,2c1,13
< /target
< /Cargo.lock
---
> /*
>
> !/.gitignore
> !/Cargo.toml
> !/Cargo.lock
>
> !/src
> !/tests
> !/examples
>
> !/README.md
> !/CHANGELOG.md
> !/LICENSE
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/LICENSE .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/LICENSE
0a1,2
> MIT License
>
1a4
> Copyright (c) 2025 xuxiaocheng0201
diff '--color=auto' -x Cargo.lock -d .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/README.md .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/README.md
1,3c1
< [![License](https://img.shields.io/crates/l/tokio-rusqlite)](https://choosealicense.com/licenses/mit/)
< [![Crates.io](https://img.shields.io/crates/v/tokio-rusqlite)](https://crates.io/crates/tokio-rusqlite)
< [![Docs - Stable](https://img.shields.io/crates/v/tokio-rusqlite?color=blue&label=docs)](https://docs.rs/tokio-rusqlite/)
---
> # Tokio-Rusqlite-New
5c3,9
< # tokio-rusqlite
---
> [![Crate](https://img.shields.io/crates/v/tokio-rusqlite-new.svg)](https://crates.io/crates/tokio-rusqlite-new)
> [![GitHub last commit](https://img.shields.io/github/last-commit/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/commits/master)
> [![GitHub issues](https://img.shields.io/github/issues-raw/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/issues)
> [![GitHub pull requests](https://img.shields.io/github/issues-pr/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/pulls)
> [![GitHub](https://img.shields.io/github/license/xuxiaocheng0201/tokio-rusqlite)](https://github.com/xuxiaocheng0201/tokio-rusqlite/blob/master/LICENSE)
>
> ## Description
9c13,31
< # Usage
---
> This is a fork of [tokio-rusqlite](https://github.com/programatik29/tokio-rusqlite).
>
> ## Guide
>
> This library provides [`Connection`] struct.
> The [`Connection`] struct is a handle to call functions in background thread and can be cloned cheaply.
> [`Connection::call`] method calls provided function in the background thread and returns its result asynchronously.
>
> [`Connection`]: https://docs.rs/tokio-rusqlite-new/latest/tokio_rusqlite_new/struct.Connection.html
> [`Connection::call`]: https://docs.rs/tokio-rusqlite-new/latest/tokio_rusqlite_new/struct.Connection.html#method.call
>
> ## Design
>
> A thread is spawned for each opened connection handle. When `call` method
> is called: provided function is boxed, sent to the thread through mpsc
> channel and executed. Return value is then sent by oneshot channel from
> the thread and then returned from function.
>
> ## Usage
12c34,35
< use tokio_rusqlite::{params, Connection, Result};
---
> use rusqlite::params;
> use tokio_rusqlite_new::{Connection, Result};
25,34c48,56
< let people = conn
< .call(|conn| {
< conn.execute(
< "CREATE TABLE person (
< id INTEGER PRIMARY KEY,
< name TEXT NOT NULL,
< data BLOB
< )",
< [],
< )?;
---
> let people = conn.call(|conn| {
> conn.execute(
> "CREATE TABLE person (
> id INTEGER PRIMARY KEY,
> name TEXT NOT NULL,
> data BLOB
> )",
> [],
> )?;
36,41c58,62
< let steven =
< Person {
< id: 1,
< name: "Steven".to_string(),
< data: None,
< };
---
> let steven = Person {
> id: 1,
> name: "Steven".to_string(),
> data: None,
> };
43,46c64,67
< conn.execute(
< "INSERT INTO person (name, data) VALUES (?1, ?2)",
< params![steven.name, steven.data],
< )?;
---
> conn.execute(
> "INSERT INTO person (id, name, data) VALUES (?1, ?2, ?3)",
> params![steven.id, steven.name, steven.data],
> )?;
48,57c69,78
< let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
< let people = stmt
< .query_map([], |row| {
< Ok(Person {
< id: row.get(0)?,
< name: row.get(1)?,
< data: row.get(2)?,
< })
< })?
< .collect::<std::result::Result<Vec<Person>, rusqlite::Error>>()?;
---
> let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
> let people = stmt
> .query_map([], |row| {
> Ok(Person {
> id: row.get(0)?,
> name: row.get(1)?,
> data: row.get(2)?,
> })
> })?
> .collect::<Result<Vec<Person>, rusqlite::Error>>()?;
59,61c80,82
< Ok(people)
< })
< .await?;
---
> Ok(people)
> })
> .await?;
72c93
< # Safety
---
> ## Safety
76c97
< # License
---
> ## License
Common subdirectories: .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-0.6.0/src and .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/src
Only in .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-rusqlite-new-0.8.0/: tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment