Skip to content

Commit

Permalink
remove DuckDBClientReport utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Oct 21, 2024
1 parent d72f0c3 commit d6fc020
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
6 changes: 1 addition & 5 deletions docs/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ However, for performance and ergonomy, we strongly recommend adding all the exte

<div class="tip">

Since some extensions are autoloading, it can be hard to tell which ones are
effectively in use. You can inspect the network tab in your browser, or (in
preview only), open your browser console and type `DuckDBClientReport()` — this
utility offers additional information, such as the path used for self-hosted
extensions.
To tell which extensions are effectively in use on a page, inspect the network tab in your browser, or run the following query: `FROM duckdb_extensions() WHERE loaded;`.

</div>

Expand Down
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export async function build(
await effects.writeFile(alias, contents);
}
}
const duckdb_manifest = await duckDBManifest(duckdb, {root, log: true, aliases});
const duckdb_manifest = await duckDBManifest(duckdb, {root, aliases});

// Generate the client bundles. These are initially generated into the cache
// because we need to rewrite any npm and node imports to be hashed; this is
Expand Down
16 changes: 0 additions & 16 deletions src/client/stdlib/duckdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,6 @@ Object.defineProperty(DuckDBClient.prototype, "dialect", {value: "duckdb"});
async function registerExtensions(db, {load}) {
const connection = await db.connect();
try {
// Preview adds a DuckDBClientReport utility to the console. We don’t add it
// in the public build so as not to pollute the window.
if (manifest.log) {
window.DuckDBClientReport = async () => {
const connection = await db.connect();
try {
const refs = new Map(extensions);
const ext = await connection.query(
"SELECT extension_name, description FROM duckdb_extensions() WHERE loaded;"
);
console.table(Array.from(ext, (e) => ({...e, ...refs.get(e.extension_name)})));
} finally {
await connection.close();
}
};
}
await Promise.all(
extensions.map(([name, {ref, load: l}]) =>
connection
Expand Down
5 changes: 2 additions & 3 deletions src/duckdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const downloadRequests = new Map<string, Promise<string>>();

export async function duckDBManifest(
duckdb: DuckDBConfig,
{root, log, aliases}: {root: string; log?: boolean; aliases?: Map<string, string>}
{root, aliases}: {root: string; aliases?: Map<string, string>}
) {
return {
bundles: duckdb.bundles,
Expand All @@ -26,8 +26,7 @@ export async function duckDBManifest(
}
];
})
),
log
)
};
}

Expand Down

0 comments on commit d6fc020

Please sign in to comment.