This commit is contained in:
Luca Palmieri 2022-10-01 18:07:52 +01:00
parent 5779cb1f29
commit 2215bd726b
4 changed files with 19 additions and 36 deletions

View file

@ -30,7 +30,7 @@ jobs:
- 5432:5432 - 5432:5432
env: env:
SQLX_VERSION: 0.6.2 SQLX_VERSION: 0.6.2
SQLX_FEATURES: postgres SQLX_FEATURES: "rustls,postgres"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -56,7 +56,7 @@ jobs:
with: with:
path: | path: |
~/.cargo/bin/sqlx ~/.cargo/bin/sqlx
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}-${{ env.SQLX_FEATURES }} key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}
- name: Install sqlx-cli - name: Install sqlx-cli
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
@ -67,7 +67,7 @@ jobs:
sqlx-cli sqlx-cli
--force --force
--version=${{ env.SQLX_VERSION }} --version=${{ env.SQLX_VERSION }}
--features=${{ env.SQLX_FEATURES }} --features ${{ env.SQLX_FEATURES }}
--no-default-features --no-default-features
--locked --locked
@ -110,7 +110,7 @@ jobs:
- 5432:5432 - 5432:5432
env: env:
SQLX_VERSION: 0.6.2 SQLX_VERSION: 0.6.2
SQLX_FEATURES: postgres SQLX_FEATURES: "rustls,postgres"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -128,7 +128,7 @@ jobs:
with: with:
path: | path: |
~/.cargo/bin/sqlx ~/.cargo/bin/sqlx
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}-${{ env.SQLX_FEATURES }} key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}
- name: Install sqlx-cli - name: Install sqlx-cli
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
@ -139,7 +139,7 @@ jobs:
sqlx-cli sqlx-cli
--force --force
--version=${{ env.SQLX_VERSION }} --version=${{ env.SQLX_VERSION }}
--features=${{ env.SQLX_FEATURES }} --features ${{ env.SQLX_FEATURES }}
--no-default-features --no-default-features
--locked --locked
@ -168,7 +168,7 @@ jobs:
- 5432:5432 - 5432:5432
env: env:
SQLX_VERSION: 0.6.2 SQLX_VERSION: 0.6.2
SQLX_FEATURES: postgres SQLX_FEATURES: "rustls,postgres"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -185,7 +185,7 @@ jobs:
with: with:
path: | path: |
~/.cargo/bin/sqlx ~/.cargo/bin/sqlx
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}-${{ env.SQLX_FEATURES }} key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }}
- name: Install sqlx-cli - name: Install sqlx-cli
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
@ -196,7 +196,7 @@ jobs:
sqlx-cli sqlx-cli
--force --force
--version=${{ env.SQLX_VERSION }} --version=${{ env.SQLX_VERSION }}
--features=${{ env.SQLX_FEATURES }} --features ${{ env.SQLX_FEATURES }}
--no-default-features --no-default-features
--locked --locked

30
Cargo.lock generated
View file

@ -165,7 +165,7 @@ dependencies = [
"serde_urlencoded", "serde_urlencoded",
"smallvec", "smallvec",
"socket2", "socket2",
"time 0.3.14", "time",
"url", "url",
] ]
@ -357,11 +357,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1"
dependencies = [ dependencies = [
"iana-time-zone", "iana-time-zone",
"js-sys",
"num-integer", "num-integer",
"num-traits", "num-traits",
"time 0.1.44",
"wasm-bindgen",
"winapi", "winapi",
] ]
@ -392,7 +389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917"
dependencies = [ dependencies = [
"percent-encoding", "percent-encoding",
"time 0.3.14", "time",
"version_check", "version_check",
] ]
@ -677,7 +674,7 @@ checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi",
] ]
[[package]] [[package]]
@ -1025,7 +1022,7 @@ checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi",
"windows-sys", "windows-sys",
] ]
@ -1802,17 +1799,6 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "time"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi",
]
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.14" version = "0.3.14"
@ -1975,7 +1961,7 @@ dependencies = [
"log", "log",
"serde", "serde",
"serde_json", "serde_json",
"time 0.3.14", "time",
"tracing", "tracing",
"tracing-core", "tracing-core",
"tracing-log", "tracing-log",
@ -2120,12 +2106,6 @@ dependencies = [
"try-lock", "try-lock",
] ]
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.11.0+wasi-snapshot-preview1" version = "0.11.0+wasi-snapshot-preview1"

View file

@ -19,7 +19,7 @@ serde = "1.0.115"
config = { version = "0.13", default-features = false, features = ["yaml"] } config = { version = "0.13", default-features = false, features = ["yaml"] }
sqlx = { version = "0.6", default-features = false, features = ["runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] } sqlx = { version = "0.6", default-features = false, features = ["runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] }
uuid = { version = "1", features = ["v4"] } uuid = { version = "1", features = ["v4"] }
chrono = "0.4.15" chrono = { version = "0.4.22", default-features = false, features = ["clock"] }
tracing = "0.1.19" tracing = "0.1.19"
tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] } tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] }
tracing-bunyan-formatter = "0.3.1" tracing-bunyan-formatter = "0.3.1"

View file

@ -40,7 +40,10 @@ impl DatabaseSettings {
pub fn get_configuration() -> Result<Settings, config::ConfigError> { pub fn get_configuration() -> Result<Settings, config::ConfigError> {
let settings = config::Config::builder() let settings = config::Config::builder()
.add_source(config::File::new("configuration.yaml", config::FileFormat::Yaml)) .add_source(config::File::new(
"configuration.yaml",
config::FileFormat::Yaml,
))
.build()?; .build()?;
settings.try_deserialize::<Settings>() settings.try_deserialize::<Settings>()
} }