beef-database-codegen
Beef (Business Entity Execution Framework) database code-generation configuration
| File match |
database.beef.yaml
database.beef.yml
database.beef.json
|
|---|---|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/beef-database-codegen/latest.json |
| Source | https://raw.githubusercontent.com/Avanade/Beef/master/tools/Beef.CodeGen.Core/Schema/database.beef.json |
Validate with Lintel
npx @lintel/lintel check
All of
Definitions
The 'CodeGeneration' object defines global properties that are used to drive the underlying database-driven code generation.
This is used as the default 'Schema' for all child objects.
Defaults to 'IsDeleted'.
Defaults to 'TenantId'.
Defaults to 'OrgUnitId'.
Defaults to 'RowVersion'.
Defaults to 'CreatedBy'.
Defaults to 'CreatedDate'.
Defaults to 'UpdatedBy'.
Defaults to 'UpdatedDate'.
Defaults to 'UpdatedBy'.
Defaults to 'UpdatedDate'.
Defaults to '[Sec].fnGetUserOrgUnits'.
Defaults to '[Sec].[spCheckUserHasPermission]'.
Defaults to '[Sec].[fnGetUserHasPermission]'.
Defaults to 'XCdc' (literal).
Defaults to 'CdcTracking' (literal).
Defaults to 'CdcIdentifierMapping' (literal).
Defaults to 'spCreateCdcIdentifierMapping' (literal).
Defaults to 'Newtonsoft'. This can be overridden within the 'Entity'(s).
Defaults to 'true'.
Defaults 'SnakeKebabToPascalCase' that will remove any underscores or hyphens separating each word and capitalize the first character of each; e.g. 'internal-customer_id' would be renamed as 'InternalCustomerId'. The 'PascalCase' option will capatilize the first character only.
Defaults to 'Common' for backwards compatibility; 'Autonomous' is recommended. Determines where the entity is scoped/defined, being 'Common' or 'Business' (i.e. not externally visible).
Used to enable the sending of messages to the likes of EventHub, Service Broker, SignalR, etc. This can be extended within the 'Entity'(s).
Defaults to 'NameAndKey' (being the event subject name appended with the corresponding unique key.)'.
Defaults to 'None' (no formatting required, i.e. as-is).
The event source is only updated where an 'EventSourceKind' is not 'None'. This can be extended within the 'Entity'(s).
Defaults to 'None' (being the event source is not updated).
Defaults to 'NameAndKey' (being the event subject name appended with the corresponding unique key.)'.
Defaults to 'EventOutbox' (literal).
Defaults to 'Company' (runtime parameter) + '.' + 'AppName' (runtime parameter). For example 'Beef.Demo'.
Defaults to 'PathBase' + '.Database/Schema' (literal). For example 'Beef.Demo.Database/Schema'.
Defaults to 'PathBase' + '.Database/Migrations' (literal). For example 'Beef.Demo.Database/Migrations'.
Defaults to 'PathBase' + '.Business' (literal). For example 'Beef.Demo.Business'.
Defaults to 'PathBase' + '.Cdc' (literal). For example 'Beef.Demo.Cdc'.
This is only applicable for stored procedures.
Defaults to 'Company' (runtime parameter) + '.' + 'AppName' (runtime parameter). For example 'Beef.Demo'.
Defaults to 'NamespaceBase' + '.Common' (literal). For example 'Beef.Demo.Common'.
Defaults to 'NamespaceBase' + '.Business' (literal). For example 'Beef.Demo.Business'.
Defaults to 'NamespaceBase' + '.CdcPublisher' (literal). For example 'Beef.Demo.CdcPublisher'.
The 'Table' object identifies an existing database 'Table' (or 'View') and defines its code-generation characteristics.
Defaults to 'CodeGeneration.Schema'.
Will automatically default where not specified.
Where not specified this indicates that all 'Columns' are to be included.
Where not specified this indicates no 'Columns' are to be excluded.
The 'GetAllOrderBy' is used to specify the 'GetAll' query sort order.
This relates to the 'GetAll' selection.
This will also require a 'Udt' (SQL User Defined Table) and 'Tvp' (.NET Table-Valued Parameter) to function.
Defaults to 'Name'.
Where not specified this indicates that no 'Columns' are to be excluded.
Defaults to 'CodeGeneration.EntityScope'. Determines where the entity is scoped/defined, being 'Common' or 'Business' (i.e. not externally visible).
Defaults to 'CodeGeneration.OrgUnitImmutable'. This is only applicable for stored procedures.
Defaults to 'CodeGeneration.IsDeleted'.
Defaults to 'CodeGeneration.TenantId'.
Defaults to 'CodeGeneration.OrgUnitId'.
Defaults to 'CodeGeneration.RowVersion'.
Defaults to 'CodeGeneration.CreatedBy'.
Defaults to 'CodeGeneration.CreatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
The code generation for an 'StoredProcedure' is primarily driven by the 'Type' property. This encourages (enforces) a consistent implementation for the standardised CRUD (Create, Read, Update and Delete) actions, as well as supporting 'Upsert', 'Merge' and ad-hoc queries as required.
See 'StoredProcedureName' for the actual name used in the database.
Defaults to 'GetColl'.
This only applies where the stored procedure operation 'Type' is 'GetColl'.
Defaults to 'sp' + 'Table.Name' + 'Name'; e.g. 'spTableName' or 'spPersonGet'.
Defaults to '[{{Table.Schema}}].[sp{{Table.Name}}Get]' passing the primary key column(s).
A 'Select * from #TempTable' is also performed (code-generated) where the stored procedure operation 'Type' is 'GetColl'.
This is used to override the default behaviour of using the primary key column(s).
Defaults to 'Table.OrgUnitImmutable'.
Where not specified this indicates that all 'Columns' are to be included. Only filters the columns where 'Type' is 'Get', 'GetColl', 'Create', 'Update' or 'Upsert'.
Where not specified this indicates no 'Columns' are to be excluded. Only filters the columns where 'Type' is 'Get', 'GetColl', 'Create', 'Update' or 'Upsert'.
The 'Parameter' is used to define a stored procedure parameter and its charateristics. These are in addition to those that are automatically inferred (added) by the selected 'StoredProcedure.Type'.
Defaults to 'Name'.
Note that when the parameter value is 'NULL' it will not be included in the query.
Defaults to 'EQ'.
The 'Where' object defines an additional where 'Statement' to be added. This is in addition to those automatically added based on the 'StoredProcedure.Type'.
The 'OrderBy' object defines the query order. Only valid for 'StoredProcedure.Type' of 'GetAll'.
Defaults to 'Ascending'.
The Execute object enables additional TSQL statements to be embedded within the stored procedure.
Defaults to 'After'.
The 'Query' object enables the definition of more complex multi-table queries ('Joins') that would primarily result in a database View. The primary table 'Name' for the query is required to be specified. Multiple queries can be specified for the same table(s). The 'IncludeColumns' and 'ExcludeColumns' provide a shorthand to include or exclude selected columns; with the 'AliasColumns' providing a means to rename where required (for example duplicate name). Additional 'Where' and 'Order' configuration can also be added as required.
Defaults to 'CodeGeneration.dbo'.
Will automatically default where not specified.
Where not specified this indicates that all 'Columns' are to be included.
Where not specified this indicates no 'Columns' are to be excluded.
Each alias value should be formatted as 'Column' + '^' + 'Alias'; e.g. 'PCODE^ProductCode'
Defaults to 'vw' + 'Name'; e.g. 'vwTableName'.
Defaults to 'Schema'.
The suffix is optional, and where not specified will default to '.READ'.
Defaults to 'CodeGeneration.IsDeleted'.
Defaults to 'CodeGeneration.TenantId'.
Defaults to 'CodeGeneration.OrgUnitId'.
Defaults to 'CodeGeneration.RowVersion'.
Defaults to 'CodeGeneration.CreatedBy'.
Defaults to 'CodeGeneration.CreatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
The 'QueryJoin' object defines a join to another (or same) table within a query. The 'Type' defines the join type, such as inner join, etc. The 'IncludeColumns' and 'ExcludeColumns' provide a shorthand to include or exclude selected columns; with the 'AliasColumns' providing a means to rename where required (for example duplicate name).
Defaults to 'Table.Schema'; i.e. same schema.
Will automatically default where not specified.
Defaults to 'Inner'.
Where not specified this indicates that all 'Columns' are to be included.
Where not specified this indicates no 'Columns' are to be excluded.
Each alias value should be formatted as 'Column' + '^' + 'Alias'; e.g. 'PCODE^ProductCode'
Defaults to 'CodeGeneration.IsDeleted'.
Defaults to 'CodeGeneration.TenantId'.
Defaults to 'CodeGeneration.OrgUnitId'.
Defaults to 'CodeGeneration.RowVersion'.
Defaults to 'CodeGeneration.CreatedBy'.
Defaults to 'CodeGeneration.CreatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
Defaults to 'CodeGeneration.UpdatedBy'.
Defaults to 'CodeGeneration.UpdatedDate'.
The 'QueryJoinOn' object defines the join on characteristics for a join within a query.
Defaults to 'Table.Schema'; i.e. same schema. See also 'ToTable' and 'ToColumn' as these all relate.
Defaults to 'Table.Name'; i.e. primary table. See also 'ToSchema' and 'ToColumn' as these all relate.
Defaults to 'Name'; i.e. assumes same name. See also 'ToSchema' and 'ToTable' as these all relate.
The 'QueryOrder' object that defines the query order.
See also 'Schema' and 'Table' as these all relate.
Defaults to 'Query.Schema'.
Defaults to 'Table.Name'; i.e. primary table. See also 'Schema' and 'Column' as these all relate.
Defaults to 'Ascending'.
The 'QueryWhere' object defines an additional where 'Statement' to be added.