pub enum Style {
River,
Mozilla,
Aweber,
Dbt,
Gitlab,
Kickstarter,
Mattmc3,
}Expand description
SQL formatting style.
Each variant implements a different layout strategy for SQL statements.
Use Style::default() for the AWeber style, or parse from a string:
use libpgfmt::style::Style;
let style: Style = "mozilla".parse().unwrap();
assert_eq!(style, Style::Mozilla);
// List all available styles
for s in Style::ALL {
println!("{s}");
}Variants§
River
Simon Holywell’s river style — keywords right-aligned to form a visual river.
Mozilla
Mozilla style — keywords left-aligned, content indented 4 spaces.
Aweber
AWeber style — river style with JOINs participating in keyword alignment.
Dbt
dbt style — Mozilla-like with lowercase keywords and blank lines between clauses.
Gitlab
GitLab style — Mozilla-like with 2-space indent and uppercase keywords.
Kickstarter
Kickstarter style — Mozilla-like with 2-space indent and compact JOINs.
Mattmc3
mattmc3 style — lowercase river with leading commas.
Implementations§
Trait Implementations§
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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