goby-database 1.0.3 → 1.0.4
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/index.js +7 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -42,6 +42,7 @@ class Project{
|
|
|
42
42
|
save_class_meta:this.db.prepare(`UPDATE system_classlist set metadata = ? WHERE id = ?`),
|
|
43
43
|
update_window:this.db.prepare(`UPDATE system_windows set open = @open, type=@type, metadata = @meta WHERE id = @id`),
|
|
44
44
|
create_window: this.db.prepare(`INSERT INTO system_windows (type,open, metadata) VALUES (@type, @open, @meta)`),
|
|
45
|
+
get_windows:this.db.prepare(`SELECT id, type, open, metadata FROM system_windows`),
|
|
45
46
|
match_junction:this.db.prepare(`SELECT id, side_a, side_b, metadata FROM system_junctionlist WHERE (side_a = @input_1 AND side_b = @input_2 ) OR ( side_a = @input_2 AND side_b = @input_1 )`),
|
|
46
47
|
fuzzy_match_junction:this.db.prepare(`SELECT id, side_a, side_b, metadata FROM system_junctionlist WHERE (side_a LIKE @input_1 AND side_b LIKE @input_2 ) OR ( side_a LIKE @input_2 AND side_b LIKE @input_1 )`)
|
|
47
48
|
}
|
|
@@ -85,7 +86,7 @@ class Project{
|
|
|
85
86
|
this.create_table('system','windows',[
|
|
86
87
|
'id INTEGER NOT NULL PRIMARY KEY',
|
|
87
88
|
'type TEXT',
|
|
88
|
-
'open
|
|
89
|
+
'open INTEGER',
|
|
89
90
|
'metadata TEXT'
|
|
90
91
|
]);
|
|
91
92
|
|
|
@@ -692,6 +693,11 @@ class Project{
|
|
|
692
693
|
return classes;
|
|
693
694
|
}
|
|
694
695
|
|
|
696
|
+
retrieve_windows(){
|
|
697
|
+
let windows=this.run.get_windows.all();
|
|
698
|
+
windows.map(a=>a.metadata=JSON.parse(a.metadata));
|
|
699
|
+
return windows;
|
|
700
|
+
}
|
|
695
701
|
|
|
696
702
|
action_config_window(type,open,meta={pos:[null,null], size:[1000,700]},id){
|
|
697
703
|
if(id!==undefined){
|