无法在CYPHER语句的开头使用with子句。
我想在with子句上设置一些参数变量。 但是,AgensGraph返回错误。
agens=# with 1 as value return value;
ERROR: syntax error at or near "1"
LINE 1: with 1 as value return value;
^
如何在语句开头使用with子句?
答案 0 :(得分:0)
不幸的是,SQL语法也有WITH子句。
AgensGraph解析器假定WITH子句以SQL WITH子句开头。
为避免这种情况,可以使用伪OPTIONAL MATH子句。
<dom-module id="epicsprint-page">
<template is="dom-bind">
<style include="shared-styles">
:host {
padding: 10px;
font-family:'Fira Sans', sans-serif;
}
a paper-button,
a:hover paper-button,
a:link paper-button,
a:active paper-button,
a:visited paper-button {
width: 20%;
height: 35px;
}
.page { overflow:auto; width: 90%; height: 100%; }
.containerMap { width:100%; background: grey; }
.error-content{
width: 80wh;
height: 300px;
overflow: auto;
align-items: center;
}
/*************/
.board__sprint {
/*background: #5ba4cf;*/
position: absolute;
left: auto;
padding: 20px;
overflow-x: auto;
white-space: nowrap;
}
.list {
display: inline-block;
vertical-align: top;
/*background: #d2d7e5;*/
width: 300px;
padding: 1px;
}
.list-content {
max-height: 80%;
overflow-y: auto;
padding-right: 5px;
/*margin-right: -5px;*/
margin-bottom: 20px;
padding-bottom: 60px;
}
.list-name {
padding: 10px;
border: none;
background: transparent;
}
.add-ticket {
background: linear-gradient(to bottom, #61bd4f 0, #5aac44
100%);
color: white;
font-weight: bold;
border: none;
padding: 10px;
}
.ticket {
/*background: white;*/
flex: 0 0 auto;
margin: 5px;
width: 200px;
height: 70px;
align-items: center;
white-space: normal;
}
.ticket-title {
width: 100%;
padding: 20px;
}
/*********/
</style>
<iron-ajax
id="getEpicSprintMap"
method="GET"
url="{{url}}"
handle-as="json"
content-type="application/json"
on-response="handleResponseGetEpicSprintMap"
on-error="handleErrorGetEpicSprintMap"
last-response="{{mapsData}}"
last-error="{{lastError}}">
</iron-ajax>
<div style="width: 100%">
<div style="float:left;">
<div><h5></h5></div>
<paper-icon-button src="../images/icons/help-icon-png.png"
on-tap="showHelpDialog"></paper-icon-button>
</div>
<div style="float:right;">
<div><h5></h5></div>
<paper-icon-button src="../images/icons/support-icon-png.png"
on-tap="showHelpDialog"></paper-icon-button>
</div>
</div>
<template is="dom-if" if="[[signedin]]">
<template is="dom-if" if="[[mapsData.successFlag]]">
<div style="float: center;">
<h5 style="color: white; font-size: 12px; text-
align:left;"> </h5>
</div>
<div style="float: center; display: flex">
<iron-image src="../images/logo.png" preload
sizing="contain"
on-tap="reloadEpics" style="width:200px; height:200px;
margin:auto;" ></iron-image>
</div>
<div style="float: center;">
<h1 style="color: white" class="launchAmount">Epics &
Sprints</h1>
<h2 style="color: white" class="launchAmount">Number of
sprints that an Epic spans</h2>
</div>
<input id="test" min="1" max="1000" value='1000' step="1"
onchange="showVal(this.value)" type="range"/>
<div class="containerMap" id="someid">
<div class="page">
<div class="content">
<div class="board__sprint">
<template is="dom-repeat" items="{{mapsData.data}}"
as="row">
<div class="list">
<div class="list-content">
<div style="text-align: center;">
<iron-image class=""
src="../images/icons/epic-icon-png.png"
preload
sizing="contain"
style="width:50px; height:50px; margin-
left: 50px;" ></iron-image>
</div>
<div style="text-align: center;">
<h3 class="sprintTitle" style="color: white; font-
size: 15px;background: black; padding: 10px; margin-top: 5px;">
<b>Epic: </b>[[row.key]]
</h3>
<h3 class="sprintTitle" style="color: white; font-
size: 15px;background: black; padding: 10px; margin-top: 5px;">
[[row.title]]
</h3>
</div>
<template is="dom-repeat" items="{{row.sprint}}"
as="sprint">
<div class="ticket">
<paper-card style="float:center; width: 95%"
class$="{{_computedCardColorStories()}}">
<div style="width: 100%;">
<div style="float:left; width: 10%"
style$="{{getRandomInt(0, 20)}}">
<h7> </h7>
</div>
<div style="float:left; width: 90%; text-
align: center; padding: 10px;">
<h7 style="color: black; font-size:
18px; text-align:center;">[[sprint]]</h7>
</div>
</div>
</paper-card>
</div>
</template>
</div>
</div>
</template>
</div>
</div>
</div>
</div>
</template>
</template>
</template>
</template>
<script>
/**
* @polymer
* @extends HTMLElement
*/
class EpicSprintMapPage extends Polymer.Element {
static get is() { return 'epicsprint-page'; }
constructor() {
super();
}
ready() {
super.ready();
}
static get properties() {
return {
user: { type: Object, notify: true, readOnly: false, observer: '_userChanged' },
signedin: { type: Boolean, notify: true, readOnly: false, observer: '_signedinChanged' },
statusKnown: { type: Boolean, notify: true, readOnly: false, observer: '_statusChanged' },
localSettings : { type: Object, notify: true, readOnly: false },
mapsData: { type: Object, notify: true },
filterFromDate : { type: String, notify: true },
filterToDate: { type: String, notify: true },
defaultSprintVelocity: { type: Number, value: 0, notify: true },
zoomVal: { type: Number, value: 100, notify: true },
}
};
_userChanged(user){
this.user = user;
}
_signedinChanged(signedin){
this.signedin = signedin;
}
_statusChanged(statusKnown){
this.statusKnown = statusKnown;
}
showVal()
{
var zoomScale = Number(this.zoomVal)/100;
console.log('zoomScale = '+zoomScale);
var ele = document.getElementsByClassName('containerMap')[0]; // returns null in console can't find the element in shadow Dom
var el = this.shadowRoot.querySelector('someid'); // returns null in console also tried '#someid' still null
console.log('shadowRoot el = '+JSON.stringify(el));
var elx = document.getElementById('someid'); // returns null in console
console.log('shadowRoot el = '+JSON.stringify(elx));
//var el = this.$.someid; // doesn't find the element
// tried this.$['#someid'] this.$$('#someid')
console.log(el);
transformOrigin = [0,0];
el = el || instance.getContainer();
var p = ["webkit", "moz", "ms", "o"],
s = "scale(" + zoomScale + ")",
oString = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";
for (var i = 0; i < p.length; i++) {
el.style[p[i] + "Transform"] = s;
el.style[p[i] + "TransformOrigin"] = oString;
}
el.style["transform"] = s;
el.style["transformOrigin"] = oString;
}
}//end Polymer
window.customElements.define(EpicSprintMapPage.is, EpicSprintMapPage);
</script>
</dom-module>