pub struct Pg<T>(pub T);Tuple Fields§
§0: TImplementations§
Source§impl Pg<TableColumn<'_>>
impl Pg<TableColumn<'_>>
pub fn create_inline( &self, sql: &mut String, rn: &RenameMap, report: &mut Report, )
pub fn drop_alter(&self, out: &mut Vec<Alternation>, rn: &RenameMap)
pub fn create_alter( &self, out: &mut Vec<Alternation>, rn: &RenameMap, report: &mut Report, )
Sourcepub fn rename_alter(
&self,
to: DbColumn,
out: &mut Vec<Alternation>,
rn: &mut RenameMap,
)
pub fn rename_alter( &self, to: DbColumn, out: &mut Vec<Alternation>, rn: &mut RenameMap, )
Column renaming doesn’t support grouping multiple renames in one ALTER TABLE.
Source§impl Pg<SchemaTable<'_>>
impl Pg<SchemaTable<'_>>
pub fn create(&self, sql: &mut String, rn: &RenameMap, report: &mut Report)
pub fn comment_id(&self, rn: &RenameMap) -> String
pub fn drop(&self, sql: &mut String, rn: &RenameMap)
pub fn rename( &self, to: DbTable, sql: &mut String, rn: &mut RenameMap, external: bool, )
pub fn print_alternations( &self, out: &[Alternation], sql: &mut String, rn: &RenameMap, )
Source§impl Pg<ColumnDiff<'_>>
impl Pg<ColumnDiff<'_>>
pub fn print_alter( &self, out: &mut Vec<Alternation>, rn: &RenameMap, report_old: &mut Report, report_new: &mut Report, )
Source§impl Pg<TableDiff<'_>>
impl Pg<TableDiff<'_>>
pub fn print_stage1( &self, sql: &mut String, rn: &mut RenameMap, external: bool, report_old: &mut Report, report_new: &mut Report, ) -> ChangeList<TableColumn<'_>>
pub fn print_stage1_5( &self, sql: &mut String, rn: &RenameMap, external: bool, report_old: &mut Report, report_new: &mut Report, ) -> ChangeList<PgTableConstraint<'_>>
pub fn print_stage2( &self, sql: &mut String, rn: &mut RenameMap, column_changes: &ChangeList<TableColumn<'_>>, constraint_changes: ChangeList<PgTableConstraint<'_>>, external: bool, report_old: &mut Report, report_new: &mut Report, ) -> Vec<Alternation>
pub fn print_stage3( &self, sql: &mut String, rn: &RenameMap, column_changes: ChangeList<TableColumn<'_>>, external: bool, )
Source§impl Pg<TableForeignKey<'_>>
impl Pg<TableForeignKey<'_>>
pub fn create_alter(&self, out: &mut Vec<Alternation>, rn: &RenameMap)
Source§impl Pg<TableIndex<'_>>
impl Pg<TableIndex<'_>>
Source§impl Pg<SchemaEnum<'_>>
impl Pg<SchemaEnum<'_>>
Source§impl Pg<EnumItemHandle<'_>>
impl Pg<EnumItemHandle<'_>>
pub fn rename_alter(&self, to: DbEnumItem, rn: &mut RenameMap) -> String
Source§impl Pg<SchemaComposite<'_>>
impl Pg<SchemaComposite<'_>>
pub fn rename(&self, db: DbType, sql: &mut String, rn: &mut RenameMap)
pub fn create(&self, sql: &mut String, rn: &RenameMap, report: &mut Report)
pub fn drop(&self, sql: &mut String, rn: &RenameMap)
pub fn print_alternations( &self, out: &[String], sql: &mut String, rn: &RenameMap, )
Source§impl Pg<SchemaScalar<'_>>
impl Pg<SchemaScalar<'_>>
pub fn rename( &self, to: DbType, sql: &mut String, rn: &mut RenameMap, external: bool, )
pub fn print_alternations( &self, out: &[String], sql: &mut String, rn: &RenameMap, )
pub fn create(&self, sql: &mut String, rn: &RenameMap, report: &mut Report)
pub fn drop(&self, sql: &mut String, rn: &RenameMap)
Source§impl Pg<Diff<SchemaScalar<'_>>>
impl Pg<Diff<SchemaScalar<'_>>>
Source§impl Pg<SchemaItem<'_>>
impl Pg<SchemaItem<'_>>
pub fn rename( &self, to: DbItem, sql: &mut String, rn: &mut RenameMap, external: bool, )
pub fn create(&self, sql: &mut String, rn: &RenameMap, report: &mut Report)
pub fn drop(&self, sql: &mut String, rn: &RenameMap)
pub fn docs(&self) -> String
pub fn comment_id(&self, rn: &RenameMap) -> String
Source§impl Pg<&Schema>
impl Pg<&Schema>
pub fn format_sql( &self, sql: &Sql, context: SchemaItem<'_>, rn: &RenameMap, report: &mut Report, ) -> String
Source§impl Pg<TablePrimaryKey<'_>>
impl Pg<TablePrimaryKey<'_>>
pub fn create_inline(&self, rn: &RenameMap) -> String
pub fn drop_alter(&self, out: &mut Vec<String>, rn: &RenameMap)
pub fn rename_alter( &self, new_name: DbConstraint, out: &mut Vec<String>, rn: &mut RenameMap, )
Source§impl Pg<TableUniqueConstraint<'_>>
impl Pg<TableUniqueConstraint<'_>>
pub fn create_inline(&self, rn: &RenameMap) -> String
pub fn drop_alter(&self, out: &mut Vec<String>, rn: &RenameMap)
Source§impl Pg<TableCheck<'_>>
impl Pg<TableCheck<'_>>
pub fn create_inline(&self, rn: &RenameMap, report: &mut Report) -> String
pub fn drop_alter(&self, out: &mut Vec<String>, rn: &RenameMap)
Source§impl Pg<SchemaView<'_>>
impl Pg<SchemaView<'_>>
pub fn create(&self, sql: &mut String, rn: &RenameMap, report: &mut Report)
pub fn rename(&self, to: DbView, sql: &mut String, rn: &mut RenameMap)
pub fn drop(&self, sql: &mut String, rn: &RenameMap)
pub fn print_alternations( &self, out: &[Alternation], sql: &mut String, rn: &RenameMap, )
Source§impl Pg<SchemaDiff<'_>>
impl Pg<SchemaDiff<'_>>
pub fn changelist( &self, rn: &RenameMap, report_old: &mut Report, report_new: &mut Report, ) -> ChangeList<SchemaItem<'_>>
Trait Implementations§
Source§impl<T> HasDefaultDbName for Pg<T>where
T: HasDefaultDbName,
impl<T> HasDefaultDbName for Pg<T>where
T: HasDefaultDbName,
Source§impl IsCompatible for Pg<SchemaItem<'_>>
impl IsCompatible for Pg<SchemaItem<'_>>
Source§impl IsCompatible for Pg<TableIndex<'_>>
impl IsCompatible for Pg<TableIndex<'_>>
Source§impl IsIsomorph for Pg<SchemaItem<'_>>
impl IsIsomorph for Pg<SchemaItem<'_>>
Source§impl IsIsomorph for Pg<TableIndex<'_>>
impl IsIsomorph for Pg<TableIndex<'_>>
impl<T: Copy> Copy for Pg<T>
Auto Trait Implementations§
impl<T> Freeze for Pg<T>where
T: Freeze,
impl<T> RefUnwindSafe for Pg<T>where
T: RefUnwindSafe,
impl<T> Send for Pg<T>where
T: Send,
impl<T> Sync for Pg<T>where
T: Sync,
impl<T> Unpin for Pg<T>where
T: Unpin,
impl<T> UnwindSafe for Pg<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> RenameExt for Twhere
T: HasDefaultDbName + HasUid,
impl<T> RenameExt for Twhere
T: HasDefaultDbName + HasUid,
type Kind = <T as HasDefaultDbName>::Kind
fn try_db(&self, rn: &RenameMap) -> Option<DbIdent<<T as RenameExt>::Kind>>
fn set_db(&self, rn: &mut RenameMap, name: DbIdent<<T as RenameExt>::Kind>)
fn db_assigned(&self, rn: &RenameMap) -> bool
fn db(&self, rn: &RenameMap) -> DbIdent<Self::Kind>
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0: Renamed to
random to avoid conflict with the new gen keyword in Rust 2024.Alias for
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0: Renamed to
random_rangeAlias for
Rng::random_range.Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
Convert an
RngCore to a RngReadAdapter.