esrs 0.10.2

A Prima.it-opinionated library to achieve cqrs/es
Documentation
[env]
DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/postgres"

[env.drone]
DATABASE_URL = "postgresql://postgres:postgres@postgres:5432/postgres"

[config]
default_to_workspace = false

# Check
[tasks.check]
description = "Run checks"
dependencies = ["check-no-features", "check-postgres"]

[tasks.check-no-features]
description = "Run check without features"
command = "cargo"
args = ["check", "--workspace"]

[tasks.check-postgres]
description = "Run check with `postgres` feature on"
command = "cargo"
args = ["check", "--workspace", "--features=postgres"]

# Build
[tasks.build-ci]
description = "Build prima_tracing.rs inside CI."
dependencies = ["build-ci-no-features", "build-ci-postgres"]

[tasks.build-ci-no-features]
description = "Build prima_tracing.rs inside CI."
command = "cargo"
args = ["build", "-j", "2", "--all-features", "--workspace"]

[tasks.build-ci-postgres]
description = "Build prima_tracing.rs inside CI."
command = "cargo"
args = ["build", "-j", "2", "--all-features", "--workspace"]

# Format
[tasks.format-ci]
description = "Runs the cargo rustfmt plugin during CI."
command = "cargo"
args = ["fmt", "--all", "--", "--check"]

# Tests
[tasks.test]
description = "Run tests."
dependencies = ["test-no-features", "test-postgres"]

[tasks.test-no-features]
description = "Run tests."
command = "cargo"
args = ["test", "${@}", "--workspace"]

[tasks.test-postgres]
description = "Run tests."
command = "cargo"
args = ["test", "${@}", "--workspace", "--features=postgres"]

# Clippy
[tasks.clippy-ci]
description = "Run clippy linter."
dependencies = ["clippy-ci-no-features", "clippy-ci-postgres"]

[tasks.clippy-ci-no-features]
command = "cargo"
args = ["clippy", "--workspace", "--", "-D", "warnings"]

[tasks.clippy-ci-postgres]
command = "cargo"
args = ["clippy", "--workspace", "--features", "postgres", "--", "-D", "warnings"]

# Run example
[tasks.example]
description = "Run given example."
command = "cargo"
args = ["run", "-p", "${@}"]

# Docs
[tasks.docsrs]
description = "Build docs as they are rendered on docs.rs"
command = "cargo"
args = ["doc", "--all-features"]

[tasks.cargo-prune]
description = "Run cargo prune"
command = "cargo"
args = ["prune"]

[tasks.print-stats]
description = "Print cache size"
command = "du"
args = ["-sh", "target", ".cargo"]

[tasks.cache-cleanup]
description = "Clean CI cache"
dependencies = ["cargo-prune", "delete-artifacts", "print-stats"]

[tasks.delete-artifacts]
description = "Remove non cachable artifacts"
script = [
    '''
    #!/bin/bash
    set -e
    set -x
    find ./target/debug -type f -maxdepth 1 -delete || true
    rm -rf ./target/{debug,release}/deps/{*prima-tracing*}
    rm -rf ./target/{debug,release}/.fingerprint/*prima-tracing*
    ''',
]