Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
oe-connector-oracle
Advanced tools
This is a oracle connector for oeCloud framework developed based on loopback-connector-postgresql with the same license of postgres connector.
In your application root directory, enter this command to install the connector:
$ npm install oe-connector-oracle oracledb --save
This will install the module and add's it to application’s package.json file.
strict:true
. Any property you want to POST/GET must be defined in your model definition. The reason for this is, each property defined on the model is stored as a column in the table and if you try to GET/POST any new property(not defined on model), Oracle will throw an error because there is no column defined for such properties. property1:{type: any}
Its adviceable to use property1:{type: object}
. Another important thing we need to be careful is with array types. It would be easy to query on ["string"]
than [any]/ []
."properties":{
"productId":{
"type":"string",
"required":true,
"length":20,
"id":1,
"oracle":{
"columnName":"PRODUCT_ID",
"dataType":"VARCHAR2",
"dataLength":20,
"nullable":"N"
}
},
"locationId":{
"type":"string",
"required":true,
"length":20,
"id":2
},
"available":{
"type":"number",
"required":false,
"length":22,
"oracle":{
"columnName":"AVAILABLE",
"dataType":"NUMBER",
"dataLength":22,
"nullable":"Y"
}
},
"total":{
"type":"number",
"length":15
}
}
foo
and your filter query is bar:1
. Then mongo will return []
(Empty array). where as Oracle will return all the records because the bar:1 filter will be ignored because its not a defined property.As of version 2.1.0 of the connector, support for consuming sequence objects is provisioned. Unlike oe-connector-postgresql
module, this connector has only two kinds of sequences - simple and complex.
Only one property in a model can be defined to support an oracle sequence object. The property should be such that it uniquely identifies the instance. Hence it should be an id
field.
Supports a simple sequence - it is similar to having the sequence object created in the database and a corresponding table consuming it through a column whose default value is appropriately set. For e.g. below code (i.e. model definition) creates a sequence with name reservation_sequence
and a table named testschema2
{
"name": "testschema2",
"properties": {
"reservationId" : {
"id" : true,
"oracle": {
"sequence" : {
"type": "simple",
"name": "reservation_sequence"
}
}
},
"firstName": "string",
"lastName": "string"
}
}
Note: Only one property in the model can consume a sequence, and, it also must uniquely identify an instance. (Therefore
"id" : true
is part of the corresponding property definition)
Below strech of code describes the configuration required for defining a simple sequence.
const SEQ_SIMPLE = {
name: null, // sequence name - required
incrementBy: 1,
minValue: false, // number or boolean
maxValue: false, // number or boolean
startFrom: 1, // number
cache: false, // Specify (integer) how many values of the sequence the database preallocates and keeps in memory for faster access.
// Must be >=2. The integer should have less than or equal to 28 digits.
// Alternatively specify boolean.
// A boolean true means cache value adopts 2.
// A boolean false means no caching (default)
cycle: false, // restart once the seq reaches its upper bound.
order: false // guarantee sequence numbers are generated in order of request. Default false
};
Note: Please refer oracle documentation for more details about each parameter.
This connector also supports prefix based sequences. A prefix
is a string which is prefixed to a padded sequence number. This makes it possible to generate sequences such as LMB00001
, LMB00002
, LMB00003
, etc.
It has all the configuration of a simple sequence, and, the following parameters:
const SEQ_COMPLEX = Object.assign({}, SEQ_SIMPLE, {
name: null, // sequence name - required
length: 0, // final length of prefix-ed sequence - required
prefix: null // the prefix to appear before the padded sequence - required
});
Example:
{
"name": "testschema3",
"properties": {
"reservationId" : {
"id" : true,
"oracle": {
"sequence" : {
"type": "complex",
"name": "reservation_sequence",
"prefix": "LMB",
"length": 10
}
}
},
"firstName": "string",
"lastName": "string"
}
}
Like operator can be used in 4 ways in our queries:
Index range scan is only done in for cases like Search-String% and Search%String. While using %Search-String and %Search-String% full table scan is done.
FAQs
The oracle connector for the oe-cloud framework.
The npm package oe-connector-oracle receives a total of 23 weekly downloads. As such, oe-connector-oracle popularity was classified as not popular.
We found that oe-connector-oracle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.