Skip to content

Commit 444597c

Browse files
authored
Merge pull request #3119 from perspective-dev/clickhouse-2
Clickhouse Virtual Server
2 parents 1269703 + 361eefc commit 444597c

File tree

47 files changed

+2488
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2488
-804
lines changed

.cargo/config.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
bundle = "run -p perspective-bundle"
33

44
[build]
5-
# rustflags = ["--cfg=web_sys_unstable_apis", "--cfg=pyo3_disable_reference_pool"]
65
rustflags = ["--cfg=web_sys_unstable_apis", "-Csymbol-mangling-version=v0"]
6+
# rustflags = [
7+
# "--cfg=web_sys_unstable_apis",
8+
# "--cfg=pyo3_disable_reference_pool",
9+
# "-Csymbol-mangling-version=legacy",
10+
# "-Zunstable-options",
11+
# ]
712
target-dir = "rust/target"
813

914
[target.wasm32-unknown-unknown]

Cargo.lock

Lines changed: 61 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/blocks/src/duckdb/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ await loadSampleData(db);
9090
const viewer = document.querySelector("#query");
9191
viewer.load(client);
9292
viewer.restore({
93-
table: "data_source_one",
93+
table: "memory.data_source_one",
9494
group_by: ["Region", "State", "City"],
9595
columns: ["Sales", "Profit", "Quantity", "Discount"],
9696
plugin: "Datagrid",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2+
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
3+
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
4+
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
5+
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
6+
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
7+
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
8+
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
9+
// ┃ This file is part of the Perspective library, distributed under the terms ┃
10+
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11+
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12+
13+
import esbuild from "esbuild";
14+
import fs from "fs";
15+
import path from "path";
16+
import { fileURLToPath } from "url";
17+
import { dirname } from "path";
18+
import "zx/globals";
19+
20+
const __dirname = dirname(fileURLToPath(import.meta.url));
21+
22+
async function build() {
23+
await esbuild.build({
24+
entryPoints: ["src/index.ts"],
25+
outdir: "dist",
26+
format: "esm",
27+
bundle: true,
28+
sourcemap: "inline",
29+
target: "es2022",
30+
loader: {
31+
".ttf": "file",
32+
".wasm": "file",
33+
},
34+
assetNames: "[name]",
35+
});
36+
37+
fs.writeFileSync(
38+
path.join(__dirname, "dist/index.html"),
39+
fs.readFileSync(path.join(__dirname, "src/index.html")).toString(),
40+
);
41+
}
42+
43+
await build();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "esbuild-clickhouse-virtual",
3+
"private": true,
4+
"version": "4.1.1",
5+
"type": "module",
6+
"description": "Example of a custom VirtualServer for ClickHouse running in a Web Worker",
7+
"scripts": {
8+
"build": "node build.js",
9+
"start": "node build.js && node server.mjs"
10+
},
11+
"keywords": [],
12+
"license": "Apache-2.0",
13+
"dependencies": {
14+
"@perspective-dev/client": "workspace:^",
15+
"@perspective-dev/server": "workspace:^",
16+
"@perspective-dev/viewer": "workspace:^",
17+
"@perspective-dev/viewer-d3fc": "workspace:^",
18+
"@perspective-dev/viewer-datagrid": "workspace:^",
19+
"@clickhouse/client-web": "catalog:"
20+
},
21+
"devDependencies": {
22+
"esbuild": "catalog:",
23+
"zx": "catalog:"
24+
}
25+
}

0 commit comments

Comments
 (0)