mirror of
https://github.com/knex/knex.git
synced 2025-07-12 19:40:33 +00:00

* Avoid lodash typecheks Lodash is quite big project. Even with direct imports it loads [tons](https://github.com/knex/knex/pull/3804) of code and still bloats node_modules. Especially since lodash mostly used as a polyfill for modern features. In this diff I attempted to reduce lodash usage by replacing type checks with `typeof` operator which might be sufficient. Also replaced lodash/isObject with custom simplified utility which does not consider functions as objects and allows to simplify code in one place.
36 lines
914 B
JavaScript
36 lines
914 B
JavaScript
const inherits = require('inherits');
|
|
const ColumnCompiler_Oracle = require('../../oracle/schema/columncompiler');
|
|
const { isObject } = require('../../../util/is');
|
|
|
|
function ColumnCompiler_Oracledb() {
|
|
ColumnCompiler_Oracle.apply(this, arguments);
|
|
}
|
|
|
|
inherits(ColumnCompiler_Oracledb, ColumnCompiler_Oracle);
|
|
|
|
Object.assign(ColumnCompiler_Oracledb.prototype, {
|
|
time: 'timestamp with local time zone',
|
|
|
|
datetime: function (withoutTz) {
|
|
let useTz;
|
|
if (isObject(withoutTz)) {
|
|
({ useTz } = withoutTz);
|
|
} else {
|
|
useTz = !withoutTz;
|
|
}
|
|
return useTz ? 'timestamp with local time zone' : 'timestamp';
|
|
},
|
|
|
|
timestamp: function (withoutTz) {
|
|
let useTz;
|
|
if (isObject(withoutTz)) {
|
|
({ useTz } = withoutTz);
|
|
} else {
|
|
useTz = !withoutTz;
|
|
}
|
|
return useTz ? 'timestamp with local time zone' : 'timestamp';
|
|
},
|
|
});
|
|
|
|
module.exports = ColumnCompiler_Oracledb;
|