Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replication streaming publications always set to default value #295

Closed
michael-golfi opened this issue Mar 29, 2022 · 1 comment
Closed

Comments

@michael-golfi
Copy link

michael-golfi commented Mar 29, 2022

Hi, thanks for all the great work. I noticed the default value for publications was always being used. I managed to get it working by editing source and adding the following assignment on the options copy:

  return Object.assign({
    host            : Array.isArray(host) ? host : host.split(',').map(x => x.split(':')[0]),
    port            : Array.isArray(port) ? port : host.split(',').map(x => parseInt(x.split(':')[1] || port)),
    path            : o.path || host.indexOf('/') > -1 && host + '/.s.PGSQL.' + port,
    database        : o.database || o.db || (url.pathname || '').slice(1) || env.PGDATABASE || user,
    user            : user,
    pass            : o.pass || o.password || url.password || env.PGPASSWORD || '',
    max             : o.max || query.get('max') || 10,
    types           : o.types || {},
    ssl             : o.ssl || parseSSL(query.get('sslmode') || query.get('ssl')) || false,
    idle_timeout    : o.idle_timeout || query.get('idle_timeout') || env.PGIDLE_TIMEOUT || warn(o.timeout),
    connect_timeout : o.connect_timeout || query.get('connect_timeout') || env.PGCONNECT_TIMEOUT || 30,
    max_lifetime    : o.max_lifetime || url.max_lifetime || max_lifetime,
    max_pipeline    : o.max_pipeline || url.max_pipeline || 100,
    backoff         : o.backoff || url.backoff || backoff,
    keep_alive      : o.keep_alive || url.keep_alive || 60,
    prepare         : 'prepare' in o ? o.prepare : 'no_prepare' in o ? !o.no_prepare : true,
    onnotice        : o.onnotice,
    onnotify        : o.onnotify,
    onclose         : o.onclose,
    onparameter     : o.onparameter,
    +++
    publications    : o.publications,
    +++
    transform       : parseTransform(o.transform || {}),
    connection      : Object.assign({ application_name: 'postgres.js' }, o.connection),
    target_session_attrs: tsa(o, url, env),
    debug           : o.debug,
    fetch_types     : 'fetch_types' in o ? o.fetch_types : true,
    parameters      : {},
    shared          : { retries: 0, typeArrayMap: {} }
  },
    mergeUserTypes(o.types)
  )

Edit: I think I see a slightly different source view when I'm debugging through node_modules. It's at this spot.

@porsager
Copy link
Owner

Hey, nice catch @michael-golfi ! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants