@observablehq/notebook-kit 1.1.0-rc.13 → 1.1.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/observablehq/notebook-kit.git"
7
7
  },
8
- "version": "1.1.0-rc.13",
8
+ "version": "1.1.0-rc.15",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "test": "vitest",
@@ -38,7 +38,7 @@ export async function getDatabase(config, context) {
38
38
  case "duckdb":
39
39
  return (await import("./duckdb.js")).default(config, context);
40
40
  case "sqlite":
41
- return (await (typeof Bun !== "undefined" ? import("./sqlite-bun.js") : import("./sqlite-node.js"))).default(config, context);
41
+ return (await import(process.versions.bun ? "./sqlite-bun.js" : "./sqlite-node.js")).default(config, context);
42
42
  case "snowflake":
43
43
  return (await import("./snowflake.js")).default(config);
44
44
  case "postgres":
@@ -1,12 +1,10 @@
1
1
  import { join } from "node:path";
2
2
  import { Database } from "bun:sqlite";
3
3
  import { getColumnType } from "./sqlite.js";
4
- export default function sqlite({ path = ":memory:" }, context) {
5
- if (path !== undefined)
6
- path = join(context.cwd, path);
4
+ export default function sqlite({ path }, context) {
7
5
  return async (strings, ...params) => {
8
6
  const date = new Date();
9
- const database = new Database(path);
7
+ const database = new Database(path === undefined ? ":memory:" : join(context.cwd, path));
10
8
  try {
11
9
  const statement = database.prepare(strings.join("?"));
12
10
  const rows = statement.all(...params);
@@ -1,12 +1,10 @@
1
1
  import { join } from "node:path";
2
2
  import { DatabaseSync } from "node:sqlite";
3
3
  import { getColumnType } from "./sqlite.js";
4
- export default function sqlite({ path = ":memory:" }, context) {
5
- if (path !== undefined)
6
- path = join(context.cwd, path);
4
+ export default function sqlite({ path }, context) {
7
5
  return async (strings, ...params) => {
8
6
  const date = new Date();
9
- const database = new DatabaseSync(path);
7
+ const database = new DatabaseSync(path === undefined ? ":memory:" : join(context.cwd, path));
10
8
  try {
11
9
  const statement = database.prepare(strings.join("?"));
12
10
  const rows = statement.all(...params);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/observablehq/notebook-kit.git"
7
7
  },
8
- "version": "1.1.0-rc.13",
8
+ "version": "1.1.0-rc.15",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "test": "vitest",