Class: AirbyteRuby::Adapters::Postgres

Inherits:
Object
  • Object
show all
Defined in:
lib/airbyte_ruby/adapters/postgres.rb

Overview

Postgres type adapter for AirbyteRuby configuration

Constant Summary collapse

TYPE =
:postgres

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Postgres

Returns a new instance of Postgres.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 12

def initialize(args = {})
  @type = TYPE.to_s
  @host = args[:host]
  @port = args[:port]
  @database = args[:database]
  @schema = args[:schema] || "public"
  @username = args[:username]
  @password = args[:password]
  @ssl_mode = args[:ssl_mode]
  @replication_method = args[:replication_method]
  @tunnel_method = args[:tunnel_method]
end

Instance Attribute Details

#databaseObject

Returns the value of attribute database.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def database
  @database
end

#hostObject

Returns the value of attribute host.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def host
  @host
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def password
  @password
end

#portObject

Returns the value of attribute port.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def port
  @port
end

#replication_methodObject

Returns the value of attribute replication_method.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def replication_method
  @replication_method
end

#ssl_modeObject

Returns the value of attribute ssl_mode.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def ssl_mode
  @ssl_mode
end

#tunnel_methodObject

Returns the value of attribute tunnel_method.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def tunnel_method
  @tunnel_method
end

#typeObject

Returns the value of attribute type.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def type
  @type
end

#usernameObject

Returns the value of attribute username.



9
10
11
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 9

def username
  @username
end

Instance Method Details

#configurationObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/airbyte_ruby/adapters/postgres.rb', line 25

def configuration
  {
    host: @host,
    port: @port,
    database: @database,
    schema: @schema,
    username: @username,
    password: @password,
    ssl_mode: @ssl_mode,
    replication_method: @replication_method,
    tunnel_method: @tunnel_method
  }
end