@cgignite/ignite-odata
Version:
Odata Connector CG Ignite
91 lines (88 loc) • 3.18 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('odata in', {
category: 'odata',
color: '#d24714',
defaults: {
name: { value: "" },
edm: { type: "edm", required: false },
},
inputs: 1,
outputs: 1,
icon: 'font-awesome/fa-angle-double-right',
label: function () {
return this.name || "odata in";
}
});
</script>
<script type="text/html" data-template-name="odata in">
<div class="form-row">
<label for="node-input-name">Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-edm">Edm</label>
<input type="text" id="node-input-edm" placeholder="Entity Data Model">
</div>
<p>To support model specific query generation :</p>
<p> set msg.model object to a valid data model using a function node</p>
<p>Example :</p>
<pre>
{
namespace: "ignite",
entityTypes: {
"users": {
"id": {"type": "Edm.Int32", "key": true},
"name": {"type": "Edm.String"},
"username": {"type": "Edm.String"}
}
},
entitySets: {
"users": {
entityType: "ignite.users"
}
}
}
</pre>
</pre>
<p>Entity Data Model (EDM) types for OData Version 4.0</p>
<pre>
INTEGER Edm.Int32
VARCHAR Edm.String
BOOLEAN/BIT Edm.Boolean
DOUBLE/FLOAT Edm.Double
DECIMAL Edm.Decimal
DATE Edm.Date
TIMESTAMP Edm.DateTimeOffset
</pre>
</script>
<script type="text/html" data-help-name="odata in">
<p>
It resolves any OData Complaint (URL) into various database specific sql statements.
</p>
<p>
Be careful while using capital letters in table and column names, column and table names are wrapped inside "" when capital letters are present.
</p>
<div>
1. Connect the input of<i style="color:#AD1625;">odata in</i> Node to an http in Node.
<br>
2. The http in node must have a method type selected to accept an incoming request http to for that http method.
<br>
3. The http in node must have <i style="color:#AD1625;">/example/</i> or <i style="color:#AD1625;">/odata/</i> appended to the url
to act as service root url for your odata service.
<br>
4. After the root URL, type in a valid odata url or append <i style="color:#AD1625;">*</i> to accept all the requests matching the root url.
<br>
5. The odata node resolves the incoming request into sql statements and returns the queries inside <i style="color:#AD1625;">msg.payload.queries</i> for each db type it supports.
<br>
6. <i style="color:#AD1625; font-weight:bold;">Supports following Database Types:</i>
<ol>
<li>db2</li>
<li>maria db</li>
<li>sql server</li>
<li>mysql</li>
<li>oracle</li>
<li>postgres</li>
<li>sqlite</li>
</ol>
</div>
</script>