Skip to content

Commit

Permalink
Merge pull request #91 from SAP-samples/90-remove-the-quoted-naming-a…
Browse files Browse the repository at this point in the history
…s-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
  • Loading branch information
jung-thomas authored Dec 1, 2022
2 parents c6b66d6 + db77abd commit 5ca85c1
Show file tree
Hide file tree
Showing 14 changed files with 728 additions and 875 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[
{
"date": "2022-12-01",
"version": "3.202212.1",
"Changed": [
"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)",
"CAP October 2022 Release",
"SAPUI5 to version 109.0",
"New Node.js minimal version is 14.18"
]
},
{
"date": "2022-10-17",
"version": "3.202210.2",
Expand All @@ -7,7 +17,7 @@
"SAPUI5 to version 107.0",
"Support New CAP Integer Types - TINYINT UInt8 and SMALLINT Int16",
"Support for Postgres in Inspect Table and View",
"Default Values Support [Issue #87](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/87)"
"Default Values Support [Issue #87](https://github.com/SAP-samples/hana-developer-cli-tool-example/issues/87)"
]
},
{
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

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

## [3.202212.1] - 2022-12-01

**Changed**

- 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)
- CAP October 2022 Release
- SAPUI5 to version 109.0
- New Node.js minimal version is 14.18

## [3.202210.2] - 2022-10-17

