Skip to content

Commit f31327b

Browse files
committed
Tweaks
1 parent 3f36ce3 commit f31327b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/query/insert.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
/// [`InsertValueSource`] is a node in the expression tree and can represent a raw value set
99
/// ('VALUES') or a select query.
1010
#[derive(Debug, Clone)]
11-
pub enum InsertValueSource {
11+
enum InsertValueSource {
1212
Values(Vec<Vec<SimpleExpr>>),
1313
Select(Box<SelectStatement>),
1414
}
@@ -149,7 +149,7 @@ impl InsertStatement {
149149
/// let query = Query::insert()
150150
/// .into_table(Glyph::Table)
151151
/// .columns(vec![Glyph::Aspect, Glyph::Image])
152-
/// .select(Query::select()
152+
/// .select_from(Query::select()
153153
/// .column(Glyph::Aspect)
154154
/// .column(Glyph::Image)
155155
/// .from(Glyph::Table)
@@ -172,7 +172,7 @@ impl InsertStatement {
172172
/// r#"INSERT INTO "glyph" ("aspect", "image") SELECT "aspect", "image" FROM "glyph" WHERE "image" LIKE '0%'"#
173173
/// );
174174
/// ```
175-
pub fn select<S>(&mut self, select: S) -> Result<&mut Self>
175+
pub fn select_from<S>(&mut self, select: S) -> Result<&mut Self>
176176
where
177177
S: Into<SelectStatement>,
178178
{
@@ -222,7 +222,7 @@ impl InsertStatement {
222222
/// r#"INSERT INTO "glyph" ("aspect", "image") SELECT "aspect", "image" FROM "glyph" WHERE "image" LIKE '0%'"#
223223
/// );
224224
/// ```
225-
pub fn value_source<S>(&mut self, source: S) -> Result<&mut InsertStatement>
225+
fn value_source<S>(&mut self, source: S) -> Result<&mut InsertStatement>
226226
where
227227
S: Into<InsertValueSource>,
228228
{
@@ -233,7 +233,7 @@ impl InsertStatement {
233233
}
234234
Ok(self)
235235
}
236-
InsertValueSource::Select(select) => self.select(*select),
236+
InsertValueSource::Select(select) => self.select_from(*select),
237237
}
238238
}
239239

tests/mysql/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ fn insert_from_select() {
973973
Query::insert()
974974
.into_table(Glyph::Table)
975975
.columns(vec![Glyph::Aspect, Glyph::Image])
976-
.select(
976+
.select_from(
977977
Query::select()
978978
.column(Glyph::Aspect)
979979
.column(Glyph::Image)

tests/postgres/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ fn insert_from_select() {
942942
Query::insert()
943943
.into_table(Glyph::Table)
944944
.columns(vec![Glyph::Aspect, Glyph::Image])
945-
.select(
945+
.select_from(
946946
Query::select()
947947
.column(Glyph::Aspect)
948948
.column(Glyph::Image)

tests/sqlite/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ fn insert_from_select() {
929929
Query::insert()
930930
.into_table(Glyph::Table)
931931
.columns(vec![Glyph::Aspect, Glyph::Image])
932-
.select(
932+
.select_from(
933933
Query::select()
934934
.column(Glyph::Aspect)
935935
.column(Glyph::Image)

0 commit comments

Comments
 (0)