Skip to content

Commit

Permalink
fix(): updated postgres schema
Browse files Browse the repository at this point in the history
  • Loading branch information
le-vlad committed Feb 11, 2024
1 parent a20168b commit 38eb21e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/sources/postgres_cdc/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/usedatabrew/blink/internal/sources"
"github.com/usedatabrew/message"
"github.com/usedatabrew/pglogicalstream"
"strings"
)

type SourcePlugin struct {
Expand Down Expand Up @@ -94,7 +95,12 @@ func (p *SourcePlugin) buildPluginsSchema() []pglogicalstream.DbTablesSchema {
var tablesSchema []pglogicalstream.DbTablesSchema
for _, stream := range p.streamSchema {
tSch := pglogicalstream.DbTablesSchema{}
tSch.Table = fmt.Sprintf("%s.%s", p.config.Schema, stream.StreamName)
if len(strings.Split(stream.StreamName, ".")) == 2 {
// schema name included in stream.
tSch.Table = stream.StreamName
} else {
tSch.Table = fmt.Sprintf("%s.%s", p.config.Schema, stream.StreamName)
}
for _, schemaCol := range stream.Columns {
tSch.Columns = append(tSch.Columns, pglogicalstream.DbSchemaColumn{
Name: schemaCol.Name,
Expand Down

0 comments on commit 38eb21e

Please sign in to comment.