The Simplest Way to Make Svn and dbt Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use svn and dbt together by storing data model files inside central Subversion trunks. A build runner checks out those files and runs SQL queries against your data warehouse. Many older firms keep all their code in Apache Subversion. Their data teams still want modern SQL builds and clear data tests. While dbt works with Git out of the box, its core engine reads local folders. If you can put project files on a disk, the tool can run them. This lets you keep one central code store while ru

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use svn and dbt together by storing data model files inside central Subversion trunks. A build runner checks out those files and runs SQL queries against your data warehouse.

Many older firms keep all their code in Apache Subversion. Their data teams still want modern SQL builds and clear data tests. While dbt works with Git out of the box, its core engine reads local folders. If you can put project files on a disk, the tool can run them. This lets you keep one central code store while running clean data builds.

How svn and dbt share files and keys

The workflow between svn and dbt relies on a build server in the middle. Developers write SQL models on their local machines and send changes to the central server. Each commit gets a single revision number that tracks the exact state of the code.

When a commit lands, the build server wakes up and pulls the latest revision. It uses a dedicated read key to fetch the folder from the Subversion server. Once the files sit on the build disk, the dbt runner starts its job.

The runner reads the local project files and compiles them into raw SQL queries. Next, it logs in to the data warehouse using a separate database role. It sends the compiled SQL to the warehouse to build tables and views. Subversion handles the file history, while the build runner handles the database work.

Common failure modes and how to scope roles

Pairing older version control with modern data tools often creates security gaps. Teams take shortcuts to make the two systems talk to each other. The worst mistake is storing database keys inside the version control trunk. If a developer commits a profile file with a password, every reader can take it.

Shared service accounts cause another big problem for data teams. Teams often use one admin database key for both local runs and central builds. When a bad query drops a table, the database log only shows the shared name. You cannot tell which person or build job ran the destructive query.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged queries and broad network rules also put data at risk. Developers often run local builds against production data using their own laptops. If those queries touch tables with emails or card numbers, raw data hits local disks.

You can fix these issues by setting strict rules for both tools. Give your build runner a read-only Subversion account scoped to the data project folder. Never let the build server write back to the main code trunk.

On the database side, split developer roles from automated build roles. Give developers a sandbox schema with masked emails and phone numbers for local tests. Give the build runner write rules only for the target schemas it owns. Handle package folders by committing external modules straight into a vendor path in your trunk. This stops the build runner from needing open internet rules during a run.

Running clean builds from Subversion trunks

A clean build starts with a fresh checkout on an isolated worker node. Do not reuse old working folders across different build jobs. Leftover files from past runs can cause phantom models to appear in your warehouse. Pull a fresh export of the trunk for every single run.

Tie every database run back to the exact Subversion revision number. Pass that revision number into the query comments so it shows up in database logs. When a data test fails, you can check the log and find the exact commit. This gives your team a clear audit trail from code change to warehouse table.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can dbt run without a local Git folder?

Yes, the core runner only needs your SQL and setup files on a local disk. You can pull those files from Subversion and run your build steps as normal.

How do we handle dbt packages when using Subversion?

Many packages live on Git hosts, which can break a pure Subversion workflow. Download the needed packages once and commit them into your trunk as fixed vendor files.

Where should we store the database login file for builds?

Never commit your database login file into the Subversion trunk. Generate the login file at runtime on the build worker using secret variables.

The query runs. The emails stay hidden.