A workbench for Citus.
This repository includes:
- Test fixtures for starting Citus using Testcontainers
- Integration tests working with Citus using raw SQL statements
- Integration tests working with Citus using EF and proper modeling to support migrations + distribution
cd tests
# EF based tests
dotnet test --filter CitusEfTests
# Direct SQL tests
dotnet test --filter CitusDirectSqlTests
# EF based test with migrations
dotnet test --filter CitusDealershipTests- Distribution Key. This is the shard key that is used to determine which shard that a record will be located in. In this example, we build an app for schools and thus we want to use the
district_id. This field must:- Be included with every record that should be co-located
- Included on the primary key of the record
- Included on indexes
- Included in FK references
# To force remove a migration (not connected to DB)
dotnet ef migrations remove --force- Auto generate idempotent distribution statements using source generators
- Auto generate reference table statements using source generators
- Implicitly generated reference tables for M2M
- Inclusion of the distribution key into all queries (problematic for Prisma without it since the majority of queries are schema-based(easier for EF because of global query filters?))
- Global query filters need to be tested for navigation properties