Class E000_BulkInsert
Example: Bulk insert of complex employee records.
Classic ORM (EF Core) would require ~28 tables:
Employees - main tableEmployeeSkills - string[] Skills (FK)EmployeeSkillLevels - int[] SkillLevels (FK)EmployeeCertifications - string[] (FK)EmployeeCertificationYears - int[] (FK)Addresses - for Home/Work/Emergency (FK)BuildingInfos - nested in Address (FK)BuildingAmenities - string[] in BuildingInfo (FK)BuildingAccessCodes - int[] in BuildingInfo (FK)BuildingParkingSpots - string[] (FK)BuildingElevatorFloors - int[] (FK)Contacts - Contact[] (FK)ContactNotificationHours - int[] in Contact (FK)ContactMetadata - ContactDetail[] in Contact (FK)ProjectMetrics - RedbObject referenceProjectTags - Tag[] in ProjectMetrics (FK)ProjectTechnologies - string[] in ProjectMetrics (FK)EmployeePastProjects - many-to-many (2 FK)PhoneDirectory - Dictionary (FK)OfficeLocations - Dictionary + Address (2 FK)BonusByYear - Dictionary (FK)DepartmentHistory - Dictionary (FK)Departments - nested classDepartmentProjects - string[] (FK)DepartmentLeaders - Tag[] (FK)DepartmentBudgetByYear - nested Dictionary (FK)PerformanceReviews - tuple key Dictionary (FK)ProjectMetricsDict - Dictionary with RedbObject (2 FK)
INSERTs per employee: ~40-60 records across 28 tables with FK ordering.
For 100 employees: 4000-6000 INSERTs!
REDB: 2 tables (_objects + _values), ~3000 records, single BulkInsert via COPY.
[ExampleMeta("E000", "Bulk Insert - Complex Objects", "Setup", ExampleTier.Free, 1, new string[] { "BulkInsert", "AddNewObjectsAsync", "COPY" })]
public class E000_BulkInsert : ExampleBase
Inheritance
Inherited Members
Methods
RunAsync(IRedbService)
Run the example and return result.
public override Task<ExampleResult> RunAsync(IRedbService redb)