Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e74ec24
skeleton project
oliverw1 Apr 8, 2025
b34ed0c
add getting started for uv
oliverw1 Apr 8, 2025
0572efb
add data loading files
Siyan-Luo Apr 9, 2025
cb263df
migrate data from oracle to local filesystem
Siyan-Luo Apr 10, 2025
cbdd992
add infra for Oracle on RDS
oliverw1 Apr 10, 2025
326e2d9
Merge branch 'feature/add-full-incremental-load' into feature/add-dlt…
oliverw1 Apr 10, 2025
3a04736
add incrementallly load the entire database
Siyan-Luo Apr 10, 2025
3100fd2
Merge branch 'feature/add-full-incremental-load' into feature/add-dlt…
oliverw1 Apr 10, 2025
3b2bbd0
add secrets template file
Siyan-Luo Apr 10, 2025
2bf6a7c
remove files whose functionality is already in main.py
oliverw1 Apr 10, 2025
53ddf3d
remove superfluous lines related to uv
oliverw1 Apr 10, 2025
f227a86
sort attributes to indicate which ones matter to the source
oliverw1 Apr 10, 2025
dc283db
add info on how to get missing dependencies
oliverw1 Apr 11, 2025
4bfae40
add notes on loading data into Oracle on RDS
oliverw1 Apr 11, 2025
da0ff87
add and apply pre-commit hooks
oliverw1 Apr 11, 2025
4f90916
fix type hints
oliverw1 Apr 11, 2025
034e71b
allowing the dm office access to the Oracle db
oliverw1 Apr 11, 2025
0421a68
style: extract common parts from config
oliverw1 Apr 11, 2025
d93648b
delete duplicated hooks
Siyan-Luo Apr 11, 2025
1a374c2
adjust to src layout and conveyor project structure
oliverw1 Apr 11, 2025
6e7a5cd
style: drop useless comments
oliverw1 Apr 11, 2025
4a4b1e1
full load working - next is incremental
oliverw1 Apr 11, 2025
e60efc4
add pyarrow
oliverw1 Apr 14, 2025
bda6200
add remote state backend
oliverw1 Apr 14, 2025
3202159
add query for creating warehouse COMPUTE_WH
Siyan-Luo Apr 14, 2025
d31a185
grant multiple people access to reader_role
oliverw1 Apr 14, 2025
bcdd237
downgrade python version because of snowflake connector
oliverw1 Apr 14, 2025
da40a16
first docker draft
oliverw1 Apr 14, 2025
fc50470
extend range from German ISP O2
oliverw1 Apr 14, 2025
482546c
remove snowflake username as it's not needed
Siyan-Luo Apr 14, 2025
7b30027
revert commit fc50470
Siyan-Luo Apr 15, 2025
8629c37
name the database in caps and add variable snowflake_username ad it's…
Siyan-Luo Apr 15, 2025
875a64d
snowflake provider needs user credential
Siyan-Luo Apr 15, 2025
89edbd4
update renamed host name for sql database
Siyan-Luo Apr 15, 2025
6a2030b
full load a small table for test in dockerfile
Siyan-Luo Apr 15, 2025
8dc4c34
do not ignore .conveyor folder for now
Siyan-Luo Apr 15, 2025
37a033f
add conveyor config file
Siyan-Luo Apr 15, 2025
8a3de9f
add comments to explain the project.yaml
Siyan-Luo Apr 15, 2025
50d1707
use correct extension, update project id
oliverw1 Apr 15, 2025
96f817b
update local ip
oliverw1 Apr 15, 2025
08e390c
allow all ips to oracle
oliverw1 Apr 15, 2025
ba54731
attempt big incremental load
oliverw1 Apr 16, 2025
655ac03
full load config to all types table
Siyan-Luo Apr 16, 2025
373aeea
grant jonny dlt_reader_role
Siyan-Luo Apr 17, 2025
8a27c21
add type adapter
Siyan-Luo Apr 22, 2025
820de77
sql for creating oracle table of all data types
Siyan-Luo Apr 22, 2025
0d060f9
add connectorx example
oliverw1 Apr 23, 2025
5f70d42
delete showcase pipeline file
Siyan-Luo Apr 25, 2025
f89dcb3
renamed dir to reflect the target of the Extract-Load process
oliverw1 Apr 25, 2025
572272c
update docs with findings
oliverw1 Apr 25, 2025
76f35e5
../../README.md
oliverw1 Apr 25, 2025
c375e05
wip: refactor to prep as conveyor-sample
oliverw1 May 11, 2025
bae31cb
aptly name DAG, remove unused reference
oliverw1 May 13, 2025
d5debcc
add notes where the config may be found
oliverw1 May 13, 2025
f2ed51c
Update docs, restructure Terraform code into modules
oliverw1 Jun 11, 2025
9a08520
Simplify getting-started using Docker
oliverw1 Jun 16, 2025
dfbf383
style: format with markdownlint
oliverw1 Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.idea/
.conveyor
.idea/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This repository contains a number of sample projects for Conveyor

### Basic

