Skip to content

add feature to generate output without namespace #25

@abenhamdine

Description

@abenhamdine

Currently, namespace parameter is required.

If one runs schemats without argument -n (or with empty one) like that :
schemats generate -c postgres://postgres@localhost/osm -t users -o osm.ts

It ends up with the following output in osm.ts :

export namespace undefined {

    export namespace usersFields {
...

Using a namespace for a whole module in typescript is ok, but a bit outdated.
With es2015 modules, it seems preferable to generate directly :

    export namespace usersFields {
...

wich allows to import as following :

import * as myNamespaceInConsumerModule from 'osm.ts'
...

It would be nice to make namespace optional.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions