dbt-migrator 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. dbt_migrator-0.1.2/.github/workflows/CI.yml +122 -0
  2. dbt_migrator-0.1.2/.gitignore +7 -0
  3. dbt_migrator-0.1.2/Cargo.lock +826 -0
  4. dbt_migrator-0.1.2/Cargo.toml +45 -0
  5. dbt_migrator-0.1.2/LICENSE +674 -0
  6. dbt_migrator-0.1.2/PKG-INFO +202 -0
  7. dbt_migrator-0.1.2/README.md +188 -0
  8. dbt_migrator-0.1.2/examples/run_migration.rs +58 -0
  9. dbt_migrator-0.1.2/migrate_config.example.yml +6 -0
  10. dbt_migrator-0.1.2/pyproject.toml +24 -0
  11. dbt_migrator-0.1.2/src/cli.rs +28 -0
  12. dbt_migrator-0.1.2/src/config/mod.rs +3 -0
  13. dbt_migrator-0.1.2/src/config/schema.rs +54 -0
  14. dbt_migrator-0.1.2/src/dbt/index.rs +102 -0
  15. dbt_migrator-0.1.2/src/dbt/metadata.rs +144 -0
  16. dbt_migrator-0.1.2/src/dbt/mod.rs +5 -0
  17. dbt_migrator-0.1.2/src/dbt/project.rs +51 -0
  18. dbt_migrator-0.1.2/src/error.rs +37 -0
  19. dbt_migrator-0.1.2/src/lib.rs +10 -0
  20. dbt_migrator-0.1.2/src/main.rs +56 -0
  21. dbt_migrator-0.1.2/src/pipeline/mod.rs +1 -0
  22. dbt_migrator-0.1.2/src/pipeline/runner.rs +114 -0
  23. dbt_migrator-0.1.2/src/python.rs +67 -0
  24. dbt_migrator-0.1.2/src/sql/dialects.rs +25 -0
  25. dbt_migrator-0.1.2/src/sql/mod.rs +7 -0
  26. dbt_migrator-0.1.2/src/sql/normalizer.rs +100 -0
  27. dbt_migrator-0.1.2/src/sql/report.rs +110 -0
  28. dbt_migrator-0.1.2/src/sql/rewriter.rs +127 -0
  29. dbt_migrator-0.1.2/tests/fixtures/demo_project/dbt_project.yml +21 -0
  30. dbt_migrator-0.1.2/tests/fixtures/demo_project/models/marts/dim_customers.sql +1 -0
  31. dbt_migrator-0.1.2/tests/fixtures/demo_project/models/marts/finance/fct_orders.sql +1 -0
  32. dbt_migrator-0.1.2/tests/fixtures/demo_project/models/marts/legacy/dim_customers.sql +1 -0
  33. dbt_migrator-0.1.2/tests/fixtures/demo_project/models/staging/stg_customers.sql +1 -0
  34. dbt_migrator-0.1.2/tests/fixtures/demo_project/sql_legacy/report_orders.sql +10 -0
  35. dbt_migrator-0.1.2/tests/integration_test.rs +90 -0
@@ -0,0 +1,122 @@
1
+ on:
2
+ push:
3
+ tags:
4
+ - "v*"
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+ MATURIN_VERSION: "1.14.1"
12
+
13
+ jobs:
14
+ check-version:
15
+ name: Check that tag == Cargo.toml version
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Check tag version and Cargo.toml version
20
+ shell: bash
21
+ run: |
22
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
23
+ CARGO_VERSION=$(grep -m1 '^version' Cargo.toml | sed -E 's/version *= *"(.*)"/\1/')
24
+ echo "tag=$TAG_VERSION Cargo.toml=$CARGO_VERSION"
25
+ if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
26
+ echo "::error::The tag ${GITHUB_REF_NAME} (=> $TAG_VERSION) is different from the Cargo.toml version ($CARGO_VERSION)."
27
+ exit 1
28
+ fi
29
+
30
+ test:
31
+ name: cargo test (${{ matrix.os }})
32
+ needs: check-version
33
+ runs-on: ${{ matrix.os }}
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ os: [ubuntu-latest, macos-latest, windows-latest]
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: dtolnay/rust-toolchain@stable
41
+ - uses: Swatinem/rust-cache@v2
42
+ - run: cargo test --verbose
43
+
44
+ publish-crate:
45
+ name: Publish on crates.io
46
+ needs: [check-version, test]
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: dtolnay/rust-toolchain@stable
51
+ - uses: Swatinem/rust-cache@v2
52
+ - name: Dry check
53
+ run: cargo publish --dry-run
54
+ - name: Publish
55
+ env:
56
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
57
+ run: cargo publish
58
+
59
+ # PyPI - natives wheels per OS : only one wheel per OS.
60
+ build-wheels:
61
+ name: Build the wheel (${{ matrix.os }})
62
+ needs: [check-version, test]
63
+ runs-on: ${{ matrix.os }}
64
+ strategy:
65
+ fail-fast: false
66
+ matrix:
67
+ os: [ubuntu-latest, windows-latest, macos-latest]
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ - uses: actions/setup-python@v5
71
+ with:
72
+ python-version: "3.12"
73
+ - name: Build the wheel
74
+ uses: PyO3/maturin-action@v1
75
+ with:
76
+ maturin-version: ${{ env.MATURIN_VERSION }}
77
+ command: build
78
+ manylinux: auto
79
+ args: --release --out dist --compatibility pypi
80
+ - uses: actions/upload-artifact@v4
81
+ with:
82
+ name: wheel-${{ matrix.os }}
83
+ path: dist/*.whl
84
+
85
+ build-sdist:
86
+ name: Build the distribution source
87
+ needs: check-version
88
+ runs-on: ubuntu-latest
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - uses: PyO3/maturin-action@v1
92
+ with:
93
+ maturin-version: ${{ env.MATURIN_VERSION }}
94
+ command: sdist
95
+ args: --out dist
96
+ - uses: actions/upload-artifact@v4
97
+ with:
98
+ name: sdist
99
+ path: dist/*.tar.gz
100
+
101
+ publish-pypi:
102
+ name: Publish on PyPI
103
+ needs: [test, publish-crate, build-wheels, build-sdist]
104
+ runs-on: ubuntu-latest
105
+ environment: pypi
106
+ permissions:
107
+ id-token: write
108
+ steps:
109
+ - uses: actions/download-artifact@v4
110
+ with:
111
+ pattern: wheel-*
112
+ path: dist
113
+ merge-multiple: true
114
+ - uses: actions/download-artifact@v4
115
+ with:
116
+ name: sdist
117
+ path: dist
118
+ - name: Publier sur PyPI
119
+ uses: pypa/gh-action-pypi-publish@release/v1
120
+ with:
121
+ packages-dir: dist
122
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,7 @@
1
+ /target
2
+ *.migrated
3
+ __pycache__/
4
+ *.so
5
+ *.pyd
6
+ dist/
7
+ .venv/