The new update has resulted in most of my notebooks failing.
Main culprits seem to be database and imports.
How am I supposed to navigate this… this is huge.
Appreciate any help.
The new update has resulted in most of my notebooks failing.
Main culprits seem to be database and imports.
How am I supposed to navigate this… this is huge.
Appreciate any help.
In case others missed this like did, use old.observablehq.com instead of observablehq.com and everything’s funcitonal
Is there s concise old way > new way reference?
I’ve used Notebooks 2.0 for local projects, but I’m not sure what I should be using or not here on Observable?
Something like:
Old: db=DatabaseClient("foo");data=db.query(`blah`)
New: db=DatabaseClient("foo");data=(await db.sql(`blah`)).toArray()
Hi Ken, we’re very sorry for the disruption!
Yes, the full old interface lives on at https://old.observablehq.com/, and all your databases and imports should work the same there.
Your “New” code example is very close, but the sql method is designed to be used as a tagged template literal, so you don’t use parentheses; rather, it’d be:
(await db.sql`SELECT 1`).toArray()
We are working on making backwards compatibility as good as possible in the new interface. We shipped some improvements for DatabaseClient backwards compatibility last night, and we’re working on more right now. The goal is that if your standard library is set to 2018 — as it is for all pre-existing notebooks — DatabaseClient should keep working the same, so you can opt-in to the 2026 behavior if you so choose. Obviously that’s not working properly right now, but it should be better in just a couple hours.
The differences in DatabaseClient behavior are described more in this documentation https://observablehq.com/@observablehq/database-clients:
Differences from Notebooks 1.0
Users accustomed to using
DatabaseClientin the old Observable should be aware of a few differences.
DatabaseClientreturns synchronously instead of returning a promise. A database client now hasdialectandoptionsproperties (in addition toname). Thesqlmethod now returns a promise to a Flechette (Apache Arrow) Table rather than an array of objects. All methods other thansql(includingquery,queryStream,queryTag,queryRow,describeTables,describeColumns,escape) have been removed.As described above, the
sqlsupports caching and caching is enabled by default. This means that visiting a notebook no longer re-runs all queries, making the notebook load much faster and with stable results; but also the results are no longer live. Since the cache is implemented using file attachments, everyone sees the same cached results, and old results are accessible in the history panel. Finally, you are now able to publish notebooks that query databases; take care to publish only what you intend to be public.
I’m happy to get on a call to chat more any time; email toph@observablehq.com if you want to schedule something.
I appreciate the response, effort, and complexity of what you all are doing… thanks!
Having “old.” available was a life-saver. I’m just digging into the new DB stuff now.
Needed const. Man, this is going to make my brain work… I’ve been working in here one way for a long time. ![]()
Your notebook on the left should’ve worked! In an OJS cell (the old-fashioned kind), you don’t need const. I think there’s a bug where the static analysis there is outdated so it doesn’t expect the DatabaseClient options object ({cache: false}). So that’s on us. Will take a look. Glad you worked it around anyway.
DatabaseClient options aren’t supported in Observable JavaScript cells, and query caching caching is disabled by default with the 2018 standard library. So in OJS, you’d just drop the {cache: false} entirely.