@@ -32,6 +32,7 @@ pub fn log_debug1(msg: &str) {
32
32
/// For example,
33
33
///
34
34
/// ```rust,no_run
35
+ /// # use supabase_wrappers::prelude::report_info;
35
36
/// report_info(&format!("this is an info"));
36
37
/// ```
37
38
#[ inline]
@@ -51,6 +52,7 @@ pub fn report_info(msg: &str) {
51
52
/// For example,
52
53
///
53
54
/// ```rust,no_run
55
+ /// # use supabase_wrappers::prelude::report_notice;
54
56
/// report_notice(&format!("this is a notice"));
55
57
/// ```
56
58
#[ inline]
@@ -70,6 +72,7 @@ pub fn report_notice(msg: &str) {
70
72
/// For example,
71
73
///
72
74
/// ```rust,no_run
75
+ /// # use supabase_wrappers::prelude::report_warning;
73
76
/// report_warning(&format!("this is a warning"));
74
77
/// ```
75
78
#[ inline]
@@ -90,6 +93,7 @@ pub fn report_warning(msg: &str) {
90
93
/// For example,
91
94
///
92
95
/// ```rust,no_run
96
+ /// # use supabase_wrappers::prelude::report_error;
93
97
/// use pgrx::prelude::PgSqlErrorCode;
94
98
///
95
99
/// report_error(
@@ -111,12 +115,20 @@ pub fn report_error(code: PgSqlErrorCode, msg: &str) {
111
115
/// For example,
112
116
///
113
117
/// ```rust,no_run
118
+ /// # use supabase_wrappers::prelude::create_async_runtime;
119
+ /// # struct Client {
120
+ /// # }
121
+ /// # impl Client {
122
+ /// # async fn query(&self, _sql: &str) -> Result<(), ()> { Ok(()) }
123
+ /// # }
124
+ /// # let client = Client {};
125
+ /// # let sql = "";
114
126
/// let rt = create_async_runtime();
115
127
///
116
- /// // client.query() is an async function
128
+ /// // client.query() is an async function returning a Result
117
129
/// match rt.block_on(client.query(&sql)) {
118
- /// Ok(result) => {... }
119
- /// Err(err) => {... }
130
+ /// Ok(result) => { }
131
+ /// Err(err) => { }
120
132
/// }
121
133
/// ```
122
134
#[ inline]
@@ -132,6 +144,9 @@ pub fn create_async_runtime() -> Runtime {
132
144
/// For example,
133
145
///
134
146
/// ```rust,no_run
147
+ /// # use supabase_wrappers::prelude::require_option;
148
+ /// # use std::collections::HashMap;
149
+ /// # let options = &HashMap::new();
135
150
/// require_option("my_option", options);
136
151
/// ```
137
152
pub fn require_option ( opt_name : & str , options : & HashMap < String , String > ) -> Option < String > {
@@ -151,7 +166,10 @@ pub fn require_option(opt_name: &str, options: &HashMap<String, String>) -> Opti
151
166
/// For example,
152
167
///
153
168
/// ```rust,no_run
154
- /// require_option_or("my_option", options, "default value");
169
+ /// # use supabase_wrappers::prelude::require_option_or;
170
+ /// # use std::collections::HashMap;
171
+ /// # let options = &HashMap::new();
172
+ /// require_option_or("my_option", options, "default value".to_string());
155
173
/// ```
156
174
pub fn require_option_or (
157
175
opt_name : & str ,
0 commit comments