Skip to content
Merged
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
13 changes: 6 additions & 7 deletions src/connections/duckdb/duckdb.extractor.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,13 @@ export default class DuckDBSchemaExtractor {
}

async extractSchema(): Promise<{ tables: Table[] }> {
const [tableRefsRaw, viewRefsRaw] = await Promise.all([
this.getTables(),
this.getViews(),
]);
// Read one after the other: each read opens the file, and on Windows a
// second open while the first is still open fails on the file lock, so
// that list came back empty.
const tableRefsRaw = await this.getTables();
const viewRefsRaw = await this.getViews();

// Deduplicate defensively: concurrent connections against the same
// database file (opened separately for the tables and views queries)
// have been observed to yield repeated rows on Windows.
// Deduplicate defensively against repeated rows.
const tableRefs = uniqueRefs(tableRefsRaw);
// Tables and views are read as two separate snapshots, so a name that
// was replaced (table -> view or vice versa) mid-refresh could show up
Expand Down
Loading