forked from brianc/node-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolumn.js
More file actions
33 lines (31 loc) · 991 Bytes
/
column.js
File metadata and controls
33 lines (31 loc) · 991 Bytes
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
'use strict';
var Node = require(__dirname);
module.exports = Node.define({
type: 'COLUMN',
constructor: function(config) {
Node.call(this);
this.name = config.name;
this.property = config.property || config.name;
this.alias = config.alias;
this.star = config.star;
this.asArray = config.asArray;
this.aggregator = config.aggregator;
this.table = config.table;
this.value = config.getValue();
this.dataType = config.dataType;
this.distinct = config.distinct;
this.primaryKey = config.primaryKey;
this.notNull = config.notNull;
this.references = config.references;
// If subfieldContainer is present, this is a subfield and subfieldContainer
// is the parent Column
this.subfieldContainer = config.subfieldContainer;
this.subfields = config.subfields;
this.autoGenerated = !!config.autoGenerated;
this.unique = !!config.unique;
},
as: function(alias) {
this.alias = alias;
return this;
}
});