**Changed**
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ Options:
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
cloud.sap/docs/cds/cdl#predefined-types)
[boolean] [default: false]
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
ifiers ier] [boolean] [default: false]
-p, --port Port to run HTTP server for CDS preview
[default: false]
```
Expand Down Expand Up @@ -1350,6 +1352,10 @@ Options:
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
cloud.sap/docs/cds/cdl#predefined-types)
[boolean] [default: false]
--useExists, --exists, --persistence Use Persistence Exists Annotation
[boolean] [default: true]
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
ifiers ier] [boolean] [default: false]
```
![inspectTable example](https://raw.githubusercontent.com/wiki/SAP-samples/hana-developer-cli-tool-example/images/inspectTable.gif)
Expand Down Expand Up @@ -1440,6 +1446,10 @@ Options:
--useHanaTypes, --hana Use SAP HANA-Specific Data Types See (https://cap.
cloud.sap/docs/cds/cdl#predefined-types)
[boolean] [default: false]
--useExists, --exists, --persistence Use Persistence Exists Annotation
[boolean] [default: true]
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
ifiers ier] [boolean] [default: false]
```
### libraries
Expand Down Expand Up @@ -1514,6 +1524,10 @@ Options:
Merge settings but will also include
some references that are incompatible
with HDI [boolean] [default: false]
--useExists, --exists, --persistence Use Persistence Exists Annotation
[boolean] [default: true]
-q, --useQuoted, --quoted, --quotedIdent Use Quoted Identifiers ![non-identif
ifiers ier] [boolean] [default: false]
--namespace, --ns CDS namespace [string] [default: ""]
--synonyms Filename to store sysnonyms
[string] [default: ""]
Expand Down
3 changes: 2 additions & 1 deletion _i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ gui.unloadPriority=Unload Priority
gui.created=Created At
gui.cds=CAP CDS
gui.hdbtable=HDBTable
gui.useExists=Ues Persistence Exists Annotation
gui.useExists=Use Persistence Exists Annotation
gui.useQuoted=Use Quoted Identifiers ![non-identifier]
hc.name=Name
hc.created=Create At
hc.status=Status
Expand Down
4 changes: 2 additions & 2 deletions app/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>hana-cli LaunchPad</title>
<script src="https://ui5.sap.com/1.107.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script src="https://ui5.sap.com/1.107.0/resources/sap-ui-core.js"
<script src="https://ui5.sap.com/1.109.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script src="https://ui5.sap.com/1.109.0/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout, sap.ui.rta, sap.dfa.help,sap.uxap"
data-sap-ui-compatVersion="edge" data-sap-ui-theme="sap_horizon" data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted" data-sap-ui-bindingSyntax="complex" data-sap-ui-xx-bindingSyntax="complex"
Expand Down
4 changes: 3 additions & 1 deletion app/resources/massConvert/view/App.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
<Label text="{i18nReuse>noColons}"/>
<CheckBox id="chkNoColons" selected="{/noColons}" />
<Label text="{i18nReuse>gui.useExists}"/>
<CheckBox id="useExists" selected="{/useExists}" tooltip="{i18nReuse>useExists}"/>
<CheckBox id="useExists" selected="{/useExists}" tooltip="{i18nReuse>useExists}"/>
<Label text="{i18nReuse>gui.useQuoted}"/>
<CheckBox id="useQuoted" selected="{/useQuoted}" tooltip="{i18nReuse>useQuoted}"/>
<core:Fragment fragmentName="sap.hanacli.common.view.Debug" type="XML"/>

</f:content>
Expand Down
20 changes: 18 additions & 2 deletions bin/cds.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export const builder = base.getBuilder({
default: false,
desc: base.bundle.getText("useHanaTypes")
},
useQuoted: {
alias: ['q', 'quoted', 'quotedIdentifiers'],
desc: base.bundle.getText("gui.useQuoted"),
type: 'boolean',
default: false
},
port: {
alias: ['p'],
type: 'number',
Expand Down Expand Up @@ -76,6 +82,10 @@ export function handler(argv) {
description: base.bundle.getText("useHanaTypes"),
type: 'boolean'
},
useQuoted: {
description: base.bundle.getText("gui.useQuoted"),
type: 'boolean'
},
port: {
description: base.bundle.getText("port"),
required: false,
Expand All @@ -96,6 +106,7 @@ export async function cdsBuild(prompts) {
let schema = await base.dbClass.schemaCalc(prompts, db)
let object, fields, constraints, cdsSource
dbInspect.options.useHanaTypes = prompts.useHanaTypes
dbInspect.options.useQuoted = prompts.useQuoted
dbInspect.options.noColons = true

if (!prompts.view) {
Expand Down Expand Up @@ -131,7 +142,12 @@ export async function cdsBuild(prompts) {
UI: {
LineItem: [ \n`;
for (let field of fields) {
cdsSource += `{$Type: 'UI.DataField', Value: ![${field.COLUMN_NAME}], ![@UI.Importance]:#High}, \n`
if(prompts.useQuoted){
cdsSource += `{$Type: 'UI.DataField', Value: ![${field.COLUMN_NAME}], ![@UI.Importance]:#High}, \n`
}else{
cdsSource += `{$Type: 'UI.DataField', Value: ${field.COLUMN_NAME}, ![@UI.Importance]:#High}, \n`
}

}
cdsSource +=
`], \n`
Expand Down Expand Up @@ -237,7 +253,7 @@ async function cdsServerSetup(prompts, cdsSource) {
base.debug(`In Read Exit ${prompts.table}`)
let query1 = await cds.parse.cql (`SELECT from ${prompts.table}`)
// @ts-ignore
req.query.SELECT.from = query1.SELECT.from // ["STAR_WARS_FILM"]//[`![${prompts.table}]`]
req.query.SELECT.from = query1.SELECT.from
req.query = query1
let query = "SELECT "
// @ts-ignore
Expand Down
11 changes: 11 additions & 0 deletions bin/inspectTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export const builder = base.getBuilder({
desc: base.bundle.getText("gui.useExists"),
type: 'boolean',
default: true
},
useQuoted: {
alias: ['q', 'quoted', 'quotedIdentifiers'],
desc: base.bundle.getText("gui.useQuoted"),
type: 'boolean',
default: false
}
})

Expand Down Expand Up @@ -76,6 +82,10 @@ export let inputPrompts = {
useExists: {
description: base.bundle.getText("gui.useExists"),
type: 'boolean'
},
useQuoted: {
description: base.bundle.getText("gui.useQuoted"),
type: 'boolean'
}
}

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

dbInspect.options.useHanaTypes = prompts.useHanaTypes
dbInspect.options.useExists = prompts.useExists
dbInspect.options.useQuoted = prompts.useQuoted

let object = await dbInspect.getTable(db, schema, prompts.table)
let fields = await dbInspect.getTableFields(db, object[0].TABLE_OID)
Expand Down
11 changes: 11 additions & 0 deletions bin/inspectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export const builder = base.getBuilder({
desc: base.bundle.getText("gui.useExists"),
type: 'boolean',
default: true
},
useQuoted: {
alias: ['q', 'quoted', 'quotedIdentifiers'],
desc: base.bundle.getText("gui.useQuoted"),
type: 'boolean',
default: false
}
})

Expand Down Expand Up @@ -74,6 +80,10 @@ export function handler(argv) {
useExists: {
description: base.bundle.getText("gui.useExists"),
type: 'boolean'
},
useQuoted: {
description: base.bundle.getText("gui.useQuoted"),
type: 'boolean'
}
})
}
Expand All @@ -88,6 +98,7 @@ export async function viewInspect(prompts) {
base.debug(`${base.bundle.getText("schema")}: ${schema}, ${base.bundle.getText("view")}: ${prompts.view}`)
dbInspect.options.useHanaTypes = prompts.useHanaTypes
dbInspect.options.useExists = prompts.useExists
dbInspect.options.useQuoted = prompts.useQuoted

let object = await dbInspect.getView(db, schema, prompts.view)
let fields = []
Expand Down
Loading

0 comments on commit 5ca85c1

Please sign in to comment.