grid_sdk/migrations/mod.rs
1// Copyright 2018-2020 Cargill Incorporated
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Provides sql migration scripts and methods for executing
16//! migrations.
17//!
18//! ```ignore
19//! use grid_sdk::migrations::run_postgres_migrations;
20//! use diesel::{pg::PgConnection};
21//!
22//! let connection = PgConnection::establish(
23//! "postgres://admin:admin@localhost:5432/splinterd").unwrap();
24//!
25//! run_postgres_migrations(&connection).unwrap();
26//!
27//! ```
28
29#[cfg(feature = "diesel")]
30mod diesel;
31pub mod error;
32
33#[cfg(feature = "postgres")]
34pub use self::diesel::postgres::run_migrations as run_postgres_migrations;
35
36#[cfg(feature = "sqlite")]
37pub use self::diesel::sqlite::run_migrations as run_sqlite_migrations;