Skip to content

Commit

Permalink
feat(launcher): add sea-orm v1.0 support (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov authored Oct 3, 2024
1 parent a65376e commit 599ddb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion libs/blockscout-service-launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blockscout-service-launcher"
version = "0.13.2"
version = "0.14.0"
description = "Allows to launch blazingly fast blockscout rust services"
license = "MIT"
repository = "https://github.com/blockscout/blockscout-rs"
Expand Down Expand Up @@ -46,6 +46,9 @@ sea-orm-migration-0_11 = { package = "sea-orm-migration", version = "0.11", opti
sea-orm-0_12 = { package = "sea-orm", version = "0.12.2", optional = true }
sea-orm-migration-0_12 = { package = "sea-orm-migration", version = "0.12.2", optional = true }

sea-orm-1_0 = { package = "sea-orm", version = "1.0", optional = true }
sea-orm-migration-1_0 = { package = "sea-orm-migration", version = "1.0", optional = true }

[dev-dependencies]
pretty_assertions = "1.4.0"
tempfile = "3.10.1"
Expand Down Expand Up @@ -89,6 +92,11 @@ database = [
"dep:tracing",
"dep:url",
]
database-1_0 = [
"database",
"dep:sea-orm-1_0",
"dep:sea-orm-migration-1_0",
]
database-0_12 = [
"database",
"dep:sea-orm-0_12",
Expand Down
5 changes: 4 additions & 1 deletion libs/blockscout-service-launcher/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use serde::{Deserialize, Serialize};
use std::str::FromStr;

cfg_if::cfg_if! {
if #[cfg(feature = "database-0_12")] {
if #[cfg(feature = "database-1_0")] {
pub use sea_orm_1_0::{ConnectOptions, ConnectionTrait, Database, DatabaseBackend, Statement, DatabaseConnection, DbErr};
pub use sea_orm_migration_1_0::MigratorTrait;
} else if #[cfg(feature = "database-0_12")] {
pub use sea_orm_0_12::{ConnectOptions, ConnectionTrait, Database, DatabaseBackend, Statement, DatabaseConnection, DbErr};
pub use sea_orm_migration_0_12::MigratorTrait;
} else if #[cfg(feature = "database-0_11")] {
Expand Down

0 comments on commit 599ddb7

Please sign in to comment.