Good morning; I’m just starting to experiment with...
# getting-started
s
Good morning; I’m just starting to experiment with meltano to replace some in-house tools, and starting with a postgres tap.
It looks like the default setup is simply to replicate an entire database; i see that you can provide a
select
config for some patterns…
but I was looking at the tap docs and it seems to support adding configurations on a per-table basis… is this possible through meltano?
e
Hi @steve_ivy! Meltano supports overriding metadata on a per-table and per-field basis: https://meltano.com/docs/plugins.html#metadata-extra. Is that what you mean?
s
I’m… not sure? But I’ll check it out
yeah I don’t think that’s it - I was looking to be able to add this information to the meltano tap-postgres config: https://transferwise.github.io/pipelinewise/connectors/taps/postgres.html#configuring-what-to-replicate
e
You mean this
Copy code
tables:
      - table_name: "table_one"
        replication_method: "INCREMENTAL"   # One of INCREMENTAL, LOG_BASED and FULL_TABLE
        replication_key: "last_update"      # Important: Incremental load always needs replication key

        # OPTIONAL: Load time transformations
        #transformations:
        #  - column: "last_name"            # Column to transform
        #    type: "SET-NULL"               # Transformation type

      # You can add as many tables as you need...
      - table_name: "table_two"
        replication_method: "LOG_BASED"     # Important! Log based must be enabled in MySQL
?
s
yes, rather than the default behavior to try and sync every table in the db. we have a very large db with many tables - and looking for how to create multiple taps with different groups of tables, and have more control over the replication methods and keys
e
oh so that's what Meltano uses inheritance metadata for. For example, the config above would be added in
meltano.yml
as
Copy code
plugins:
  extractors:
    # Base tap
    - name: tap-postgres
      load_schema: repl_pg_public
      select:
        - "public.table_one"
        - "public.table_two"
      metadata:
        public-table_one:
          replication_method: INCREMENTAL
          replication_key: last_update
        public-table_two:
          replication_method: LOG_BASED
If you wanted to split the tables in your db between multiple taps with different configuration, the easiest wa is to use plugin inheritance
s
i did see the inheritance stuff, which makes sense… what you pasted above is new. would that limit that tap to syncing those tables, or just specify config only for those tbales?
oh nm
combined select and metadata
thanks!!