UNPKG

1.88 kBJavaScriptView Raw
1// Copyright (c) 2023, Oracle and/or its affiliates.
2
3//-----------------------------------------------------------------------------
4//
5// This software is dual-licensed to you under the Universal Permissive License
6// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8// either license.
9//
10// If you elect to accept the software under the Apache License, Version 2.0,
11// the following applies:
12//
13// Licensed under the Apache License, Version 2.0 (the "License");
14// you may not use this file except in compliance with the License.
15// You may obtain a copy of the License at
16//
17// https://www.apache.org/licenses/LICENSE-2.0
18//
19// Unless required by applicable law or agreed to in writing, software
20// distributed under the License is distributed on an "AS IS" BASIS,
21// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22// See the License for the specific language governing permissions and
23// limitations under the License.
24//
25//-----------------------------------------------------------------------------
26
27'use strict';
28
29const errors = require('./errors.js');
30
31// future object used for managing backwards incompatible changes.
32class Future {
33
34 constructor() {
35 this._featureFlags = {};
36 this._featureFlags.oldJsonColumnAsObj = false;
37 }
38
39 get oldJsonColumnAsObj() {
40 return this._featureFlags.oldJsonColumnAsObj;
41 }
42
43 // fetch VARCHAR2 and LOB columns that contain JSON data (and have
44 // the "IS JSON" constraint enabled) in the same way that columns
45 // of type JSON (which requires Oracle Database 21 and higher) are fetched.
46 set oldJsonColumnAsObj(value) {
47 errors.assertPropValue(typeof value === 'boolean', "oldJsonColumnAsObj");
48 this._featureFlags.oldJsonColumnAsObj = value;
49 }
50
51}
52
53module.exports = new Future;