pub struct CommentStatement { /* private fields */ }Expand description
COMMENT ON statement builder
This struct provides a fluent API for constructing COMMENT ON queries.
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::CommentTarget;
// COMMENT ON TABLE "users" IS 'User account information'
let query = Query::comment()
.target(CommentTarget::Table("users".into_iden()))
.comment("User account information");
// COMMENT ON COLUMN "users"."email" IS 'User email address'
let query = Query::comment()
.target(CommentTarget::Column("users".into_iden(), "email".into_iden()))
.comment("User email address");
// COMMENT ON TABLE "users" IS NULL (remove comment)
let query = Query::comment()
.target(CommentTarget::Table("users".into_iden()))
.comment_null();Implementations§
Source§impl CommentStatement
impl CommentStatement
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new COMMENT ON statement
§Examples
use reinhardt_query::prelude::*;
let query = Query::comment();Sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Take the ownership of data in the current CommentStatement
Sourcepub fn target(self, target: CommentTarget) -> Self
pub fn target(self, target: CommentTarget) -> Self
Set the target object for the comment
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::CommentTarget;
let query = Query::comment()
.target(CommentTarget::Table("users".into_iden()));Sourcepub fn comment<S: Into<String>>(self, comment: S) -> Self
pub fn comment<S: Into<String>>(self, comment: S) -> Self
Set the comment text
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::CommentTarget;
let query = Query::comment()
.target(CommentTarget::Table("users".into_iden()))
.comment("User account information");Sourcepub fn comment_null(self) -> Self
pub fn comment_null(self) -> Self
Set the comment to NULL (remove comment)
§Examples
use reinhardt_query::prelude::*;
use reinhardt_query::types::CommentTarget;
let query = Query::comment()
.target(CommentTarget::Table("users".into_iden()))
.comment_null();Trait Implementations§
Source§impl Clone for CommentStatement
impl Clone for CommentStatement
Source§fn clone(&self) -> CommentStatement
fn clone(&self) -> CommentStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommentStatement
impl Debug for CommentStatement
Source§impl Default for CommentStatement
impl Default for CommentStatement
Source§impl QueryStatementBuilder for CommentStatement
impl QueryStatementBuilder for CommentStatement
Source§fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
Build SQL statement for a database backend and collect query parameters Read more
impl QueryStatementWriter for CommentStatement
Auto Trait Implementations§
impl Freeze for CommentStatement
impl !RefUnwindSafe for CommentStatement
impl !Send for CommentStatement
impl !Sync for CommentStatement
impl Unpin for CommentStatement
impl UnsafeUnpin for CommentStatement
impl !UnwindSafe for CommentStatement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more