Initial commit
This commit is contained in:
61
node_modules/knex/lib/dialects/oracledb/schema/oracledb-columncompiler.js
generated
vendored
Executable file
61
node_modules/knex/lib/dialects/oracledb/schema/oracledb-columncompiler.js
generated
vendored
Executable file
@@ -0,0 +1,61 @@
|
||||
const ColumnCompiler_Oracle = require('../../oracle/schema/oracle-columncompiler');
|
||||
const { isObject } = require('../../../util/is');
|
||||
|
||||
class ColumnCompiler_Oracledb extends ColumnCompiler_Oracle {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.modifiers = ['defaultTo', 'nullable', 'comment', 'checkJson'];
|
||||
this._addCheckModifiers();
|
||||
}
|
||||
|
||||
datetime(withoutTz) {
|
||||
let useTz;
|
||||
if (isObject(withoutTz)) {
|
||||
({ useTz } = withoutTz);
|
||||
} else {
|
||||
useTz = !withoutTz;
|
||||
}
|
||||
return useTz ? 'timestamp with local time zone' : 'timestamp';
|
||||
}
|
||||
|
||||
timestamp(withoutTz) {
|
||||
let useTz;
|
||||
if (isObject(withoutTz)) {
|
||||
({ useTz } = withoutTz);
|
||||
} else {
|
||||
useTz = !withoutTz;
|
||||
}
|
||||
return useTz ? 'timestamp with local time zone' : 'timestamp';
|
||||
}
|
||||
|
||||
checkRegex(regex, constraintName) {
|
||||
return this._check(
|
||||
`REGEXP_LIKE(${this.formatter.wrap(
|
||||
this.getColumnName()
|
||||
)},${this.client._escapeBinding(regex)})`,
|
||||
constraintName
|
||||
);
|
||||
}
|
||||
|
||||
json() {
|
||||
// implicitly add the check for json
|
||||
this.columnBuilder._modifiers.checkJson = [
|
||||
this.formatter.columnize(this.getColumnName()),
|
||||
];
|
||||
return 'varchar2(4000)';
|
||||
}
|
||||
|
||||
jsonb() {
|
||||
return this.json();
|
||||
}
|
||||
|
||||
checkJson(column) {
|
||||
return `check (${column} is json)`;
|
||||
}
|
||||
}
|
||||
|
||||
ColumnCompiler_Oracledb.prototype.time = 'timestamp with local time zone';
|
||||
ColumnCompiler_Oracledb.prototype.uuid = ({ useBinaryUuid = false } = {}) =>
|
||||
useBinaryUuid ? 'raw(16)' : 'char(36)';
|
||||
|
||||
module.exports = ColumnCompiler_Oracledb;
|
||||
19
node_modules/knex/lib/dialects/oracledb/schema/oracledb-tablecompiler.js
generated
vendored
Executable file
19
node_modules/knex/lib/dialects/oracledb/schema/oracledb-tablecompiler.js
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
const TableCompiler_Oracle = require('../../oracle/schema/oracle-tablecompiler');
|
||||
|
||||
class TableCompiler_Oracledb extends TableCompiler_Oracle {
|
||||
constructor(client, tableBuilder) {
|
||||
super(client, tableBuilder);
|
||||
}
|
||||
|
||||
_setNullableState(column, isNullable) {
|
||||
const nullability = isNullable ? 'NULL' : 'NOT NULL';
|
||||
const sql = `alter table ${this.tableName()} modify (${this.formatter.wrap(
|
||||
column
|
||||
)} ${nullability})`;
|
||||
return this.pushQuery({
|
||||
sql: sql,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TableCompiler_Oracledb;
|
||||
13
node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewbuilder.js
generated
vendored
Executable file
13
node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewbuilder.js
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
const ViewBuilder = require('../../../schema/viewbuilder.js');
|
||||
|
||||
class ViewBuilder_Oracledb extends ViewBuilder {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
}
|
||||
|
||||
checkOption() {
|
||||
this._single.checkOption = 'default_option';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ViewBuilder_Oracledb;
|
||||
19
node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewcompiler.js
generated
vendored
Executable file
19
node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewcompiler.js
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
/* eslint max-len: 0 */
|
||||
|
||||
const ViewCompiler = require('../../../schema/viewcompiler.js');
|
||||
|
||||
class ViewCompiler_Oracledb extends ViewCompiler {
|
||||
constructor(client, viewCompiler) {
|
||||
super(client, viewCompiler);
|
||||
}
|
||||
|
||||
createOrReplace() {
|
||||
this.createQuery(this.columns, this.selectQuery, false, true);
|
||||
}
|
||||
|
||||
createMaterializedView() {
|
||||
this.createQuery(this.columns, this.selectQuery, true);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ViewCompiler_Oracledb;
|
||||
Reference in New Issue
Block a user