Query the Data Delivery Network
Query the DDNThe easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432
and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.
For example, you can query the connecticut_town_population_projections_20152025
table in this repository, by referencing it like:
"ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest"."connecticut_town_population_projections_20152025"
or in a full query, like:
SELECT
":id", -- Socrata column ID
"town", -- Town name
"geoid_aff2", -- GEOID_AFF2
"county_subdivision_fips", -- County Subdivision (FIPS)
"_2025_total", -- 2025 Total
"_2025_male_total", -- 2025 Male Total
"_2025_male_90_ov", -- 2025 Male 90-OV
"_2025_male_85_89", -- 2025 Male 85-89
"_2025_male_80_84", -- 2025 Male 80-84
"_2025_male_75_79", -- 2025 Male 75-79
"_2025_male_70_74", -- 2025 Male 70-74
"_2025_male_65_69", -- 2025 Male 65-69
"_2025_male_60_64", -- 2025 Male 60-64
"_2025_male_50_54", -- 2025 Male 50-54
"_2025_male_45_49", -- 2025 Male 45-49
"_2025_male_40_44", -- 2025 Male 40-44
"_2025_male_35_39", -- 2025 Male 35-39
"_2025_male_30_34", -- 2025 Male 30-34
"_2025_male_25_29", -- 2025 Male 25-29
"_2025_male_20_24", -- 2025 Male 20-24
"_2025_male_15_19", -- 2025 Male 15-19
"_2025_male_10_14", -- 2025 Male 10-14
"_2025_male_05_09", -- 2025 Male 05-09
"_2025_male_00_04", -- 2025 Male 00-04
"_2025_female_total", -- 2025 Female Total
"_2025_female_90_ov", -- 2025 Female 90-OV
"_2025_female_85_89", -- 2025 Female 85-89
"_2025_female_80_84", -- 2025 Female 80-84
"_2025_female_70_74", -- 2025 Female 70-74
"_2025_female_65_69", -- 2025 Female 65-69
"_2025_female_55_59", -- 2025 Female 55-59
"_2025_female_50_54", -- 2025 Female 50-54
"_2025_female_45_49", -- 2025 Female 45-49
"_2025_female_40_44", -- 2025 Female 40-44
"_2025_female_35_39", -- 2025 Female 35-39
"_2025_female_30_34", -- 2025 Female 30-34
"_2025_female_25_29", -- 2025 Female 25-29
"_2025_female_15_19", -- 2025 Female 15-19
"_2025_female_10_14", -- 2025 Female 10-14
"_2025_female_05_09", -- 2025 Female 05-09
"_2025_female_00_04", -- 2025 Female 00-04
"_2020_total", -- 2020 Total
"_2020_male_total", -- 2020 Male Total
"_2020_male_90_ov", -- 2020 Male 90-OV
"_2020_male_85_89", -- 2020 Male 85-89
"_2020_male_70_74", -- 2020 Male 70-74
"_2020_male_55_59", -- 2020 Male 55-59
"_2020_male_50_54", -- 2020 Male 50-54
"_2020_male_45_49", -- 2020 Male 45-49
"_2020_male_40_44", -- 2020 Male 40-44
"_2020_male_35_39", -- 2020 Male 35-39
"_2020_male_30_34", -- 2020 Male 30-34
"_2020_male_25_29", -- 2020 Male 25-29
"_2020_male_20_24", -- 2020 Male 20-24
"_2020_male_15_19", -- 2020 Male 15-19
"_2020_male_10_14", -- 2020 Male 10-14
"_2020_male_05_09", -- 2020 Male 05-09
"_2020_male_00_04", -- 2020 Male 00-04
"_2020_female_total", -- 2020 Female Total
"_2020_female_90_ov", -- 2020 Female 90-OV
"_2020_female_70_74", -- 2020 Female 70-74
"_2020_female_65_69", -- 2020 Female 65-69
"_2020_female_60_64", -- 2020 Female 60-64
"_2020_female_55_59", -- 2020 Female 55-59
"_2020_female_50_54", -- 2020 Female 50-54
"_2020_female_45_49", -- 2020 Female 45-49
"_2020_female_40_44", -- 2020 Female 40-44
"_2020_female_35_39", -- 2020 Female 35-39
"_2020_female_30_34", -- 2020 Female 30-34
"_2020_female_25_29", -- 2020 Female 25-29
"_2020_female_20_24", -- 2020 Female 20-24
"_2020_female_15_19", -- 2020 Female 15-19
"_2020_female_10_14", -- 2020 Female 10-14
"_2020_female_05_09", -- 2020 Female 05-09
"_2020_female_00_04", -- 2020 Female 00-04
"_2015_total", -- 2015 Total
"_2015_male_total", -- 2015 Male Total
"_2015_male_90_ov", -- 2015 Male 90-OV
"_2015_male_80_84", -- 2015 Male 80-84
"_2015_male_75_79", -- 2015 Male 75-79
"_2015_male_70_74", -- 2015 Male 70-74
"_2015_male_65_69", -- 2015 Male 65-69
"_2015_male_60_64", -- 2015 Male 60-64
"_2015_male_55_59", -- 2015 Male 55-59
"_2015_male_45_49", -- 2015 Male 45-49
"_2015_male_40_44", -- 2015 Male 40-44
"_2015_male_35_39", -- 2015 Male 35-39
"_2015_male_30_34", -- 2015 Male 30-34
"_2015_male_25_29", -- 2015 Male 25-29
"_2015_male_20_24", -- 2015 Male 20-24
"_2015_male_15_19", -- 2015 Male 15-19
"_2015_male_10_14", -- 2015 Male 10-14
"_2015_male_00_04", -- 2015 Male 00-04
"_2015_female_total", -- 2015 Female Total
"_2015_female_90_ov", -- 2015 Female 90-OV
"_2015_female_85_89", -- 2015 Female 85-89
"_2015_female_80_84", -- 2015 Female 80-84
"_2015_female_75_79", -- 2015 Female 75-79
"_2015_female_70_74", -- 2015 Female 70-74
"_2015_female_65_69", -- 2015 Female 65-69
"_2015_female_60_64", -- 2015 Female 60-64
"_2015_female_55_59", -- 2015 Female 55-59
"_2015_female_50_54", -- 2015 Female 50-54
"_2015_female_45_49", -- 2015 Female 45-49
"_2015_female_40_44", -- 2015 Female 40-44
"_2015_female_35_39", -- 2015 Female 35-39
"_2015_female_30_34", -- 2015 Female 30-34
"_2015_female_25_29", -- 2015 Female 25-29
"_2015_female_20_24", -- 2015 Female 20-24
"_2015_female_15_19", -- 2015 Female 15-19
"_2015_female_10_14", -- 2015 Female 10-14
"_2015_female_05_09", -- 2015 Female 05-09
"_2015_female_00_04", -- 2015 Female 00-04
"_2015_male_50_54", -- 2015 Male 50-54
"_2015_male_05_09", -- 2015 Male 05-09
"_2020_male_60_64", -- 2020 Male 60-64
"_2020_male_65_69", -- 2020 Male 65-69
"_2020_male_75_79", -- 2020 Male 75-79
"_2020_female_75_79", -- 2020 Female 75-79
"_2020_female_80_84", -- 2020 Female 80-84
"_2020_female_85_89", -- 2020 Female 85-89
"fips_county_subdivision_class_code", -- FIPS County Subdivision Class Code
"county", -- County
"summary_level", -- Summary Level
"_2020_male_80_84", -- 2020 Male 80-84
"_2015_male_85_89", -- 2015 Male 85-89
"_2025_female_75_79", -- 2025 Female 75-79
"_2025_male_55_59", -- 2025 Male 55-59
"_2025_female_60_64", -- 2025 Female 60-64
"_2025_female_20_24" -- 2025 Female 20-24
FROM
"ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest"."connecticut_town_population_projections_20152025"
LIMIT 100;
Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query ct-gov/connecticut-town-population-projections-20152025-mze8-865g
with SQL in under 60 seconds.
Query Your Local Engine
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
Read the installation docs.
Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.
It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr
, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgr
can manage the image, container and volume for you.
There are a few ways to ingest data into the local engine.
For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount
. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.
For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr clone
and sgr checkout
.
Cloning Data
Because ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest
is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.
First, install Splitgraph if you haven't already.
Clone the metadata with sgr clone
This will be quick, and does not download the actual data.
sgr clone ct-gov/connecticut-town-population-projections-20152025-mze8-865g
Checkout the data
Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest
tag:
sgr checkout ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest
This will download all the objects for the latest
tag of ct-gov/connecticut-town-population-projections-20152025-mze8-865g
and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.
Alternatively, use "layered checkout" to avoid downloading all the data
The data in ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest
is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:
sgr checkout --layered ct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest
This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.
Read the layered querying documentation to learn about when and why you might want to use layered queries.
Query the data with your existing tools
Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, ct-gov/connecticut-town-population-projections-20152025-mze8-865g
is just another Postgres schema.