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

Method columns

src/query/helper.rs:155–164  ·  view source on GitHub ↗

Select columns ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; assert_eq!( cake::Entity::find() .select_only() .columns([cake::Column::Id, cake::Column::Name]) .build(DbBackend::Postgres) .to_string(), r#"SELECT "cake"."id", "cake"."name" FROM "cake""# ); ``` Conditionally select all columns expect a specific column ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, Db

(mut self, cols: I)

Source from the content-addressed store, hash-verified

153 /// );
154 /// ```
155 fn columns<C, I>(mut self, cols: I) -> Self
156 where
157 C: ColumnTrait,
158 I: IntoIterator<Item = C>,
159 {
160 for col in cols.into_iter() {
161 self = self.column(col);
162 }
163 self
164 }
165
166 /// Add an offset expression. Passing in None would remove the offset.
167 ///

Callers 12

from_query_resultMethod · 0.80
addMethod · 0.80
add_manyMethod · 0.80
column_namesMethod · 0.80
build_with_queryFunction · 0.80
mainFunction · 0.80
get_migration_modelsMethod · 0.80
query_mysql_foreign_keysFunction · 0.80
upMethod · 0.80

Implementers 1

cursor.rssrc/executor/cursor.rs

Calls 2

into_iterMethod · 0.80
columnMethod · 0.80

Tested by 3

build_with_queryFunction · 0.64
mainFunction · 0.64
upMethod · 0.64