detect non-local sql tables#1636
Conversation
|
We can probably refine a little with this change: diff --git a/src/render.ts b/src/render.ts
index 926f24e1..4b2f2efe 100644
--- a/src/render.ts
+++ b/src/render.ts
@@ -59,7 +59,7 @@ if (location.pathname.endsWith("/")) {
import ${preview || page.code.length ? `{${preview ? "open, " : ""}define} from ` : ""}${JSON.stringify(
resolveImport("observablehq:client")
)};${
- files.size || data?.sql
+ files.size
? `\nimport {registerFile${data?.sql ? ", FileAttachment" : ""}} from ${JSON.stringify(
resolveImport("observablehq:stdlib")
)};`
and skip an unnecessary import of stdlib. It passes all the tests but at this point I'm wary of introducing a last-minute bug. |
|
Okay, added. I tested, but I can’t load the Parquet file from blobs.duckdb.org anymore because of a CORS error, which is odd because I thought it worked before. The generated code looks fine though. 🤷 |
|
It worked before for me too, and now I also got the CORS error. But substituting a different URL confirms this works. (We still have |
|
I don’t think it’s possible to avoid loading the Observable standard library entirely; see |
Fixes #1635.