Closed ThePlenkov closed 3 years ago
In our CAP project we use hana-cli mc to convert database schema to cds. Later we use this cds in service cds views.
However it's quite time consuming to export every time table by table if schema contains many tables.
To improve the experience we can just declare namespace and then use this namespace in using instruction.
using
As an example if mc generates this file as model.cds:
entity![com.company.package::Table_1]{ ... }; entity![com.company.package::Table_2]{ ... }; entity![com.company.package::Table_3]{ ... }; entity![com.company.package::Table_4]{ ... };
then it requires us to write manually in each cds:
using {![com.company.package::Table_1], ![com.company.package::Table_2], ![com.company.package::Table_3] ... } from './model';
What is the proposal:
use hana-cli mc --namespace schema. Then generated file will look like this:
hana-cli mc --namespace schema
namespace schema; entity1, entity2....
and we can reuse it already much easier
using schema from './model';
will propose in MR
Merged into version 2.202105.5 - will release that version soon
In our CAP project we use hana-cli mc to convert database schema to cds. Later we use this cds in service cds views.
However it's quite time consuming to export every time table by table if schema contains many tables.
To improve the experience we can just declare namespace and then use this namespace in
using
instruction.As an example if mc generates this file as model.cds:
then it requires us to write manually in each cds:
What is the proposal:
use
hana-cli mc --namespace schema
. Then generated file will look like this:and we can reuse it already much easier