MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / column

Method column

src/query/helper.rs:66–72  ·  view source on GitHub ↗

Add a select column ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; assert_eq!( cake::Entity::find() .select_only() .column(cake::Column::Name) .build(DbBackend::Postgres) .to_string(), r#"SELECT "cake"."name" FROM "cake""# ); ``` Enum column will be casted into text (PostgreSQL only) ``` use sea_orm::{entity::*, query::*, tests_cfg::lunch_set, DbBackend}; assert_eq!( lunch

(mut self, col: C)

Source from the content-addressed store, hash-verified

64 /// );
65 /// ```
66 fn column<C>(mut self, col: C) -> Self
67 where
68 C: ColumnTrait,
69 {
70 self.query().expr(col.select_as(col.into_expr()));
71 self
72 }
73
74 /// Add a select column with alias
75 /// ```

Callers 15

columnsMethod · 0.80
build_with_queryFunction · 0.80
left_joinFunction · 0.80
right_joinFunction · 0.80
inner_joinFunction · 0.80
group_byFunction · 0.80
havingFunction · 0.80
from_query_result_nestedFunction · 0.80

Implementers 1

cursor.rssrc/executor/cursor.rs

Calls 4

exprMethod · 0.80
into_exprMethod · 0.80
queryMethod · 0.45
select_asMethod · 0.45

Tested by 13

build_with_queryFunction · 0.64
left_joinFunction · 0.64
right_joinFunction · 0.64
inner_joinFunction · 0.64
group_byFunction · 0.64
havingFunction · 0.64
from_query_result_nestedFunction · 0.64