DB.SOURCE
=DB.SOURCE names a data source and binds it to a SQL alias. The cell it returns is what you pass to =DB.QUERY and =DB.SCHEMA; the alias is how you refer to the source inside your SQL.
Naming the source in its own cell keeps Excel’s recalc graph honest: every query that depends on a source depends on the cell, so editing or moving the source re-runs the queries that use it.
Signature
Section titled “Signature”=DB.SOURCE(source, alias)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
source | text or range | A remote URL, a local file name, or a worksheet range. See the three shapes below. |
alias | text | The name you’ll use for this source in SQL. Must be a valid SQL identifier. |
The three input shapes
Section titled “The three input shapes”1. Remote URL
Section titled “1. Remote URL”An http(s):// URL pointing at a file. The format is inferred from the extension:
| Extension | Read as |
|---|---|
.parquet | a single Parquet file |
.csv, .csv.gz | a CSV file (gzip is decompressed automatically) |
.json | a Files manifest — a JSON document listing the Parquet files of a partitioned (Hive) dataset |
=DB.SOURCE("https://dev-fdb.sumpalabs.com/samples/sales.parquet", "sales")The .json manifest shape is remote-only — it lists relative paths that resolve against the remote host, so a local manifest has nothing to resolve against.
2. Local file
Section titled “2. Local file”A bare file name — no http://, just the name — for a file you added through the task pane file picker. Supported extensions are .parquet, .csv, and .csv.gz. The file is read in the browser and never uploaded.
=DB.SOURCE("sales.csv", "sales")Pick the file in the task pane first; the name in the formula is matched against the files you picked this session. (A local .json manifest is not supported — pick the Parquet files directly instead.)
3. Worksheet range
Section titled “3. Worksheet range”A range reference binds the cells themselves as a source. The first row is read as the column names. The source cell stores only the range’s address — never a copy of the values — so =DB.QUERY reads the live cells each time it runs.
=DB.SOURCE(A1:C11, "regions")A named range or an Excel Table binds the same way. For a Table, use [#All] so the header row is included:
=DB.SOURCE(RegionTable[#All], "regions")When the range, named range, or Table grows, the queries that use it update automatically.
Alias rules
Section titled “Alias rules”The alias must be a valid SQL identifier:
- letters, digits, and underscores only;
- it must not start with a digit (it may start with an underscore);
- it must not be a SQL reserved word such as
SELECT,FROM, orWHERE.
Plain names like sales, regions, wells_2024, or data are all fine.
Use it in a cell, not inline
Section titled “Use it in a cell, not inline”=DB.SOURCE must live in its own cell. Writing it inline inside =DB.QUERY — for example =DB.QUERY("…", DB.SOURCE("…","s")) — is rejected with #VALUE!. Put the =DB.SOURCE in a cell and pass a reference to that cell instead. This is what keeps the dependency visible to Excel’s recalc.
Errors
Section titled “Errors”| Condition | Cell error | Message |
|---|---|---|
The extension isn’t .parquet / .csv / .csv.gz / .json | #VALUE! | Unsupported source ”…” |
A bare .json filename (local manifests aren’t supported) | #VALUE! | Unsupported source ”…” |
| The alias isn’t a valid identifier | #VALUE! | Alias ”…” is not a valid SQL identifier |
| The alias is a SQL reserved word | #VALUE! | Alias ”…” is a SQL reserved word |
=DB.SOURCE was written inline inside =DB.QUERY | #VALUE! | (the inline source is rejected) |
Example
Section titled “Example”Name the samples sales file, then query it:
A1: =DB.SOURCE("https://dev-fdb.sumpalabs.com/samples/sales.parquet", "sales")B1: =DB.QUERY("SELECT COUNT(*) AS orders FROM sales", A1)See also
Section titled “See also”=DB.QUERY— query the sources you named here.=DB.SCHEMA— list a source’s columns.- Examples — remote, JOIN, and range-source worked examples.