Datasource
The shared binding shape that tells a program or a component where its data comes from and how to filter it.
A datasource is progDataSource, the object that says where a program's or a component's data comes from: a table, an inline array, raw JSON or CSV, or a URL, plus how to filter it, sort it and whether to keep it live. It is not something you create on its own in today's Studio, it is a section every Get Data, Set Data and data-aware Component carries, and all three read and write that section through the exact same shape and the exact same runtime resolver.
progDataSource
runAt on a datasource
A datasource resolves "" (inherit from its parent program), client (in the browser) or server (through the runtime's datasource_create service, keeping privileged queries off the client). The runtime overrides the stored value to client unconditionally in two cases: inside a Globals program, and when the session is running in app_computing_mode: "main".
Two shapes, same object
Single record by key (a form):
Filtered list (a grid):
Worked example
Pick the mode
Looking up one record by its key: index mode plus dataSourceIndexId. Filtering a list by a condition: query mode plus filterModelMongoFx.
Point it at a table
dataSourceTableId is the target Table's _id, never its name.
Turn on realtime where it matters
dataSourceRealtime: true keeps a bound grid in sync as rows change underneath it, on the native database driver only.
The .xu <datasource> block is the same information as progDataSource, in the shorthand xuda-cli compiles down to the Studio JSON shape.