Struct rusqlite_migration::M [−][src]
One migration
Implementations
impl<'u> M<'u>
[src]
pub fn up(sql: &'u str) -> Self
[src]
Create a schema update.
Please note
- PRAGMA statements are discouraged here. They are often better applied outside of
migrations, because:
- Some PRAGMA need to be executed for each connection (like
foreign_keys
). - Some PRAGMA are no-op when executed inside transactions (that will be the case for the
SQL written in
up
) (likejournal_mode
). - Multiple SQL commands contaning
PRAGMA
are known not to work with theextra_check
feature of rusqlite.
- Some PRAGMA need to be executed for each connection (like
- SQL commands should end with a “;”.
Example
use rusqlite_migration::M; M::up("CREATE TABLE animals (name TEXT);");
pub fn down(self, sql: &'u str) -> Self
[src]
Define a down-migration. This SQL statement should exactly reverse the changes
performed in up()
.
A call to this method is not required.
Example
use rusqlite_migration::M; M::up("CREATE TABLE animals (name TEXT);") .down("DROP TABLE animals;");
Trait Implementations
impl<'u> Clone for M<'u>
[src]
impl<'u> Debug for M<'u>
[src]
impl<'u> PartialEq<M<'u>> for M<'u>
[src]
impl<'u> StructuralPartialEq for M<'u>
[src]
Auto Trait Implementations
impl<'u> RefUnwindSafe for M<'u>
impl<'u> Send for M<'u>
impl<'u> Sync for M<'u>
impl<'u> Unpin for M<'u>
impl<'u> UnwindSafe for M<'u>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,