Skip to content

Commit

Permalink
feat: improved orm code generator compitability (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
cl-shaharshavit-rnd authored Jun 8, 2021
1 parent f328c69 commit 6f16283
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const catalogDbEntityMetadataKey = Symbol('catalogdbentitymapping');

export interface ICatalogDBEntityMapping {
table: string; // database table name
className: string;
}

export function catalogDBEntity(catalogdbentitymapping: ICatalogDBEntityMapping): ClassDecorator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export interface IColumnProps {
name?: string;
type: string;
nullable?: boolean;
defaultValue?: string;
isPrimary?: boolean;
isIndexed?: boolean;
default?: string;
primary?: boolean;
unique?: boolean;
spatialFeatureType?: string;
srid?: number;
}
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export { IShpMapping, ShapeFileType } from './decorators/property/shp.decorator'
export { TsTypes, IDescribeTsType, PropertiesTypes } from './decorators/property/tsTypes.decorator';
export { IPYCSWMapping } from './decorators/property/csw.decorator';
export { IColumnProps } from './decorators/property/catalogDB.decorator';
export { ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator';
export { IOrmCatalog } from '../common/interfaces/ormCatalog.interface';

export * from './pycswLayerCatalogRecord';
Expand Down
2 changes: 1 addition & 1 deletion src/models/layerMetadata/layer3DMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
column: {
name: 'producer_name',
type: 'text',
defaultValue: 'IDFMU',
default: 'IDFMU',
nullable: true,
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/models/layerMetadata/layerMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
column: {
name: 'producer_name',
type: 'text',
defaultValue: 'IDFMU',
default: 'IDFMU',
nullable: true,
},
})
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/pycsw3DCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Layer3DMetadata, IPropPYCSWMapping } from './layer3DMetadata';

@catalogDBEntity({
table: 'records',
className: 'Metadata',
})
@graphqlClass({ alias: 'Layer3DRecord' })
export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreModel, IOrmCatalog {
Expand Down
2 changes: 2 additions & 0 deletions src/models/layerMetadata/pycswLayerCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';

@catalogDBEntity({
table: 'records',
className: 'RecordEntity',
})
@graphqlClass({ alias: 'LayerRasterRecord' })
export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCoreModel, IOrmCatalog {
Expand All @@ -27,6 +28,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore
name: 'identifier',
type: 'text',
nullable: false,
primary: true,
},
})
@tsTypes({
Expand Down

0 comments on commit 6f16283

Please sign in to comment.