Skip to content

Commit

Permalink
feat: add protocol changes for cursor based (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
afthabvp authored and macintushar committed Apr 20, 2024
1 parent 632523b commit f418fbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integrations/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
multiwoven-integrations (0.1.55)
multiwoven-integrations (0.1.56)
activesupport
async-websocket
csv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Stream < ProtocolModel
attribute? :supported_sync_modes, Types::Array.of(SyncMode).optional.default(["incremental"])

# Applicable for database streams
attribute? :source_defined_cursor, Types::Bool.optional
attribute? :source_defined_cursor, Types::Bool.default(false).optional
attribute? :default_cursor_field, Types::Array.of(Types::String).optional
attribute? :source_defined_primary_key, Types::Array.of(Types::Array.of(Types::String)).optional
attribute? :namespace, Types::String.optional
Expand Down Expand Up @@ -168,6 +168,7 @@ class SyncConfig < ProtocolModel
attribute :stream, Stream
attribute :sync_mode, SyncMode
attribute? :cursor_field, Types::String.optional
attribute? :current_cursor_field, Types::String.optional
attribute :destination_sync_mode, DestinationSyncMode
end

Expand Down
2 changes: 1 addition & 1 deletion integrations/lib/multiwoven/integrations/rollout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Multiwoven
module Integrations
VERSION = "0.1.55"
VERSION = "0.1.56"

ENABLED_SOURCES = %w[
Snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module Integrations::Protocol
expect(instance.batch_support).to eq(false)
expect(instance.batch_size).to eq(1)
expect(instance.supported_sync_modes).to eq(%w[full_refresh incremental])
expect(instance.source_defined_cursor).to eq(true)

expect(instance.request_rate_limit).to be_nil
expect(instance.request_rate_limit_unit).to eq("minute")
Expand Down Expand Up @@ -290,6 +291,7 @@ module Integrations::Protocol
"sync_mode": "full_refresh",
"destination_sync_mode": "insert",
"cursor_field": "example_cursor_field",
"current_cursor_field": "current",
"offset": "100",
"limit": "10"
}.to_json
Expand All @@ -306,6 +308,7 @@ module Integrations::Protocol
expect(sync_config.sync_mode).to eq("full_refresh")
expect(sync_config.destination_sync_mode).to eq("insert")
expect(sync_config.cursor_field).to eq("example_cursor_field")
expect(sync_config.current_cursor_field).to eq("current")
sync_config.limit = "10"
sync_config.offset = "100"
expect(sync_config.offset).to eq("100")
Expand Down

0 comments on commit f418fbe

Please sign in to comment.