File tree Expand file tree Collapse file tree 4 files changed +37
-37
lines changed Expand file tree Collapse file tree 4 files changed +37
-37
lines changed Original file line number Diff line number Diff line change 11//! MQTT message publishing.
2- //!
2+ //!
33//! To receive MQTT messages, use the MQTT trigger.
4- //!
4+ //!
55//! # Examples
6- //!
6+ //!
77//! Send an MQTT message.
8- //!
8+ //!
99//! ```no_run
1010//! use spin_sdk::mqtt::{Connection, Qos};
1111//!
3030//! ```
3131
3232/// An open connection to an MQTT queue.
33- ///
33+ ///
3434/// The address must be in URL form, and must include a `client_id`:
3535/// `mqtt://hostname?client_id=...`
36- ///
36+ ///
3737/// # Examples
38- ///
38+ ///
3939/// Send an MQTT message.
40- ///
40+ ///
4141/// ```no_run
4242/// use spin_sdk::mqtt::{Connection, Qos};
4343///
Original file line number Diff line number Diff line change 11//! MySQL relational database storage.
2- //!
2+ //!
33//! You can use the [`Decode`] trait to convert a [`DbValue`] to a
44//! suitable Rust type. The following table shows available conversions.
55//!
2222//! | `Vec<u8>` | binary(list\<u8\>) | VARBINARY, BINARY, BLOB |
2323
2424/// An open connection to a MySQL database.
25- ///
25+ ///
2626/// # Examples
27- ///
27+ ///
2828/// Load a set of rows from a local PostgreSQL database, and iterate over them.
29- ///
29+ ///
3030/// ```no_run
3131/// use spin_sdk::mysql::{Connection, Decode, ParameterValue};
3232///
4848/// # Ok(())
4949/// # }
5050/// ```
51- ///
51+ ///
5252/// Perform an aggregate (scalar) operation over a table. The result set
5353/// contains a single column, with a single row.
54- ///
54+ ///
5555/// ```no_run
5656/// use spin_sdk::mysql::{Connection, Decode};
5757///
6868/// # Ok(())
6969/// # }
7070/// ```
71- ///
71+ ///
7272/// Delete rows from a MySQL table. This uses [Connection::execute()]
7373/// instead of the `query` method.
7474///
@@ -91,12 +91,12 @@ pub use super::wit::v2::mysql::Connection;
9191/// The result of a database query.
9292///
9393/// # Examples
94- ///
94+ ///
9595/// Load a set of rows from a local PostgreSQL database, and iterate over them
9696/// selecting one field from each. The columns collection allows you to find
9797/// column indexes for column names; you can bypass this lookup if you name
9898/// specific columns in the query.
99- ///
99+ ///
100100/// ```no_run
101101/// use spin_sdk::mysql::{Connection, Decode, ParameterValue};
102102///
Original file line number Diff line number Diff line change 11//! Postgres relational database storage.
2- //!
2+ //!
33//! You can use the [`into()`](std::convert::Into) method to convert
44//! a Rust value into a [`ParameterValue`]. You can use the
55//! [`Decode`] trait to convert a [`DbValue`] to a suitable Rust type.
2323//! | `chrono::Duration` | timestamp(s64) | BIGINT |
2424
2525/// An open connection to a PostgreSQL database.
26- ///
26+ ///
2727/// # Examples
28- ///
28+ ///
2929/// Load a set of rows from a local PostgreSQL database, and iterate over them.
30- ///
30+ ///
3131/// ```no_run
3232/// use spin_sdk::pg3::{Connection, Decode};
3333///
4949/// # Ok(())
5050/// # }
5151/// ```
52- ///
52+ ///
5353/// Perform an aggregate (scalar) operation over a table. The result set
5454/// contains a single column, with a single row.
55- ///
55+ ///
5656/// ```no_run
5757/// use spin_sdk::pg3::{Connection, Decode};
5858///
6969/// # Ok(())
7070/// # }
7171/// ```
72- ///
72+ ///
7373/// Delete rows from a PostgreSQL table. This uses [Connection::execute()]
7474/// instead of the `query` method.
7575///
@@ -92,12 +92,12 @@ pub use super::wit::pg3::Connection;
9292/// The result of a database query.
9393///
9494/// # Examples
95- ///
95+ ///
9696/// Load a set of rows from a local PostgreSQL database, and iterate over them
9797/// selecting one field from each. The columns collection allows you to find
9898/// column indexes for column names; you can bypass this lookup if you name
9999/// specific columns in the query.
100- ///
100+ ///
101101/// ```no_run
102102/// use spin_sdk::pg3::{Connection, Decode};
103103///
Original file line number Diff line number Diff line change 11//! Component configuration variables.
2- //!
2+ //!
33//! Component variables must be defined in the application
44//! manifest, in the `[component.<name>.variables]` section.
55//! Component variables typically use template syntax to
66//! derive values from application variables, which are
77//! the only variables that may be overridden directly (for
88//! example, on the Spin command line).
9- //!
9+ //!
1010//! # Examples
11- //!
11+ //!
1212//! Get the value of a component variable.
13- //!
13+ //!
1414//! ```no_run
1515//! # fn main() -> anyhow::Result<()> {
1616//! let region = spin_sdk::variables::get("region_id")?;
1717//! let regional_url = format!("https://{region}.db.example.com");
1818//! # Ok(())
1919//! # }
2020//! ```
21- //!
21+ //!
2222//! Fail gracefully if a variable is not set.
23- //!
23+ //!
2424//! ```no_run
2525//! use spin_sdk::variables::Error;
2626//!
3535//! ```
3636
3737/// Get the value of a component variable.
38- ///
38+ ///
3939/// # Examples
40- ///
40+ ///
4141/// Get the value of a component variable.
42- ///
42+ ///
4343/// ```no_run
4444/// # fn main() -> anyhow::Result<()> {
4545/// let region = spin_sdk::variables::get("region_id")?;
4646/// let regional_url = format!("https://{region}.db.example.com");
4747/// # Ok(())
4848/// # }
4949/// ```
50- ///
50+ ///
5151/// Fail gracefully if a variable is not set.
52- ///
52+ ///
5353/// ```no_run
5454/// use spin_sdk::variables::Error;
5555///
You can’t perform that action at this time.
0 commit comments