Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.API ReferenceCLI ReferenceRelease Notes
Version: 2.1.0

Publishers

A publisher function reads data from an external system and writes the data to one or more tables in the Tabsdata server.

Publisher Functions ingest data from external systems. To do so, they require a Connection that provides the credentials and configuration needed to access those systems.

Publishers in Action​

Tabsdata server
collection · world
Database
PostgreSQL
PostgreSQL · external
Reachable
Connection
conn-postgres.yaml
Publisher
read_world
Table
country
//world
No versions yet
Table
city
//world
No versions yet

Publisher Code Anatomy​

read_world.py
1from tabsdatak.api import publisher, TableFrameSpec
2from tabsdatak.conn.postgres import PostgresSrc
3
4
1@publisher(
2 source=PostgresSrc(
3 queries=[
8 "SELECT * FROM country",
9 "SELECT * FROM city",
10 ],
11 ),
4 output_tables=["country", "city"],
13)
56def read_world(country: TableFrameSpec, city: TableFrameSpec) -> tuple[TableFrameSpec, TableFrameSpec]:
7 return (country, city)
  • Defines the source and output Tables for the Publisher.

    • Reads data from the external system. The Collection's Connection provides the address and credentials.

    • SQL queries that read the country and city data from Postgres.

    • Tabsdata Tables where the returned data is written.

  • Receives the query results and returns the data to write to the output Tables.

    • The country and city arguments receive the query results in the order listed in queries.

    • The returned data is written to the Tables listed in output_tables, in that order. Returning None for a Table leaves its current version unchanged.

For step-by-step guides on building a publisher for a specific external system, see Publishers under How-to Guides.