@observablehq/notebook-kit 1.2.0-rc.2 → 1.2.0
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/bin/query.js +3 -2
- package/dist/package.json +1 -1
- package/dist/src/databases/bigquery.d.ts +8 -1
- package/dist/src/databases/databricks.d.ts +13 -1
- package/dist/src/databases/duckdb.d.ts +8 -1
- package/dist/src/databases/index.d.ts +6 -49
- package/dist/src/databases/postgres.d.ts +10 -1
- package/dist/src/databases/snowflake.d.ts +11 -1
- package/dist/src/databases/sqlite-bun.d.ts +2 -1
- package/dist/src/databases/sqlite-node.d.ts +2 -1
- package/dist/src/databases/sqlite.d.ts +4 -0
- package/package.json +1 -1
package/dist/bin/query.js
CHANGED
|
@@ -17,7 +17,8 @@ export default async function run(args) {
|
|
|
17
17
|
default: "."
|
|
18
18
|
},
|
|
19
19
|
database: {
|
|
20
|
-
type: "string"
|
|
20
|
+
type: "string",
|
|
21
|
+
default: "duckdb"
|
|
21
22
|
},
|
|
22
23
|
help: {
|
|
23
24
|
type: "boolean",
|
|
@@ -28,7 +29,7 @@ export default async function run(args) {
|
|
|
28
29
|
if (values.help || !values.database) {
|
|
29
30
|
console.log(`usage: notebooks query <...query>
|
|
30
31
|
|
|
31
|
-
--database <name> name of the database
|
|
32
|
+
--database <name> name of the database; defaults to duckdb
|
|
32
33
|
--root <dir> path to the root directory; defaults to cwd
|
|
33
34
|
-h, --help show this message
|
|
34
35
|
`);
|
package/dist/package.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryTemplateFunction } from "./index.js";
|
|
2
|
+
export type BigQueryConfig = {
|
|
3
|
+
type: "bigquery";
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
keyFilename?: string;
|
|
6
|
+
keyFile?: string;
|
|
7
|
+
projectId?: string;
|
|
8
|
+
};
|
|
2
9
|
export default function bigquery({ type, ...options }: BigQueryConfig): QueryTemplateFunction;
|
|
3
10
|
export declare function replacer(this: {
|
|
4
11
|
[key: string]: unknown;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryTemplateFunction } from "./index.js";
|
|
2
|
+
export type DatabricksConfig = {
|
|
3
|
+
type: "databricks";
|
|
4
|
+
host: string;
|
|
5
|
+
path: string;
|
|
6
|
+
} & ({
|
|
7
|
+
authType?: "access-token";
|
|
8
|
+
token: string;
|
|
9
|
+
} | {
|
|
10
|
+
authType: "databricks-oauth";
|
|
11
|
+
oauthClientId?: string;
|
|
12
|
+
oauthClientSecret?: string;
|
|
13
|
+
});
|
|
2
14
|
export default function databricks({ type, ...options }: DatabricksConfig): QueryTemplateFunction;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryTemplateFunction } from "./index.js";
|
|
2
|
+
export type DuckDBConfig = {
|
|
3
|
+
type: "duckdb";
|
|
4
|
+
path?: string;
|
|
5
|
+
options?: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
2
9
|
export default function duckdb({ path, options }: DuckDBConfig): QueryTemplateFunction;
|
|
@@ -1,54 +1,11 @@
|
|
|
1
1
|
import type { ColumnSchema, QueryParam } from "../runtime/index.js";
|
|
2
|
+
import type { BigQueryConfig } from "./bigquery.js";
|
|
3
|
+
import type { DatabricksConfig } from "./databricks.js";
|
|
4
|
+
import type { DuckDBConfig } from "./duckdb.js";
|
|
5
|
+
import type { SQLiteConfig } from "./sqlite.js";
|
|
6
|
+
import type { SnowflakeConfig } from "./snowflake.js";
|
|
7
|
+
import type { PostgresConfig } from "./postgres.js";
|
|
2
8
|
export type DatabaseConfig = BigQueryConfig | DatabricksConfig | DuckDBConfig | SQLiteConfig | SnowflakeConfig | PostgresConfig;
|
|
3
|
-
export type BigQueryConfig = {
|
|
4
|
-
type: "bigquery";
|
|
5
|
-
apiKey?: string;
|
|
6
|
-
keyFilename?: string;
|
|
7
|
-
keyFile?: string;
|
|
8
|
-
projectId?: string;
|
|
9
|
-
};
|
|
10
|
-
export type DatabricksConfig = {
|
|
11
|
-
type: "databricks";
|
|
12
|
-
host: string;
|
|
13
|
-
path: string;
|
|
14
|
-
} & ({
|
|
15
|
-
authType?: "access-token";
|
|
16
|
-
token: string;
|
|
17
|
-
} | {
|
|
18
|
-
authType: "databricks-oauth";
|
|
19
|
-
oauthClientId?: string;
|
|
20
|
-
oauthClientSecret?: string;
|
|
21
|
-
});
|
|
22
|
-
export type DuckDBConfig = {
|
|
23
|
-
type: "duckdb";
|
|
24
|
-
path?: string;
|
|
25
|
-
options?: {
|
|
26
|
-
[key: string]: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type SQLiteConfig = {
|
|
30
|
-
type: "sqlite";
|
|
31
|
-
path?: string;
|
|
32
|
-
};
|
|
33
|
-
export type SnowflakeConfig = {
|
|
34
|
-
type: "snowflake";
|
|
35
|
-
account: string;
|
|
36
|
-
database?: string;
|
|
37
|
-
role?: string;
|
|
38
|
-
schema?: string;
|
|
39
|
-
username?: string;
|
|
40
|
-
warehouse?: string;
|
|
41
|
-
password?: string;
|
|
42
|
-
};
|
|
43
|
-
export type PostgresConfig = {
|
|
44
|
-
type: "postgres";
|
|
45
|
-
host?: string;
|
|
46
|
-
port?: string | number;
|
|
47
|
-
username?: string;
|
|
48
|
-
password?: string;
|
|
49
|
-
database?: string;
|
|
50
|
-
ssl?: boolean;
|
|
51
|
-
};
|
|
52
9
|
export type QueryTemplateFunction = (strings: readonly string[], ...params: QueryParam[]) => Promise<SerializableQueryResult>;
|
|
53
10
|
export type SerializableQueryResult = {
|
|
54
11
|
rows: Record<string, unknown>[];
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueryTemplateFunction } from "./index.js";
|
|
2
|
+
export type PostgresConfig = {
|
|
3
|
+
type: "postgres";
|
|
4
|
+
host?: string;
|
|
5
|
+
port?: string | number;
|
|
6
|
+
username?: string;
|
|
7
|
+
password?: string;
|
|
8
|
+
database?: string;
|
|
9
|
+
ssl?: boolean;
|
|
10
|
+
};
|
|
2
11
|
export default function postgres(options: PostgresConfig): QueryTemplateFunction;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { QueryTemplateFunction
|
|
1
|
+
import { QueryTemplateFunction } from "./index.js";
|
|
2
|
+
export type SnowflakeConfig = {
|
|
3
|
+
type: "snowflake";
|
|
4
|
+
account: string;
|
|
5
|
+
database?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
schema?: string;
|
|
8
|
+
username?: string;
|
|
9
|
+
warehouse?: string;
|
|
10
|
+
password?: string;
|
|
11
|
+
};
|
|
2
12
|
export default function snowflake(options: SnowflakeConfig): QueryTemplateFunction;
|
|
3
13
|
export declare function replacer(this: {
|
|
4
14
|
[key: string]: unknown;
|