Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions assets/svelte/consumers/ShowBackfills.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,29 @@
>{selectedBackfill.table_name}</span
>
</div>
{#if selectedBackfill.sort_column_name}
<div class="flex justify-between items-center">
<span class="text-sm font-medium text-gray-500">Type:</span>
<span class="text-sm text-gray-900">Partial</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm font-medium text-gray-500">Sort Column:</span
>
<span class="text-sm text-gray-900"
>{selectedBackfill.sort_column_name}</span
>
</div>
{#if selectedBackfill.start_value != null}
<div class="flex justify-between items-center">
<span class="text-sm font-medium text-gray-500"
>Start Value:</span
>
<span class="text-sm text-gray-900"
>{selectedBackfill.start_value}</span
>
</div>
{/if}
{/if}
{#if selectedBackfill.rows_initial_count !== null}
<div class="flex justify-between items-center">
<span class="text-sm font-medium text-gray-500">Total Rows:</span>
Expand Down
Binary file added backfill-drawer-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/sequin/transforms/transforms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,7 @@ defmodule Sequin.Transforms do
end

# Helper to parse auth_type
defp parse_auth_type("none"), do: :none
defp parse_auth_type("api_key"), do: :api_key
defp parse_auth_type("basic"), do: :basic
defp parse_auth_type("bearer"), do: :bearer
Expand Down
15 changes: 14 additions & 1 deletion lib/sequin_web/live/sink_consumers/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,17 @@ defmodule SequinWeb.SinkConsumersLive.Show do

table_name = if table, do: "#{table.schema}.#{table.name}", else: "Unknown table"

sort_column_name =
if table && backfill.sort_column_attnum do
column = Enum.find(table.columns, &(&1.attnum == backfill.sort_column_attnum))
if column, do: column.name
end

start_value =
if sort_column_name && backfill.initial_min_cursor do
Map.get(backfill.initial_min_cursor, backfill.sort_column_attnum)
end

%{
id: backfill.id,
state: backfill.state,
Expand All @@ -1689,7 +1700,9 @@ defmodule SequinWeb.SinkConsumersLive.Show do
failed_at: backfill.failed_at,
updated_at: backfill.updated_at,
progress: calculate_backfill_progress(backfill),
error: if(backfill.error, do: Exception.message(backfill.error))
error: if(backfill.error, do: Exception.message(backfill.error)),
sort_column_name: sort_column_name,
start_value: start_value
}
end

Expand Down
30 changes: 30 additions & 0 deletions test/sequin/yaml_loader_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,36 @@ defmodule Sequin.YamlLoaderTest do
} = consumer.sink
end

test "creates elasticsearch sink consumer with auth_type none" do
assert :ok =
YamlLoader.apply_from_yml!("""
#{account_and_db_yml()}

sinks:
- name: "elasticsearch-no-auth"
database: "test-db"
destination:
type: "elasticsearch"
endpoint_url: "https://elasticsearch.example.com"
index_name: "test-index"
auth_type: "none"
batch_size: 100
""")

assert [consumer] = Repo.all(SinkConsumer)

assert consumer.name == "elasticsearch-no-auth"

assert %ElasticsearchSink{
type: :elasticsearch,
endpoint_url: "https://elasticsearch.example.com",
index_name: "test-index",
auth_type: :none,
auth_value: nil,
batch_size: 100
} = consumer.sink
end

test "creates redis string sink consumer" do
assert :ok =
YamlLoader.apply_from_yml!("""
Expand Down
Loading