MCPcopy Index your code
hub / github.com/dbcrossbar/dbcrossbar

github.com/dbcrossbar/dbcrossbar @v0.5.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.7 ↗ · + Follow
1,144 symbols 2,376 edges 155 files 490 documented · 43% updated 7mo agov1.1.0-pre.1 · 2025-12-02★ 24135 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dbcrossbar: Copy tabular data between databases, CSV files and cloud storage

Build Status

dbcrossbar moves large data sets between different databases and storage formats.

Some examples:

# Copy from a CSV file to a PostgreSQL table.
dbcrossbar cp \
    --if-exists=overwrite \
    --schema=postgres-sql:my_table.sql \
    csv:my_table.csv \
    'postgres://postgres@127.0.0.1:5432/postgres#my_table'

# Upsert from a PostgreSQL table to BigQuery.
dbcrossbar cp \
    --if-exists=upsert-on:id \
    --temporary=gs://$GS_TEMP_BUCKET \
    --temporary=bigquery:$GCLOUD_PROJECT:temp_dataset \
    'postgres://postgres@127.0.0.1:5432/postgres#my_table' \
    bigquery:$GCLOUD_PROJECT:my_dataset.my_table

It can also convert between table schema formats, including PostgreSQL CREATE TABLE statements and BigQuery JSON schemas:

# Convert a PostgreSQL `CREATE TABLE` statement to a BigQuery JSON schema.
dbcrossbar schema conv postgres-sql:my_table.sql bigquery-schema:my_table.json

# Extract a schema from a CSV file and convert to Postgres `CREATE TABLE`.
dbcrossbar schema conv csv:data.csv postgres-sql:schema.sql

For more information, see the documentation.

Contributing

For more instructions about building dbcrossbar, running tests, and contributing code, see CONTRIBUTING.md.

We require nightly Rust. We lock a specific version of nightly Rust using the rust-toolchain file. If you want to update this, take a look at Rustup components history and choose the newest version with support for rls, clippy and rustfmt.

Running integration tests

You can run the regular test suite with cargo test, but to run the full integration tests, you'll need to do the following:

# Run a local PostgreSQL on port 5432.
docker run --name postgres -e POSTGRES_PASSWORD= -p 5432:5432 -d mdillon/postgis
createdb -h localhost -U postgres -w dbcrossbar_test
export POSTGRES_TEST_URL=postgres://postgres:@localhost:5432/dbcrossbar_test
echo "create extension if not exists postgis;" | psql $POSTGRES_TEST_URL
echo "create extension if not exists citext;" | psql $POSTGRES_TEST_URL
echo "create schema if not exists testme1;" | psql $POSTGRES_TEST_URL

# Point to test databases and test buckets.
export GS_TEST_URL=gs://$MY_GS_TEST_BUCKET/dbcrossbar/
export BQ_TEST_DATASET=$MY_BQ_ROOT:test
export S3_TEST_URL=s3://$MT_S3_TEST_BUCKET/dbcrossbar/

# This helps to ensure that we're not depending on our users to have set
# a default gcloud project anywhere.
gcloud config unset project

# These can be omitted if you don't want to test Redshift.
export REDSHIFT_TEST_URL=redshift://user:pass@server:port/db
export REDSHIFT_TEST_IAM_ROLE=$MY_IAM_ROLE
export REDSHIFT_TEST_REGIION=$MY_AWS_REGION

# Needed for BigML. Does not work with AWS_SESSION_TOKEN.
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
export BIGML_USERNAME=... BIGML_API_KEY=...

# Run the integration tests.
env RUST_BACKTRACE=1 RUST_LOG=warn,dbcrossbar=debug \
    cargo test --all -- --ignored --nocapture

License

Licensed under either of:

...at your option.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above without any additional terms or conditions.

Third-party libraries

dbcrossbar depends on a variety of third-party libraries, each with their own copyright and license. We have configured a deny.toml file that currently attempts to restrict our dependencies to MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, CC0-1.0, ISC, OpenSSL and Zlib licenses, with a single MPL-2.0 dependency. But please verify the deny.toml file (and individual dependencies) to be certain, because details may change in the future. Each of these licenses imposes certain obligations on redistribution.

Extension points exported contracts — how you extend this code

Locator (Interface)
Specify the the location of data or a schema. [14 implementers]
dbcrossbar/src/locator.rs
SpanExt (Interface)
Our extensions to the `tracing::Span` type. [1 implementers]
crates/opinionated_telemetry/src/tracing_support.rs
Order (Interface)
* A Shopify [Order][]. * * [Order]: https://shopify.dev/docs/admin-api/rest/reference/orders/order?api[version]=2020-
dbcrossbar/fixtures/shopify.ts
LocatorStatic (Interface)
Extra `Locator` methods that can only be called statically. These cannot accessed via a `Box `. [14 implementers]
dbcrossbar/src/locator.rs
SetParentFromExtractor (Interface)
Trait that allows adding an external [`opentelemetry::Context`] to an existing [`tracing::Span`]. [1 implementers]
crates/opinionated_telemetry/src/tracing_support.rs
Address (Interface)
* An address in an [Order][]. * * [Order]: https://shopify.dev/docs/admin-api/rest/reference/orders/order?api[version
dbcrossbar/fixtures/shopify.ts
FromCsvCell (Interface)
Parse a value found in a CSV cell. This is analogous to Rust's built-in [`FromStr`] trait, but it follws the rules of ou [14 …
dbcrossbar/src/from_csv_cell.rs
ClientDetails (Interface)
* Information about the browser used to place an [Order][]. * * [Order]: https://shopify.dev/docs/admin-api/rest/refe
dbcrossbar/fixtures/shopify.ts

Core symbols most depended-on inside this repo

boxed
called by 131
dbcrossbar/src/locator.rs
verify
called by 45
dbcrossbar/src/args.rs
get
called by 32
dbcrossbar/src/clouds/gcloud/client.rs
as_str
called by 31
dbcrossbar/src/drivers/bigquery_shared/column_name.rs
path
called by 25
dbcrossbar/src/drivers/s3/mod.rs
is_empty
called by 22
dbcrossbar/src/driver_args.rs
var
called by 20
dbcrossbar/src/credentials.rs
write_bigquery_sql
called by 20
dbcrossbar/src/drivers/bigquery_shared/write_bigquery_sql.rs

Shape

Method 549
Function 345
Class 152
Interface 53
Enum 45

Languages

Rust98%
TypeScript2%

Modules by API surface

dbcrossbar/src/locator.rs33 symbols
dbcrossbar/src/drivers/dbcrossbar_ts/ast.rs33 symbols
dbcrossbar/src/schema.rs28 symbols
dbcrossbar/src/tokio_glue.rs27 symbols
dbcrossbar/src/clouds/gcloud/client.rs24 symbols
dbcrossbar/src/args.rs23 symbols
dbcrossbar/fixtures/shopify.ts23 symbols
dbcrossbar/src/drivers/file/mod.rs22 symbols
dbcrossbar/src/drivers/bigquery_shared/column_name.rs22 symbols
dbcrossbar/src/clouds/gcloud/bigquery/jobs.rs22 symbols
dbcrossbar/src/credentials.rs21 symbols
crates/opinionated_telemetry/src/tracing_support.rs21 symbols

Datastores touched

dbcrossbar_testDatabase · 1 repos

For agents

$ claude mcp add dbcrossbar \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact