ct-gov/connecticut-town-population-projections-20152025-mze8-865g
Icon for Socrata external plugin

Query the Data Delivery Network

Query the DDN

The 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.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at data.ct.gov. When you queryct-gov/connecticut-town-population-projections-20152025-mze8-865g:latest on the DDN, we "mount" the repository using the socrata mount handler. The mount handler proxies your SQL query to the upstream data source, translating it from SQL to the relevant language (in this case SoQL).

We also cache query responses on the DDN, but we run the DDN on multiple nodes so a CACHE_HIT is only guaranteed for subsequent queries that land on the same node.

Query Your Local Engine

Install Splitgraph Locally
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; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories (like this repository), 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, where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Mounting Data

This repository is an external repository. It's not hosted by Splitgraph. It is hosted by data.ct.gov, and Splitgraph indexes it. This means it is not an actual Splitgraph image, so you cannot use sgr clone to get the data. Instead, you can use the socrata adapter with the sgr mount command. Then, if you want, you can import the data and turn it into a Splitgraph image that others can clone.

First, install Splitgraph if you haven't already.

Mount the table with sgr mount

sgr mount socrata \
  "ct-gov/connecticut-town-population-projections-20152025-mze8-865g" \
  --handler-options '{
    "domain": "data.ct.gov",
    "tables": {
        "connecticut_town_population_projections_20152025": "mze8-865g"
    }
}'

That's it! Now you can query the data in the mounted table like any other Postgres table.

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.