Skip to content

Commit

Permalink
chore: rename enum
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Oct 5, 2024
1 parent f711448 commit c0779aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/extension/postgres/func.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! For calling built-in Postgres SQL functions.

use crate::{expr::*, func::*, PgDateTrunc};
use crate::{expr::*, func::*, PgDateTruncUnit};

/// Functions
#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -394,7 +394,7 @@ impl PgFunc {
///
/// let query = Query::select()
/// .expr(PgFunc::date_trunc(
/// PgDateTrunc::Day,
/// PgDateTruncUnit::Day,
/// Expr::val("2020-01-01"),
/// ))
/// .to_owned();
Expand All @@ -406,7 +406,7 @@ impl PgFunc {
///
/// let query = Query::select()
/// .expr(PgFunc::date_trunc(
/// PgDateTrunc::Microseconds,
/// PgDateTruncUnit::Microseconds,
/// Expr::val("2020-01-01"),
/// ))
/// .to_owned();
Expand All @@ -416,7 +416,7 @@ impl PgFunc {
/// r#"SELECT DATE_TRUNC('microseconds', '2020-01-01')"#
/// );
/// ```
pub fn date_trunc<T>(unit: PgDateTrunc, expr: T) -> FunctionCall
pub fn date_trunc<T>(unit: PgDateTruncUnit, expr: T) -> FunctionCall
where
T: Into<SimpleExpr>,
{
Expand Down
2 changes: 1 addition & 1 deletion src/table/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub enum PgInterval {
// All possible inputs to DATE_TRUNC (https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC)
#[derive(Debug, Clone, Eq, PartialEq, Display)]
#[strum(serialize_all = "lowercase")]
pub enum PgDateTrunc {
pub enum PgDateTruncUnit {
Microseconds,
Milliseconds,
Second,
Expand Down

0 comments on commit c0779aa

Please sign in to comment.