- dlthub_oracle_to_snowflake: use [dlthub](https://dlthub.com/) to migrate database tables from Oracle to Snowflake.
- pi_spark: use [Apache Spark](https://github.com/apache/spark) to calculate pi.
- first_project_dbt: use [dbt](https://github.com/dbt-labs/dbt-core) and [DuckDB](https://github.com/duckdb/duckdb) for the first time. Using this project is described in the Conveyor [getting started guide](https://docs.conveyordata.com/get-started/dbt).
- coffee_shop_dbt: use [dbt](https://github.com/dbt-labs/dbt-core) and [DuckDB](https://github.com/duckdb/duckdb)
Expand Down
48 changes: 48 additions & 0 deletions basic/dlthub_oracle_to_snowflake/.dlt/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# put your configuration values here

[runtime]
log_level="WARNING" # the system log level of dlt
# use the dlthub_telemetry setting to enable/disable anonymous usage data reporting, see https://dlthub.com/docs/reference/telemetry
dlthub_telemetry = true

[sources.sql_database]
table = "table" # please set me up!

[full_load]
pipeline_name = "all_datatypes"
destination = "snowflake"
schema = "TPCH"
dataset_name = "datatypes"
table_name = ["all_data_types_demo"]

#[full_load]
#pipeline_name = "full_load_pipeline"
#destination = "snowflake"
#schema = "SH"
#dataset_name = "sh_full"
#table_name = ["promotions", "products", "customers"]

# [incremental_load]
# schema = "AUDSYS"
# table_name = ["aud$unified"]
# incremental_column = "event_timestamp"
# pipeline_name = "incremental_load_pipeline"
# destination = "snowflake"
# dataset_name = "audsys_incremental"

[incremental_load]
schema = "TPCH"
table_name = ["orders"] # case sensitive!
incremental_column = "o_orderdate"
pipeline_name = "incremental_load_pipeline"
destination = "snowflake"
dataset_name = "tpch_orders_incremental"

[incremental_with_connectorx]
schema = "TPCH"
table_name = "LINEITEM" # case sensitive!
incremental_column = "l_orderkey"
partition_column = "l_orderkey" # not the primary key of lineitem (which is linenumber + orderkey), but good for a test
pipeline_name = "incremental_load_pipeline_connectorx"
destination = "snowflake"
dataset_name = "tpch_orders_incremental_connectorx"
23 changes: 23 additions & 0 deletions basic/dlthub_oracle_to_snowflake/.dlt/secrets.toml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[sources.sql_database.credentials]
drivername = "oracle+oracledb"
database = "ORCL"
password = "dltpass" # Supplied in scripts/dlt-user.sql
username = "dlthub" # Supplied in scripts/dlt-user.sql
host = "take it from `terraform output rds_endpoint`, remove the port suffix"
port = same as the host, just use port suffix

[destination.filesystem]
dataset_name = "mydataset"
bucket_url = "database"

[destination.snowflake.credentials]
# All of these can be obtained from running `terraform output snowflake_credentials` in the _infra_ folder.
database = "database" # please set me up!
password = "password" # please set me up!
username = "username" # please set me up!
host = "host" # please set me up!
warehouse = "warehouse" # please set me up!
role = "role" # please set me up!

[pipeline]
loader_file_format="parquet"
19 changes: 19 additions & 0 deletions basic/dlthub_oracle_to_snowflake/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.env
.venv
secrets.toml
**/__pycache__/
**/*.py[cod]
**/*$py.class
.dockerignore
Dockerfile
infra
docs
data
database
dags
tests
.pre-commit-config.yaml
README.md

.idea
.gitignore
15 changes: 15 additions & 0 deletions basic/dlthub_oracle_to_snowflake/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ignore secrets, virtual environments and typical python compilation artifacts
secrets.toml
# ignore basic python artifacts
.env
.venv
**/__pycache__/
**/*.py[cod]
**/*$py.class
# ignore databases
database/
*.duckdb
*.wal
infra/.terraform

.conveyor
38 changes: 38 additions & 0 deletions basic/dlthub_oracle_to_snowflake/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repos:
# Code formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.98.1
hooks:
- id: terraform_fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: debug-statements
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-vcs-permalinks
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [--fix=lf]
- id: pretty-format-json

# checks github actions files for errors
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
46 changes: 46 additions & 0 deletions basic/dlthub_oracle_to_snowflake/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:latest as oracle

WORKDIR /opt/oracle
# ConnectorX activates the "thick mode" of the oracle client, so one needs some extra libs.
ADD https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip ./
RUN unzip instantclient-basiclite-linuxx64.zip && \
rm -f instantclient-basiclite-linuxx64.zip && \
cd instantclient* && \
rm -f *jdbc* *occi* *mysql* *jar uidrvci genezi adrci

FROM docker.io/python:3.12.9-slim-bullseye

COPY --from=ghcr.io/astral-sh/uv:0.6.14 /uv /bin/uv

RUN set -eux; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed. I've added them out of habit, to ensure bash behaves more like the languages we're used to and to error out on the first failed command (e-flag). Since none of the 3 commands here is likely to give an error, it can (and will) be removed.

apt-get update; \
apt-get install -y --no-install-recommends \
gcc \
libaio1 \
unzip \
; \
rm -rf /var/lib/apt/lists/*

COPY --from=oracle /opt/oracle /opt/oracle
RUN echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf && \
ldconfig

WORKDIR /usr/src/app
# silence warnings about not being able to use hard-links for the cache-mount
RUN --mount=type=cache,target=/root/.cache/uv \
Comment thread
oliverw1 marked this conversation as resolved.
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync \
--frozen \
--compile-bytecode \
--link-mode=copy \
--no-install-project
ADD . .

RUN --mount=type=cache,target=/root/.cache/uv \
uv sync \
--frozen \
--compile-bytecode \
--link-mode=copy

CMD ["uv", "run", "./src/dlt_example/app.py", "full"]
Loading