-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v5.16.0 - *Enhancement:* Database code-generation defaults to the use of [JSON](https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server)-serialized parameters versus UDT/TVP to minimize the need for additional database objects; specifically [User-Defined Types](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql) (UDT). - A new `CollectionType` property has been added to the code-generation configuration for query-based collection passing; supports `JSON` (default) and `UDT` (previous) values. Note that for JSON passing a `NVARCHAR(MAX)` type should be used. - A merge for a sub-collection would previously require a `UDT` to be created; this is now handled using JSON serialization, unless explicitly required (example YAML `udt: true, tvp: WorkHistory`). - *Enhancement:* The out-of-the-box _Beef_ `Type` schema objects (`udtBigIntList.sql`, `udtDateTimeList.sql`, `udtIntList.sql`, `udtNVarCharList.sql` and `udtUniqueIdentifierList.sql`) have been removed and will not be automatically included. Where required, these should be manually added to the database project and managed accordingly; use this [`create-beef-user-defined-types.sql`](./tools/Beef.Database.SqlServer/Migrations/create-beef-user-defined-types.sql) migration script to add. - *Enhancement:* All code-generated SQL objects have been updated to support replacement, for example `CREATE OR ALTER` versus previous `CREATE`; this potentially minimizes the need to drop and recreate each migration. This _DbEx_ behavior is predicated on not having any `Type` (UDT) schema objects which do not support replacement. It is also therefore recommended that all non-generated schema objects support replacement as they all have to adhere to this pattern to avoid unnecessary dropping.
- Loading branch information
Showing
147 changed files
with
758 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...les/Demo/Beef.Demo.Database/Migrations/20241002-085013-create-beef-user-defined-types.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/Beef | ||
|
||
IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtBigIntList' AND is_user_defined = 1) | ||
BEGIN | ||
CREATE TYPE [dbo].[udtBigIntList] AS TABLE | ||
( | ||
[Value] BIGINT | ||
) | ||
END | ||
|
||
IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtDateTime2List' AND is_user_defined = 1) | ||
BEGIN | ||
CREATE TYPE [dbo].[udtDateTime2List] AS TABLE | ||
( | ||
[Value] DATETIME2 | ||
) | ||
END | ||
|
||
IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtIntList' AND is_user_defined = 1) | ||
BEGIN | ||
CREATE TYPE [dbo].[udtIntList] AS TABLE | ||
( | ||
[Value] INT | ||
) | ||
END | ||
|
||
IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtNVarCharList' AND is_user_defined = 1) | ||
BEGIN | ||
CREATE TYPE [dbo].[udtNVarCharList] AS TABLE | ||
( | ||
[Value] NVARCHAR(MAX) | ||
) | ||
END | ||
|
||
IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtUniqueIdentifierList' AND is_user_defined = 1) | ||
BEGIN | ||
CREATE TYPE [dbo].[udtUniqueIdentifierList] AS TABLE | ||
( | ||
[Value] UNIQUEIDENTIFIER | ||
) | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2Create.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2Delete.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2Get.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2GetAll.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CREATE PROCEDURE [Demo].[spPerson2GetAll] | ||
CREATE OR ALTER PROCEDURE [Demo].[spPerson2GetAll] | ||
AS | ||
BEGIN | ||
/* | ||
|
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2Update.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPerson2Upsert.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonCreate.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonDelete.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonGet.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonGetAll.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...les/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonGetDetail.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonGetDetailByArgs.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonUpdate.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spPersonUpdateDetail.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spWorkHistoryGetByPersonId.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....Demo.Database/Schema/Demo/Stored Procedures/Generated/spWorkHistoryGetUsingTempTable.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spWorkHistoryMerge.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...emo/Beef.Demo.Database/Schema/Outbox/Stored Procedures/Generated/spEventOutboxDequeue.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.