@sap/async-xsjs 1.0.2
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/CHANGELOG.md +26 -0
- package/LICENSE +37 -0
- package/README.md +445 -0
- package/differences.md +162 -0
- package/docs/$.Application.html +262 -0
- package/docs/$.Session.html +674 -0
- package/docs/$.db.CallableStatement.html +2524 -0
- package/docs/$.db.Connection.html +511 -0
- package/docs/$.db.ParameterMetaData.html +805 -0
- package/docs/$.db.PreparedStatement.html +1796 -0
- package/docs/$.db.ResultSet.html +1308 -0
- package/docs/$.db.ResultSetMetaData.html +800 -0
- package/docs/$.db.SQLException.html +259 -0
- package/docs/$.db.html +773 -0
- package/docs/$.hdb.ColumnMetadata.html +438 -0
- package/docs/$.hdb.Connection.html +663 -0
- package/docs/$.hdb.ProcedureResult.html +280 -0
- package/docs/$.hdb.ResultSet.html +324 -0
- package/docs/$.hdb.ResultSetIterator.html +315 -0
- package/docs/$.hdb.ResultSetMetaData.html +259 -0
- package/docs/$.hdb.SQLException.html +259 -0
- package/docs/$.hdb.html +557 -0
- package/docs/$.html +471 -0
- package/docs/$.jobs.Job.html +783 -0
- package/docs/$.jobs.JobLog.html +380 -0
- package/docs/$.jobs.JobSchedules.html +852 -0
- package/docs/$.jobs.html +238 -0
- package/docs/$.net.Destination.html +304 -0
- package/docs/$.net.Mail.Part.html +510 -0
- package/docs/$.net.Mail.html +504 -0
- package/docs/$.net.SMTPConnection.html +347 -0
- package/docs/$.net.html +749 -0
- package/docs/$.net.http.Client.html +562 -0
- package/docs/$.net.http.Destination.html +237 -0
- package/docs/$.net.http.Request.html +567 -0
- package/docs/$.net.http.html +292 -0
- package/docs/$.security.AntiVirus.html +361 -0
- package/docs/$.security.Store.html +636 -0
- package/docs/$.security.crypto.html +414 -0
- package/docs/$.security.html +247 -0
- package/docs/$.security.x509.html +373 -0
- package/docs/$.text.analysis.Session.html +983 -0
- package/docs/$.text.analysis.html +242 -0
- package/docs/$.text.html +246 -0
- package/docs/$.text.mining.Session.html +2018 -0
- package/docs/$.text.mining.html +242 -0
- package/docs/$.trace.html +525 -0
- package/docs/$.util.SAXParser.html +955 -0
- package/docs/$.util.Zip.html +474 -0
- package/docs/$.util.codec.html +414 -0
- package/docs/$.util.compression.html +357 -0
- package/docs/$.util.html +325 -0
- package/docs/$.util.sql.html +290 -0
- package/docs/$.web.Body.html +333 -0
- package/docs/$.web.EntityList.html +296 -0
- package/docs/$.web.TupelList.html +496 -0
- package/docs/$.web.WebEntityRequest.html +393 -0
- package/docs/$.web.WebEntityResponse.html +392 -0
- package/docs/$.web.WebRequest.html +560 -0
- package/docs/$.web.WebResponse.html +609 -0
- package/docs/$.web.html +246 -0
- package/docs/Copyright-SAP.html +39 -0
- package/docs/Disclaimer-SAP.html +55 -0
- package/docs/index.html +232 -0
- package/docs/styles/jsdoc-default.css +382 -0
- package/lib/AppConfig.js +36 -0
- package/lib/AuditLogger.js +41 -0
- package/lib/cacert.js +26 -0
- package/lib/ctypes.js +153 -0
- package/lib/destinations/dest-provider.js +57 -0
- package/lib/index.js +235 -0
- package/lib/jobs/Action.js +40 -0
- package/lib/jobs/Job.js +100 -0
- package/lib/jobs/JobManager.js +150 -0
- package/lib/jobs/JobsRuntime.js +133 -0
- package/lib/jobs/SqlScriptJobRunner.js +36 -0
- package/lib/jobs/XsjsJobRunner.js +78 -0
- package/lib/jobs/index.js +11 -0
- package/lib/logging.js +16 -0
- package/lib/middleware.js +125 -0
- package/lib/odata/ODataService.js +125 -0
- package/lib/odata/index.js +7 -0
- package/lib/odata/service-factory.js +26 -0
- package/lib/passport-noauth.js +17 -0
- package/lib/routes.js +115 -0
- package/lib/runtime.js +740 -0
- package/lib/sandbox.js +40 -0
- package/lib/utils/XsJsFunctionRunner.js +57 -0
- package/lib/utils/XsJsLibFunctionRunner.js +57 -0
- package/lib/utils/buffer-utils.js +77 -0
- package/lib/utils/compression-utils.js +14 -0
- package/lib/utils/date-utils.js +104 -0
- package/lib/utils/errors/HttpError.js +20 -0
- package/lib/utils/errors/wrap-app-error.js +18 -0
- package/lib/utils/index.js +17 -0
- package/lib/utils/xs-function-runner.js +51 -0
- package/lib/utils/xs-types.js +21 -0
- package/lib/utils/xspath.js +36 -0
- package/lib/utils/xsstack.js +28 -0
- package/lib/views/error.html +28 -0
- package/lib/xsjs/Application.js +28 -0
- package/lib/xsjs/Locale.js +53 -0
- package/lib/xsjs/Session.js +31 -0
- package/lib/xsjs/constants.js +71 -0
- package/lib/xsjs/db/common/DbBase.js +85 -0
- package/lib/xsjs/db/common/DbOptions.js +163 -0
- package/lib/xsjs/db/common/arguments-validation.js +102 -0
- package/lib/xsjs/db/common/connection.js +12 -0
- package/lib/xsjs/db/common/enums.js +93 -0
- package/lib/xsjs/db/common/execute-batch.js +38 -0
- package/lib/xsjs/db/common/parse-time.js +139 -0
- package/lib/xsjs/db/dbapi/CallableStatement.js +192 -0
- package/lib/xsjs/db/dbapi/Connection.js +78 -0
- package/lib/xsjs/db/dbapi/DB.js +39 -0
- package/lib/xsjs/db/dbapi/ParameterMetaData.js +118 -0
- package/lib/xsjs/db/dbapi/PreparedStatement.js +78 -0
- package/lib/xsjs/db/dbapi/ResultSet.js +220 -0
- package/lib/xsjs/db/dbapi/ResultSetMetaData.js +116 -0
- package/lib/xsjs/db/dbapi/Statement.js +514 -0
- package/lib/xsjs/db/dbapi/conversions.js +113 -0
- package/lib/xsjs/db/dbapi/fetch-rows.js +32 -0
- package/lib/xsjs/db/hdbapi/Connection.js +525 -0
- package/lib/xsjs/db/hdbapi/HDB.js +32 -0
- package/lib/xsjs/db/hdbapi/ResultSetIterator.js +40 -0
- package/lib/xsjs/db/hdbapi/convert.js +77 -0
- package/lib/xsjs/db/hdbapi/table-string-parser.js +52 -0
- package/lib/xsjs/db/index.js +4 -0
- package/lib/xsjs/index.js +13 -0
- package/lib/xsjs/jobs/Job.js +228 -0
- package/lib/xsjs/jobs/Jobs.js +11 -0
- package/lib/xsjs/jobs/Logs.js +127 -0
- package/lib/xsjs/jobs/Schedule.js +110 -0
- package/lib/xsjs/jobs/Schedules.js +108 -0
- package/lib/xsjs/net/Destination.js +43 -0
- package/lib/xsjs/net/http/Client.js +220 -0
- package/lib/xsjs/net/http/HTTP.js +72 -0
- package/lib/xsjs/net/index.js +5 -0
- package/lib/xsjs/net/smtp/Mail.js +38 -0
- package/lib/xsjs/net/smtp/Part.js +30 -0
- package/lib/xsjs/net/smtp/SMTPConnection.js +39 -0
- package/lib/xsjs/net/smtp/index.js +18 -0
- package/lib/xsjs/net/smtp/nodemailer-util.js +77 -0
- package/lib/xsjs/require.js +39 -0
- package/lib/xsjs/security/AntiVirus.js +31 -0
- package/lib/xsjs/security/Store.js +119 -0
- package/lib/xsjs/security/crypto.js +23 -0
- package/lib/xsjs/security/index.js +5 -0
- package/lib/xsjs/security/x509.js +12 -0
- package/lib/xsjs/text/analysis/Session.js +128 -0
- package/lib/xsjs/text/index.js +30 -0
- package/lib/xsjs/text/mining/Session.js +82 -0
- package/lib/xsjs/trace/trace.js +41 -0
- package/lib/xsjs/util/SAXParser.js +174 -0
- package/lib/xsjs/util/Zip.js +220 -0
- package/lib/xsjs/util/codec.js +33 -0
- package/lib/xsjs/util/compression.js +24 -0
- package/lib/xsjs/util/index.js +22 -0
- package/lib/xsjs/web/BasicWebEntity.js +41 -0
- package/lib/xsjs/web/EntityList.js +11 -0
- package/lib/xsjs/web/TupelLists/CookiesTupelList.js +47 -0
- package/lib/xsjs/web/TupelLists/HeadersTupelList.js +55 -0
- package/lib/xsjs/web/TupelLists/ParametersTupelList.js +83 -0
- package/lib/xsjs/web/TupelLists/TupelListBase.js +45 -0
- package/lib/xsjs/web/WebBody.js +135 -0
- package/lib/xsjs/web/WebEntityRequest.js +40 -0
- package/lib/xsjs/web/WebEntityResponse.js +26 -0
- package/lib/xsjs/web/WebRequest.js +209 -0
- package/lib/xsjs/web/WebResponse.js +183 -0
- package/lib/xsjs/web/index.js +4 -0
- package/lib/xsjs/web/utils/HeadersParser.js +53 -0
- package/lib/xsjs/web/utils/HttpRequestParser.js +93 -0
- package/lib/xsjs/web/utils/MultipartParser.js +163 -0
- package/lib/xsjs/web/utils/MultipartResponseBuilder.js +73 -0
- package/lib/xsjs/web/utils/SetCookieParser.js +32 -0
- package/lib/xsjslib/TextBundleWrapper.js +46 -0
- package/lib/xsjslib/index.js +11 -0
- package/npm-shrinkwrap.json +11540 -0
- package/package.json +84 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var argumentsUtil = require('../common/arguments-validation');
|
|
4
|
+
var ResultSetMetaData = require('./ResultSetMetaData');
|
|
5
|
+
var conversions = require('./conversions');
|
|
6
|
+
|
|
7
|
+
module.exports = ResultSet;
|
|
8
|
+
|
|
9
|
+
function ResultSet(setOfRows) {
|
|
10
|
+
this._rows = setOfRows.rows;
|
|
11
|
+
this._columnInfo = setOfRows.columnInfo;
|
|
12
|
+
this._rowCursor = 0;
|
|
13
|
+
this._row = null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the next row
|
|
17
|
+
* @returns {boolean} True if successful
|
|
18
|
+
*/
|
|
19
|
+
ResultSet.prototype.next = function () {
|
|
20
|
+
if (Array.isArray(this._rows) && this._rowCursor < this._rows.length) {
|
|
21
|
+
this._row = this._rows[this._rowCursor++];
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
this._rows = [];
|
|
25
|
+
this._row = undefined;
|
|
26
|
+
return false;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Closes the ResultSet
|
|
31
|
+
* @throws Throws an error if the object the method is being called on is not valid.
|
|
32
|
+
*/
|
|
33
|
+
ResultSet.prototype.close = function () {
|
|
34
|
+
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Checks if the ResultSet is closed.
|
|
39
|
+
* @returns {boolean} Returns true if the ResultSet is already closed, false if not
|
|
40
|
+
* @throws Throws an error if the object the method is being called on is not valid.
|
|
41
|
+
*/
|
|
42
|
+
ResultSet.prototype.isClosed = function () {
|
|
43
|
+
return false;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the metadata of the result set
|
|
48
|
+
* @returns {db.ResultSetMetaData} The metadata of the result set
|
|
49
|
+
*/
|
|
50
|
+
ResultSet.prototype.getMetaData = function () {
|
|
51
|
+
return new ResultSetMetaData(this._columnInfo);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns an integer value of the specified column, for TINYINT, SMALLINT, INT, and BIGINT column types.
|
|
56
|
+
* An exception is thrown if the value is bigger than 9007199254740992 (2^53) or smaller than -9007199254740992 (-2^53).
|
|
57
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
58
|
+
* @returns {integer} Integer
|
|
59
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
60
|
+
*/
|
|
61
|
+
ResultSet.prototype.getInteger = function (columnIndex) {
|
|
62
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
63
|
+
return conversions.getInteger(this._row[columnIndex - 1]);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
ResultSet.prototype.getInt = ResultSet.prototype.getInteger;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a ctypes.Int64 value of the specified column. getBigInt is used for BIGINT column types.
|
|
70
|
+
* @param {integer} columnIndex The target column, <b>starting from 1</b>
|
|
71
|
+
* @returns {ctypes.Int64}
|
|
72
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
73
|
+
*/
|
|
74
|
+
ResultSet.prototype.getBigInt = function (columnIndex) {
|
|
75
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
76
|
+
return conversions.getBigInt(this._row[columnIndex - 1]);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Returns a number value of the specified column. getDecimal is used for DECIMAL column types.
|
|
81
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
82
|
+
* @returns {number} Number representation
|
|
83
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
84
|
+
*/
|
|
85
|
+
ResultSet.prototype.getDecimal = function (columnIndex) {
|
|
86
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
87
|
+
return conversions.getDecimal(this._row[columnIndex - 1]);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Returns a number value of the specified column. getDouble is used for DOUBLE column types.
|
|
92
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
93
|
+
* @returns {number} Number representation
|
|
94
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
95
|
+
*/
|
|
96
|
+
ResultSet.prototype.getDouble = ResultSet.prototype.getDecimal;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Returns a number value of the specified column. getReal is used for REAL column types.
|
|
100
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
101
|
+
* @returns {number} Number representation
|
|
102
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
103
|
+
*/
|
|
104
|
+
ResultSet.prototype.getReal = ResultSet.prototype.getDecimal;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Returns a number value of the specified column. getFloat is used for FLOAT column types.
|
|
108
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
109
|
+
* @returns {number} Number representation
|
|
110
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
111
|
+
*/
|
|
112
|
+
ResultSet.prototype.getFloat = ResultSet.prototype.getDecimal;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Returns a ArrayBuffer value of the specified column. getBlob is used for BLOB column types.
|
|
116
|
+
* @param {integer} columnIndex The target column, <b>starting from 1</b>
|
|
117
|
+
* @returns {ArrayBuffer} Blob representation
|
|
118
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
119
|
+
*/
|
|
120
|
+
ResultSet.prototype.getBlob = function (columnIndex) {
|
|
121
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
122
|
+
return conversions.getBlob(this._row[columnIndex - 1],
|
|
123
|
+
this._columnInfo[columnIndex - 1].nativeType);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns a string value of the specified column. getClob is used for CLOB column types.
|
|
128
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
129
|
+
* @returns {string} String representation
|
|
130
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
131
|
+
*/
|
|
132
|
+
ResultSet.prototype.getClob = function (columnIndex) {
|
|
133
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
134
|
+
return conversions.getClob(this._row[columnIndex - 1],
|
|
135
|
+
this._columnInfo[columnIndex - 1].nativeType);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Returns a string value of the specified column. getNClob is used for NCLOB and TEXT column types.
|
|
140
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
141
|
+
* @returns {string} String representation
|
|
142
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
143
|
+
*/
|
|
144
|
+
ResultSet.prototype.getNClob = ResultSet.prototype.getClob;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Returns a string value of the specified column. getString is used for CHAR and VARCHAR column types. ASCII only, not suitable for strings containing unicode characters.
|
|
148
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
149
|
+
* @returns {string} String representation
|
|
150
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
151
|
+
*/
|
|
152
|
+
ResultSet.prototype.getString = function (columnIndex) {
|
|
153
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
154
|
+
return conversions.getString(this._row[columnIndex - 1],
|
|
155
|
+
this._columnInfo[columnIndex - 1].nativeType);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns a string value of the specified column. getText is used for TEXT column types.
|
|
160
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
161
|
+
* @returns {string} String representation
|
|
162
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
163
|
+
*/
|
|
164
|
+
ResultSet.prototype.getText = ResultSet.prototype.getClob;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns a string value of the specified column. getNString is used for NCHAR, NVARCHAR, SHORTTEXT column types.
|
|
168
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
169
|
+
* @returns {string} String representation
|
|
170
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
171
|
+
*/
|
|
172
|
+
ResultSet.prototype.getNString = ResultSet.prototype.getString;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Returns an ArrayBuffer object of the specified column. getBString is used for BINARY and VARBINARY column types.
|
|
176
|
+
* @param {integer} columnIndex The target column <b>starting from 1</b>
|
|
177
|
+
* @returns {ArrayBuffer} value ArrayBuffer object
|
|
178
|
+
* @throws Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
|
|
179
|
+
*/
|
|
180
|
+
ResultSet.prototype.getBString = ResultSet.prototype.getBlob;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Used to retrieve the value of a DATE column in a ResultSet.
|
|
184
|
+
* @param {integer} columnIndex The index of the column in the resultset <b>starting from 1</b>
|
|
185
|
+
* @returns {Date} A JavaScript Date object representing the value
|
|
186
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
187
|
+
*/
|
|
188
|
+
ResultSet.prototype.getDate = function (columnIndex) {
|
|
189
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
190
|
+
return conversions.getDate(this._row[columnIndex - 1]);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Used to retrieve the value of a TIME column in a ResultSet.
|
|
195
|
+
* @param {integer} columnIndex The index of the column in the resultset <b>starting from 1</b>
|
|
196
|
+
* @returns {Date} A JavaScript Date object representing the value
|
|
197
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
198
|
+
*/
|
|
199
|
+
ResultSet.prototype.getTime = function (columnIndex) {
|
|
200
|
+
argumentsUtil.validateGetterArgs(arguments, 1, this._row);
|
|
201
|
+
return conversions.getTime(this._row[columnIndex - 1]);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Used to retrieve the value of a SECONDDATE column in a ResultSet.
|
|
206
|
+
* @param {integer} columnIndex The index of the column in the resultset <b>starting from 1</b>
|
|
207
|
+
* @returns {Date} A JavaScript Date object representing the value
|
|
208
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
209
|
+
*/
|
|
210
|
+
ResultSet.prototype.getSeconddate = ResultSet.prototype.getDate;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Used to retrieve the value of a TIMESTAMP column in a ResultSet. <br>
|
|
214
|
+
* As this type contains only time information and no date, the JavaScript's date object will always be 1 Jan 1970 plus the time offset.<br>
|
|
215
|
+
* For example: if the stored value is 10:00:00, the JavaScript Date object will be: 1 Jan 1970 10:00:00.
|
|
216
|
+
* @param {integer} columnIndex The index of the column in the resultset <b>starting from 1</b>
|
|
217
|
+
* @returns {Date} A JavaScript Date object representing the value<br>
|
|
218
|
+
* @throws Throws an error if the index parameter is not valid.
|
|
219
|
+
*/
|
|
220
|
+
ResultSet.prototype.getTimestamp = ResultSet.prototype.getDate;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var enums = require('../common/enums');
|
|
4
|
+
var TypeCode = require('@sap/hana-client/extension/TypeCode');
|
|
5
|
+
var isString = require('lodash').isString;
|
|
6
|
+
|
|
7
|
+
module.exports = ResultSetMetaData;
|
|
8
|
+
|
|
9
|
+
function ResultSetMetaData(columns) {
|
|
10
|
+
this._columns = columns;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns the number of the columns in the result set
|
|
15
|
+
* @returns {integer} The number of the columns in the result set
|
|
16
|
+
* @throws Throws an error if the object the method is being called on is not valid.
|
|
17
|
+
*/
|
|
18
|
+
ResultSetMetaData.prototype.getColumnCount = function () {
|
|
19
|
+
return this._columns.length;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the type of the specified column
|
|
24
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
25
|
+
* @returns {db.types} The type of the column
|
|
26
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
27
|
+
*/
|
|
28
|
+
ResultSetMetaData.prototype.getColumnType = function (columnIndex) {
|
|
29
|
+
return enums.convert.toXscType(this._columns[columnIndex - 1].nativeType);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Returns the name of the specified column type
|
|
34
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
35
|
+
* @returns {string} The name of the column type
|
|
36
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
37
|
+
*/
|
|
38
|
+
ResultSetMetaData.prototype.getColumnTypeName = function (columnIndex) {
|
|
39
|
+
var nativeTypeName = this._columns[columnIndex - 1].nativeTypeName;
|
|
40
|
+
|
|
41
|
+
if (!isString(nativeTypeName)) {
|
|
42
|
+
nativeTypeName = Object.keys(TypeCode).find(key => TypeCode[key] === nativeTypeName);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return enums.convert.toXscTypeName(nativeTypeName);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the name of the specified column
|
|
50
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
51
|
+
* @returns {string} The name of the specified column
|
|
52
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
53
|
+
*/
|
|
54
|
+
ResultSetMetaData.prototype.getColumnName = function (columnIndex) {
|
|
55
|
+
return this._columns[columnIndex - 1].originalColumnName;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the alias or name of the specified column
|
|
60
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
61
|
+
* @returns {string} The alias or name of the specified column
|
|
62
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
63
|
+
*/
|
|
64
|
+
ResultSetMetaData.prototype.getColumnLabel = function (columnIndex) {
|
|
65
|
+
return this._columns[columnIndex - 1].columnName;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns the catalog name for the specified column
|
|
70
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
71
|
+
* @returns {string} The catalog name for the specified column
|
|
72
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
73
|
+
*/
|
|
74
|
+
ResultSetMetaData.prototype.getCatalogName = function () {
|
|
75
|
+
throw new Error('Not implemented');
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns the table name for the specified column
|
|
80
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
81
|
+
* @returns {string} The table name for the specified column
|
|
82
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
83
|
+
*/
|
|
84
|
+
ResultSetMetaData.prototype.getTableName = function (columnIndex) {
|
|
85
|
+
return this._columns[columnIndex - 1].tableName;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns the precision of the specified column
|
|
90
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
91
|
+
* @returns {integer} The precision of the specified column
|
|
92
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
93
|
+
*/
|
|
94
|
+
ResultSetMetaData.prototype.getPrecision = function (columnIndex) {
|
|
95
|
+
return this._columns[columnIndex - 1].precision;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Returns the column display size of the specified column
|
|
100
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
101
|
+
* @returns {integer} The column display size of the specified column
|
|
102
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
103
|
+
*/
|
|
104
|
+
ResultSetMetaData.prototype.getColumnDisplaySize = function () {
|
|
105
|
+
throw new Error('Not implemented');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Returns the scale of the specified column
|
|
110
|
+
* @param {integer} columnIndex The index of the column in the result set <b>starting from 1</b>
|
|
111
|
+
* @returns {integer} The scale of the specified column
|
|
112
|
+
* @throws Throws an error on invalid parameters or if the object the method is being called on is not valid.
|
|
113
|
+
*/
|
|
114
|
+
ResultSetMetaData.prototype.getScale = function (columnIndex) {
|
|
115
|
+
return this._columns[columnIndex - 1].scale;
|
|
116
|
+
};
|