Tanner Wilcox
03/11/2025, 6:41 PMtap-postgres
. Am I not supposed to provide a streams
field like the other taps? This yml is just selecting everything
plugins:
extractors:
- name: nipap
inherit_from: tap-postgres
variant: meltanolabs
pip_url: meltanolabs-tap-postgres
config:
log_level: debug
host: <http://pg-01.utbb.net|pg-01.utbb.net>
port: 5432
database: nipap
user: meltano
password: 9oiv?|,VU
filter_schemas:
- public
streams:
- name: public.ip_net_plan
primary_keys:
- id
replication_keys: last_modified
schema:
properties:
id:
type: [integer]
prefix:
type: [string]
Edgar RamÃrez (Arch.dev)
03/11/2025, 6:44 PMaI don't think other taps accept that setting, at least none that I can think of 😅 You probably want https://docs.meltano.com/concepts/plugins/#select-extra insteadfield like the other tapsstreams
Tanner Wilcox
03/11/2025, 8:53 PMplugins:
extractors:
- name: uisp
inherit_from: tap-rest-api-msdk
variant: widen
pip_url: tap-rest-api-msdk
config:
api_url: <https://uisp.utbb.net/nms/api/v2.1>
auth_method: api_key
api_keys:
X-Auth-Token: ${UISP_TOKEN}
streams:
- name: onus
path: /devices
params:
type: onu
primary_keys:
- identification_id
schema:
properties:
identification_id:
type: string
identification_name:
type: string
attributes_parentId:
type: string
identification_mac:
type: string
overview_createdAt:
type: string
format: date-time
identification_updated:
type: string
format: date-time
pagination_request_style: single_page_paginator
pagination_response_style: single_page_paginator
load_schema: raw_uisp
Tanner Wilcox
03/11/2025, 8:56 PMEdgar RamÃrez (Arch.dev)
03/11/2025, 9:19 PMHow do I know my stream ID if I can't define a stream like I do with the rest tap?Those are pre-defined by what's discoverable in your postgres database. You can run
meltano select tap-postgres --list --all
to see the available streams.Tanner Wilcox
03/11/2025, 9:22 PMmetadata:
public-.ip_net_pool.*
replicaiton-key: created_at
Tanner Wilcox
03/11/2025, 9:38 PMselect:
- public-ip_net_plan.*
metadata:
public-ip_net_plan.*:
With that select I get many streams back from my list
[selected ] public-ip_net_plan.added
[selected ] public-ip_net_plan.alarm_priority
[selected ] public-ip_net_plan.authoritative_source
[selected ] public-ip_net_plan.avps
[selected ] public-ip_net_plan.children
[selected ] public-ip_net_plan.comment
[selected ] public-ip_net_plan.country
[selected ] public-ip_net_plan.customer_id
[selected ] public-ip_net_plan.description
[selected ] public-ip_net_plan.display_prefix
[selected ] public-ip_net_plan.expires
[selected ] public-ip_net_plan.external_key
[selected ] public-ip_net_plan.free_addresses
[automatic ] public-ip_net_plan.id
[selected ] public-ip_net_plan.indent
[selected ] public-ip_net_plan.inherited_tags
[selected ] public-ip_net_plan.last_modified
[selected ] public-ip_net_plan.monitor
[selected ] public-ip_net_plan.node
[selected ] public-ip_net_plan.order_id
[selected ] public-ip_net_plan.pool_id
[selected ] public-ip_net_plan.prefix
[selected ] public-ip_net_plan.status
[selected ] public-ip_net_plan.tags
[selected ] public-ip_net_plan.total_addresses
[selected ] public-ip_net_plan.type
[selected ] public-ip_net_plan.used_addresses
[selected ] public-ip_net_plan.vlan
[selected ] public-ip_net_plan.vrf_id
So if I do the metadata thing am I setting the replication key on each column of this table? There's only one comlumn per row that I want to be the replication keEdgar RamÃrez (Arch.dev)
03/11/2025, 9:43 PM<stream>.<field>
. In your case public-ip_net_plan
is the stream. If you want to select all tables starting with ip_
then you might want something like:
select:
- public-ip_*.* # select all fields in tables starting with 'ip_' in schema 'public'
Then, if they all have the the same replication key:
metadata:
public-ip_*:
replication-method: INCREMENTAL
replication-key: last_modified
Tanner Wilcox
03/11/2025, 10:16 PMTanner Wilcox
03/11/2025, 10:58 PMplugins:
extractors:
- name: uisp
inherit_from: tap-rest-api-msdk
variant: widen
pip_url: tap-rest-api-msdk
config:
api_url: <https://uisp.utbb.net/nms/api/v2.1>
auth_method: api_key
api_keys:
X-Auth-Token: ${UISP_TOKEN}
streams:
- name: onus
path: /devices
params:
type: onu
primary_keys:
- identification_id
schema:
properties:
identification_id:
type: string
identification_name:
type: string
attributes_parentId:
type: string
identification_mac:
type: string
overview_createdAt:
type: string
format: date-time
identification_updated:
type: string
format: date-time
pagination_request_style: single_page_paginator
pagination_response_style: single_page_paginator
load_schema: raw_uisp
With that rest tap I was able to have multiple streams for this one provide (uisp). I was also able to name each stream and reference them in my transformer
WITH
source AS (
SELECT * FROM {{ source("uisp", "onus") }}
),
Am I understanding correctly that there's no concept of a stream in the postgresql tap? How do I have multiple sources from different tables?Tanner Wilcox
03/11/2025, 10:59 PMEdgar RamÃrez (Arch.dev)
03/12/2025, 5:22 PMI guess it has multiple streams they're just automatically defined as one stream per tableCorrect!