-
Notifications
You must be signed in to change notification settings - Fork 693
Expand file tree
/
Copy path23table.js
More file actions
executable file
·72 lines (58 loc) · 1.28 KB
/
23table.js
File metadata and controls
executable file
·72 lines (58 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
//
// Table class for Alasql.js
// Date: 14.11.2014
// (c) 2014, Andrey Gershun
//
*/
// Table class
var Table = (alasql.Table = function (params) {
// Step 1: Data array
this.data = [];
// Step 2: Columns
this.columns = [];
this.xcolumns = {};
// Step 3: indices
this.inddefs = {};
this.indices = {};
this.uniqs = {};
this.uniqdefs = {};
// Step 4: identities
this.identities = {};
// Step 5: checkfn...
this.checks = [];
this.checkfns = []; // For restore... to be done...
// Step 5.5: Foreign keys
this.foreignKeys = []; // Stores foreign key relationships for CASCADE operations
// Step 6: INSERT/DELETE/UPDATE
// Step 7: Triggers...
// Create trigger hubs
this.beforeinsert = {};
this.afterinsert = {};
this.insteadofinsert = {};
this.beforedelete = {};
this.afterdelete = {};
this.insteadofdelete = {};
this.beforeupdate = {};
this.afterupdate = {};
this.insteadofupdate = {};
// Done
Object.assign(this, params);
});
/*/*
// View = function(){
// this.data = [];
// this.columns = [];
// this.ixcolumns = {};
// this.ixdefs = {};
// this.indices = {};
// };
// alasql.View = View;
*/
Table.prototype.indexColumns = function () {
var self = this;
self.xcolumns = {};
self.columns.forEach(function (col) {
self.xcolumns[col.columnid] = col;
});
};