Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87ef8ad

Browse files
Merge pull request#1278 from razein97/master
Expose simple query raw method in tokio postgres
2 parents628a696 +74385b8 commit87ef8ad

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎tokio-postgres/src/client.rs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,20 @@ impl Client {
515515
self.simple_query_raw(query).await?.try_collect().await
516516
}
517517

518-
pub(crate)asyncfnsimple_query_raw(&self,query:&str) ->Result<SimpleQueryStream,Error>{
518+
/// Executes a sequence of SQL statements using the simple query protocol, returning the resulting rows as a stream.
519+
///
520+
/// Statements should be separated by semicolons. If an error occurs, execution of the sequence will stop at that
521+
/// point. The simple query protocol returns the values in rows as strings rather than in their binary encodings,
522+
/// so the associated row type doesn't work with the `FromSql` trait. Rather than simply returning a list of the
523+
/// rows, this method returns a list of an enum which indicates either the completion of one of the commands,
524+
/// or a row of data. This preserves the framing between the separate statements in the request.
525+
///
526+
/// # Warning
527+
///
528+
/// Prepared statements should be use for any query which contains user-specified data, as they provided the
529+
/// functionality to safely embed that data in the request. Do not form statements via string concatenation and pass
530+
/// them to this method!
531+
pubasyncfnsimple_query_raw(&self,query:&str) ->Result<SimpleQueryStream,Error>{
519532
simple_query::simple_query(self.inner(), query).await
520533
}
521534

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp