formatter.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict';
  2. exports.__esModule = true;
  3. var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
  4. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  5. var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
  6. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  7. var _inherits2 = require('babel-runtime/helpers/inherits');
  8. var _inherits3 = _interopRequireDefault(_inherits2);
  9. var _formatter = require('../../formatter');
  10. var _formatter2 = _interopRequireDefault(_formatter);
  11. var _utils = require('./utils');
  12. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13. var Oracle_Formatter = function (_Formatter) {
  14. (0, _inherits3.default)(Oracle_Formatter, _Formatter);
  15. function Oracle_Formatter() {
  16. (0, _classCallCheck3.default)(this, Oracle_Formatter);
  17. return (0, _possibleConstructorReturn3.default)(this, _Formatter.apply(this, arguments));
  18. }
  19. Oracle_Formatter.prototype.alias = function alias(first, second) {
  20. return first + ' ' + second;
  21. };
  22. Oracle_Formatter.prototype.parameter = function parameter(value, notSetValue) {
  23. // Returning helper uses always ROWID as string
  24. if (value instanceof _utils.ReturningHelper && this.client.driver) {
  25. value = new this.client.driver.OutParam(this.client.driver.OCCISTRING);
  26. } else if (typeof value === 'boolean') {
  27. value = value ? 1 : 0;
  28. }
  29. return _Formatter.prototype.parameter.call(this, value, notSetValue);
  30. };
  31. return Oracle_Formatter;
  32. }(_formatter2.default);
  33. exports.default = Oracle_Formatter;
  34. module.exports = exports['default'];