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
Publisher Code Anatomy
1from tabsdatak.api import publisher, TableFrameSpec2from tabsdatak.conn.postgres import PostgresSrc341@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
countryandcityarguments receive the query results in the order listed inqueries.The returned data is written to the Tables listed in
output_tables, in that order. ReturningNonefor 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.