gen-jhipster
Version:
Spring Boot + Angular/React/Vue in one handy generator
83 lines (82 loc) • 3.06 kB
TypeScript
import type { ValidationResult } from '../../base/api.js';
type DatabaseTypeData = {
name: string;
defaultPrimaryKeyType: string;
};
export declare const databaseTypeData: Record<string, DatabaseTypeData>;
export declare const getDatabaseTypeData: (databaseType: string) => DatabaseTypeData;
export declare const R2DBC_DB_OPTIONS: {
value: any;
name: string;
}[];
export declare const SQL_DB_OPTIONS: {
value: any;
name: string;
}[];
/**
* Get DB type from DB value
* @param {string} db - db
*/
export declare function getDBTypeFromDBValue(db: any): any;
/**
* get for tables/constraints in JHipster preferred style after applying any length limits required.
*
* @param {string} tableOrEntityName - name of the table or entity
* @param {string} columnOrRelationshipName - name of the column or relationship
* @param {number} limit - max length of the returned db reference name
* @param {object} [options]
* @param {boolean} [options.noSnakeCase = false] - do not convert names to snakecase
* @param {string} [options.prefix = '']
* @param {string} [options.separator = '__']
* @return {string} db referente name
*/
export declare function calculateDbNameWithLimit(tableOrEntityName: string, columnOrRelationshipName: string, limit: number, { noSnakeCase, prefix, separator }?: {
noSnakeCase?: boolean;
prefix?: string;
separator?: string;
}): string;
type ConstraintName = {
prodDatabaseType?: string;
noSnakeCase?: boolean;
prefix?: string;
suffix?: string;
skipCheckLengthOfIdentifier?: boolean;
};
/**
* get a constraint name for tables in JHipster preferred style
*/
export declare function calculateDbName(tableOrEntityName: string, columnOrRelationshipName: string, { prodDatabaseType, noSnakeCase, prefix, suffix, skipCheckLengthOfIdentifier }?: ConstraintName): ValidationResult & {
value: string;
};
type FKConstraintName = {
prodDatabaseType?: string;
noSnakeCase?: boolean;
skipCheckLengthOfIdentifier?: boolean;
};
/**
* get a foreign key constraint name for tables in JHipster preferred style.
*/
export declare function getFKConstraintName(tableOrEntityName: string, columnOrRelationshipName: string, { prodDatabaseType, noSnakeCase, skipCheckLengthOfIdentifier }?: FKConstraintName): ValidationResult & {
value: string;
};
type JoinTableName = {
prodDatabaseType?: string;
skipCheckLengthOfIdentifier?: boolean;
};
/**
* get a table name for joined tables in JHipster preferred style.
*/
export declare function getJoinTableName(entityName: any, relationshipName: any, { prodDatabaseType, skipCheckLengthOfIdentifier }?: JoinTableName): ValidationResult & {
value: string;
};
type UXConstraintName = {
prodDatabaseType?: string;
noSnakeCase?: boolean;
};
/**
* get a unique constraint name for tables in JHipster preferred style.
*/
export declare function getUXConstraintName(entityName: string, columnName: string, { prodDatabaseType, noSnakeCase }?: UXConstraintName): ValidationResult & {
value: string;
};
export {};