Skip to content

Commit

Permalink
self review
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anshul committed Sep 8, 2023
1 parent ea178e0 commit 15a3a5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions runtime/drivers/duckdb/transporter/sqlextension_to_duckDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (t *sqlextensionToDuckDB) Transfer(ctx context.Context, source drivers.Sour
return fmt.Errorf("type of source should be `drivers.DatabaseSink`")
}

extensionName := extName(t.from.Driver())
extensionName := t.from.Driver()
if err := t.to.Exec(ctx, &drivers.Statement{Query: fmt.Sprintf("INSTALL '%s'; LOAD '%s';", extensionName, extensionName)}); err != nil {
return fmt.Errorf("failed to load %s extension %w", extensionName, err)
}
Expand All @@ -48,8 +48,3 @@ func (t *sqlextensionToDuckDB) Transfer(ctx context.Context, source drivers.Sour

return t.to.Exec(ctx, &drivers.Statement{Query: query, Priority: 1})
}

func extName(name string) string {
before, _ := strings.CutSuffix(name, "_ext")
return before
}
2 changes: 1 addition & 1 deletion runtime/drivers/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (d driver) Spec() drivers.Spec {
Required: true,
DisplayName: "SQL",
Description: "Query to extract data from SQLite",
Placeholder: "SELECT * FROM sqlite_scan('/Users/kanshul/.config/gcloud/access_tokens.db', 'film');",
Placeholder: "SELECT * FROM sqlite_scan('sqlite.db', 'film');",
Hint: "https://duckdb.org/docs/extensions/sqlite_scanner#querying-individual-tables",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</TabGroup>
</div>
<div class="flex-grow overflow-y-auto">
{#if selectedConnector?.name === "gcs" || selectedConnector?.name === "s3" || selectedConnector?.name === "https" || selectedConnector?.name === "motherduck" || selectedConnector?.name === "postgres_ext" || selectedConnector?.name === "sqlite"}
{#if selectedConnector?.name === "gcs" || selectedConnector?.name === "s3" || selectedConnector?.name === "https" || selectedConnector?.name === "motherduck" || selectedConnector?.name === "bigquery" || selectedConnector?.name === "sqlite"}
{#key selectedConnector}
<RemoteSourceForm connector={selectedConnector} on:close />
{/key}
Expand Down

0 comments on commit 15a3a5c

Please sign in to comment.