Skip to content

Commit 528c9ff

Browse files
authored
Merge pull request #642 from GraphScope/chore-1217
2 parents 3dffe36 + fe850c3 commit 528c9ff

File tree

39 files changed

+264
-99
lines changed

39 files changed

+264
-99
lines changed

examples/graphy/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @graphscope/graphy-website
22

3+
## 0.1.6
4+
5+
### Patch Changes
6+
7+
- update studio graph
8+
- Updated dependencies
9+
- @graphscope/studio-importor@0.1.12
10+
- @graphscope/studio-graph@0.1.12
11+
- @graphscope/studio-components@0.1.12
12+
- @graphscope/studio-driver@0.1.10
13+
- @graphscope/studio-query@0.1.12
14+
315
## 0.1.5
416

517
### Patch Changes

examples/graphy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphscope/graphy-website",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "",
55
"main": "lib/index.js",
66
"module": "es/index.js",

examples/graphy/src/kuzu-driver/index.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class KuzuDriver {
245245

246246
console.log('Schema created: ', result);
247247
}
248-
async uploadCsvFile(file: File): Promise<any> {
248+
async uploadCsvFile(file: File, meta): Promise<any> {
249249
return new Promise((resolve, reject) => {
250250
if (file) {
251251
const reader = new FileReader();
@@ -258,10 +258,11 @@ export class KuzuDriver {
258258
var label_name = file.name.split('.')[0];
259259
await this.FS.writeFile(filePath, fileData);
260260
var res;
261+
262+
const { delimiter } = meta;
261263
res = await this.conn?.execute(
262-
`COPY ${label_name} FROM "${filePath}" (HEADER=true, DELIM="|", ESCAPE='"', QUOTE='"');`,
264+
`COPY ${label_name} FROM "${filePath}" (HEADER=true, DELIM='${delimiter}');`,
263265
);
264-
console.log('File uploaded successfully!', filePath);
265266
resolve(res); // Resolve the Promise
266267
} catch (error) {
267268
reject(error); // Reject the Promise on error
@@ -279,15 +280,23 @@ export class KuzuDriver {
279280
});
280281
}
281282
async loadGraph(data_files: File[]): Promise<any> {
283+
const logs: any = {
284+
nodes: [],
285+
edges: [],
286+
};
287+
282288
for (const node of this.schema.nodes) {
283289
const file = data_files.find(item => {
284290
//@ts-ignore
285291
return item.name === node.label + '.csv';
286292
});
287293
if (file) {
288294
console.log('node: ', file.name);
289-
await this.uploadCsvFile(file).then(res => {
290-
console.log('Response received:', res.toString());
295+
await this.uploadCsvFile(file, node.meta).then(res => {
296+
logs.nodes.push({
297+
name: file.name,
298+
message: res.toString(),
299+
});
291300
});
292301
}
293302
}
@@ -297,14 +306,15 @@ export class KuzuDriver {
297306
return item.name === edge.label + '.csv';
298307
});
299308
if (file) {
300-
console.log('edge: ', file.name);
301-
await this.uploadCsvFile(file).then(res => {
302-
console.log('Response received:', res.toString());
309+
await this.uploadCsvFile(file, edge.meta).then(res => {
310+
logs.edges.push({
311+
name: file.name,
312+
message: res.toString(),
313+
});
303314
});
304315
}
305316
}
306-
307-
return true;
317+
return logs;
308318
}
309319

310320
pathJoin(...segments) {

packages/studio-components/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @graphscope/studio-components
22

3+
## 0.1.12
4+
5+
### Patch Changes
6+
7+
- update studio graph
8+
39
## 0.1.11
410

511
### Patch Changes

packages/studio-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphscope/studio-components",
3-
"version": "0.1.11",
3+
"version": "0.1.12",
44
"description": "A components for graphscope studio",
55
"main": "lib/index.js",
66
"module": "es/index.js",

packages/studio-draw-pattern/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @graphscope/studio-draw-pattern
22

3+
## 0.0.8
4+
5+
### Patch Changes
6+
7+
- update studio graph
8+
- Updated dependencies
9+
- @graphscope/studio-components@0.1.12
10+
- @graphscope/studio-graph-editor@0.1.6
11+
312
## 0.0.7
413

514
### Patch Changes

packages/studio-draw-pattern/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphscope/studio-draw-pattern",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Experiment draw pattern code for GrapeScope",
55
"module": "dist/esm/index.js",
66
"types": "dist/esm/index.d.ts",

packages/studio-driver/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @graphscope/studio-driver
22

3+
## 0.1.10
4+
5+
### Patch Changes
6+
7+
- update studio graph
8+
39
## 0.1.9
410

511
### Patch Changes

packages/studio-driver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphscope/studio-driver",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "A library provides a unified interface for interacting with graph databases",
55
"main": "lib/index.js",
66
"module": "es/index.js",

packages/studio-explore/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @graphscope/studio-explore
22

3+
## 0.1.10
4+
5+
### Patch Changes
6+
7+
- update studio graph
8+
- Updated dependencies
9+
- @graphscope/studio-importor@0.1.12
10+
- @graphscope/studio-graph@0.1.12
11+
- @graphscope/graphy-website@0.1.6
12+
- @graphscope/studio-components@0.1.12
13+
- @graphscope/studio-driver@0.1.10
14+
- @graphscope/studio-query@0.1.12
15+
316
## 0.1.9
417

518
### Patch Changes

0 commit comments

Comments
 (0)