diff --git a/examples/nextjs-import-airbyte-github-export-seafowl/components/EmbeddedQuery/EmbeddedQuery.tsx b/examples/nextjs-import-airbyte-github-export-seafowl/components/EmbeddedQuery/EmbeddedQuery.tsx index ccc9053..92ac38b 100644 --- a/examples/nextjs-import-airbyte-github-export-seafowl/components/EmbeddedQuery/EmbeddedQuery.tsx +++ b/examples/nextjs-import-airbyte-github-export-seafowl/components/EmbeddedQuery/EmbeddedQuery.tsx @@ -24,6 +24,7 @@ export const ExportEmbedPreviewTableOrQuery = < importedRepository, exportInput, makeQuery, + makeSeafowlQuery, makeMatchInputToExported, }: { exportInput: ExportInputShape; @@ -33,6 +34,12 @@ export const ExportEmbedPreviewTableOrQuery = < splitgraphRepository: string; } ) => string; + makeSeafowlQuery?: ( + tableOrQueryInput: ExportInputShape & { + splitgraphNamespace: string; + splitgraphRepository: string; + } + ) => string; makeMatchInputToExported: ( tableOrQueryInput: ExportInputShape ) => (exported: ExportTable) => boolean; @@ -158,7 +165,15 @@ export const ExportEmbedPreviewTableOrQuery = < display: selectedTab === "splitgraph" ? "none" : "block", }} > - + + makeSeafowlQuery({ ...exportInput, ...importedRepository }) + : embedProps.makeQuery + } + /> )} diff --git a/examples/nextjs-import-airbyte-github-export-seafowl/components/ImportExportStepper/ExportPanel.tsx b/examples/nextjs-import-airbyte-github-export-seafowl/components/ImportExportStepper/ExportPanel.tsx index 264609b..716cbc2 100644 --- a/examples/nextjs-import-airbyte-github-export-seafowl/components/ImportExportStepper/ExportPanel.tsx +++ b/examples/nextjs-import-airbyte-github-export-seafowl/components/ImportExportStepper/ExportPanel.tsx @@ -323,7 +323,13 @@ const ExportPreview = ({ key={`export-query-preview-${exportQuery.destinationTable}-${exportQuery.destinationSchema}`} exportInput={exportQuery} importedRepository={{ splitgraphNamespace, splitgraphRepository }} + // This is the query we run on Splitgraph that we exported to Seafowl makeQuery={({ sourceQuery }) => sourceQuery} + // But once it's exported, we can just select from its table in Seafowl (and + // besides, the sourceQuery might not be compatible with Seafowl anyway) + makeSeafowlQuery={({ destinationSchema, destinationTable }) => + `SELECT * FROM "${destinationSchema}"."${destinationTable}";` + } makeMatchInputToExported={(exportQueryInput) => (exportTable: ExportTable) => { return (