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)
Declares what the function reads, what it writes, and which connector to use.
Connector class that performs the read. Address and credentials come from the collection's connection.
Queries to the external system, mapped positionally to function body arguments.
Tables that data returned by the function body is written to
Receives input data defined in Function decorator and writes returned data to output Tables defined in the decorator.
One parameter per query, in order.
Nonewhen a query matched no rows.One frame per output table, in order.
Nonekeeps the current version.
For step-by-step guides on building a publisher for a specific external system, see Publishers under How-to Guides.