Skip to content

Commit 5ca85c1

Browse files
authored
Merge pull request #91 from SAP-samples/90-remove-the-quoted-naming-as-the-default-and-instead-put-it-behind-an-optional-parameter
90 remove the quoted naming as the default and instead put it behind an optional parameter
2 parents c6b66d6 + db77abd commit 5ca85c1

14 files changed

+728
-875
lines changed

CHANGELOG.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
[
2+
{
3+
"date": "2022-12-01",
4+
"version": "3.202212.1",
5+
"Changed": [
6+
"Remove the quoted naming as the default and instead put it behind an optional parameter [Issue #90](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/90)",
7+
"CAP October 2022 Release",
8+
"SAPUI5 to version 109.0",
9+
"New Node.js minimal version is 14.18"
10+
]
11+
},
212
{
313
"date": "2022-10-17",
414
"version": "3.202210.2",
@@ -7,7 +17,7 @@
717
"SAPUI5 to version 107.0",
818
"Support New CAP Integer Types - TINYINT UInt8 and SMALLINT Int16",
919
"Support for Postgres in Inspect Table and View",
10-
"Default Values Support [Issue #87](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/87)"
20+
"Default Values Support [Issue #87](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/87)"
1121
]
1222
},
1323
{

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## [3.202212.1] - 2022-12-01
8+
9+
**Changed**
10+
11+
- Remove the quoted naming as the default and instead put it behind an optional parameter [Issue #90](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/90)
12+
- CAP October 2022 Release
13+
- SAPUI5 to version 109.0
14+
- New Node.js minimal version is 14.18
15+
716
## [3.202210.2] - 2022-10-17
817

918
**Changed**

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ Options:
333333
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
334334
cloud.sap/docs/cds/cdl#predefined-types)
335335
[boolean] [default: false]
336+
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
337+
ifiers ier] [boolean] [default: false]
336338
-p, --port Port to run HTTP server for CDS preview
337339
[default: false]
338340
```
@@ -1350,6 +1352,10 @@ Options:
13501352
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
13511353
cloud.sap/docs/cds/cdl#predefined-types)
13521354
[boolean] [default: false]
1355+
--useExists, --exists, --persistence Use Persistence Exists Annotation
1356+
[boolean] [default: true]
1357+
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
1358+
ifiers ier] [boolean] [default: false]
13531359
```
13541360
13551361
![inspectTable example](https://raw.githubusercontent.com/wiki/SAP-samples/hana-developer-cli-tool-example/images/inspectTable.gif)
@@ -1440,6 +1446,10 @@ Options:
14401446
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
14411447
cloud.sap/docs/cds/cdl#predefined-types)
14421448
[boolean] [default: false]
1449+
--useExists, --exists, --persistence Use Persistence Exists Annotation
1450+
[boolean] [default: true]
1451+
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
1452+
ifiers ier] [boolean] [default: false]
14431453
```
14441454
14451455
### libraries
@@ -1514,6 +1524,10 @@ Options:
15141524
Merge settings but will also include
15151525
some references that are incompatible
15161526
with HDI [boolean] [default: false]
1527+
--useExists, --exists, --persistence Use Persistence Exists Annotation
1528+
[boolean] [default: true]
1529+
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
1530+
ifiers ier] [boolean] [default: false]
15171531
--namespace, --ns CDS namespace [string] [default: ""]
15181532
--synonyms Filename to store sysnonyms
15191533
[string] [default: ""]

_i18n/messages.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ gui.unloadPriority=Unload Priority
244244
gui.created=Created At
245245
gui.cds=CAP CDS
246246
gui.hdbtable=HDBTable
247-
gui.useExists=Ues Persistence Exists Annotation
247+
gui.useExists=Use Persistence Exists Annotation
248+
gui.useQuoted=Use Quoted Identifiers ![non-identifier]
248249
hc.name=Name
249250
hc.created=Create At
250251
hc.status=Status

app/resources/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
88
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
99
<title>hana-cli LaunchPad</title>
10-
<script src="https://ui5.sap.com/1.107.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
11-
<script src="https://ui5.sap.com/1.107.0/resources/sap-ui-core.js"
10+
<script src="https://ui5.sap.com/1.109.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
11+
<script src="https://ui5.sap.com/1.109.0/resources/sap-ui-core.js"
1212
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout, sap.ui.rta, sap.dfa.help,sap.uxap"
1313
data-sap-ui-compatVersion="edge" data-sap-ui-theme="sap_horizon" data-sap-ui-async="true"
1414
data-sap-ui-frameOptions="trusted" data-sap-ui-bindingSyntax="complex" data-sap-ui-xx-bindingSyntax="complex"

app/resources/massConvert/view/App.view.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
<Label text="{i18nReuse>noColons}"/>
6060
<CheckBox id="chkNoColons" selected="{/noColons}" />
6161
<Label text="{i18nReuse>gui.useExists}"/>
62-
<CheckBox id="useExists" selected="{/useExists}" tooltip="{i18nReuse>useExists}"/>
62+
<CheckBox id="useExists" selected="{/useExists}" tooltip="{i18nReuse>useExists}"/>
63+
<Label text="{i18nReuse>gui.useQuoted}"/>
64+
<CheckBox id="useQuoted" selected="{/useQuoted}" tooltip="{i18nReuse>useQuoted}"/>
6365
<core:Fragment fragmentName="sap.hanacli.common.view.Debug" type="XML"/>
6466

6567
</f:content>

bin/cds.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export const builder = base.getBuilder({
4141
default: false,
4242
desc: base.bundle.getText("useHanaTypes")
4343
},
44+
useQuoted: {
45+
alias: ['q', 'quoted', 'quotedIdentifiers'],
46+
desc: base.bundle.getText("gui.useQuoted"),
47+
type: 'boolean',
48+
default: false
49+
},
4450
port: {
4551
alias: ['p'],
4652
type: 'number',
@@ -76,6 +82,10 @@ export function handler(argv) {
7682
description: base.bundle.getText("useHanaTypes"),
7783
type: 'boolean'
7884
},
85+
useQuoted: {
86+
description: base.bundle.getText("gui.useQuoted"),
87+
type: 'boolean'
88+
},
7989
port: {
8090
description: base.bundle.getText("port"),
8191
required: false,
@@ -96,6 +106,7 @@ export async function cdsBuild(prompts) {
96106
let schema = await base.dbClass.schemaCalc(prompts, db)
97107
let object, fields, constraints, cdsSource
98108
dbInspect.options.useHanaTypes = prompts.useHanaTypes
109+
dbInspect.options.useQuoted = prompts.useQuoted
99110
dbInspect.options.noColons = true
100111

101112
if (!prompts.view) {
@@ -131,7 +142,12 @@ export async function cdsBuild(prompts) {
131142
UI: {
132143
LineItem: [ \n`;
133144
for (let field of fields) {
134-
cdsSource += `{$Type: 'UI.DataField', Value: ![${field.COLUMN_NAME}], ![@UI.Importance]:#High}, \n`
145+
if(prompts.useQuoted){
146+
cdsSource += `{$Type: 'UI.DataField', Value: ![${field.COLUMN_NAME}], ![@UI.Importance]:#High}, \n`
147+
}else{
148+
cdsSource += `{$Type: 'UI.DataField', Value: ${field.COLUMN_NAME}, ![@UI.Importance]:#High}, \n`
149+
}
150+
135151
}
136152
cdsSource +=
137153
`], \n`
@@ -237,7 +253,7 @@ async function cdsServerSetup(prompts, cdsSource) {
237253
base.debug(`In Read Exit ${prompts.table}`)
238254
let query1 = await cds.parse.cql (`SELECT from ${prompts.table}`)
239255
// @ts-ignore
240-
req.query.SELECT.from = query1.SELECT.from // ["STAR_WARS_FILM"]//[`![${prompts.table}]`]
256+
req.query.SELECT.from = query1.SELECT.from
241257
req.query = query1
242258
let query = "SELECT "
243259
// @ts-ignore

bin/inspectTable.js

+11
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export const builder = base.getBuilder({
4949
desc: base.bundle.getText("gui.useExists"),
5050
type: 'boolean',
5151
default: true
52+
},
53+
useQuoted: {
54+
alias: ['q', 'quoted', 'quotedIdentifiers'],
55+
desc: base.bundle.getText("gui.useQuoted"),
56+
type: 'boolean',
57+
default: false
5258
}
5359
})
5460

@@ -76,6 +82,10 @@ export let inputPrompts = {
7682
useExists: {
7783
description: base.bundle.getText("gui.useExists"),
7884
type: 'boolean'
85+
},
86+
useQuoted: {
87+
description: base.bundle.getText("gui.useQuoted"),
88+
type: 'boolean'
7989
}
8090
}
8191

@@ -95,6 +105,7 @@ export async function tableInspect(prompts) {
95105

96106
dbInspect.options.useHanaTypes = prompts.useHanaTypes
97107
dbInspect.options.useExists = prompts.useExists
108+
dbInspect.options.useQuoted = prompts.useQuoted
98109

99110
let object = await dbInspect.getTable(db, schema, prompts.table)
100111
let fields = await dbInspect.getTableFields(db, object[0].TABLE_OID)

bin/inspectView.js

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export const builder = base.getBuilder({
4646
desc: base.bundle.getText("gui.useExists"),
4747
type: 'boolean',
4848
default: true
49+
},
50+
useQuoted: {
51+
alias: ['q', 'quoted', 'quotedIdentifiers'],
52+
desc: base.bundle.getText("gui.useQuoted"),
53+
type: 'boolean',
54+
default: false
4955
}
5056
})
5157

@@ -74,6 +80,10 @@ export function handler(argv) {
7480
useExists: {
7581
description: base.bundle.getText("gui.useExists"),
7682
type: 'boolean'
83+
},
84+
useQuoted: {
85+
description: base.bundle.getText("gui.useQuoted"),
86+
type: 'boolean'
7787
}
7888
})
7989
}
@@ -88,6 +98,7 @@ export async function viewInspect(prompts) {
8898
base.debug(`${base.bundle.getText("schema")}: ${schema}, ${base.bundle.getText("view")}: ${prompts.view}`)
8999
dbInspect.options.useHanaTypes = prompts.useHanaTypes
90100
dbInspect.options.useExists = prompts.useExists
101+
dbInspect.options.useQuoted = prompts.useQuoted
91102

92103
let object = await dbInspect.getView(db, schema, prompts.view)
93104
let fields = []

0 commit comments

Comments
 (0)