masamune_model_tidb_annotation 3.3.0 copy "masamune_model_tidb_annotation: ^3.3.0" to clipboard
masamune_model_tidb_annotation: ^3.3.0 copied to clipboard

unlisted

Define annotations that generate TiDB Data Service configuration from Masamune models.

masamune_model_tidb_annotation #

Annotations for generating TiDB Data Service Configuration as Code from Masamune models.

@tidbDataService
@CollectionModelPath("users")
abstract class UserModel {
  const UserModel({required this.name});
  final String name;
}

TidbDataService can override the logical database, output directory, and Cloudflare rules.json path. Data Service v1 supports flat model paths only.

Define shared physical database prefixes once in katana.yaml. Every @tidbDataService model then generates the prefixed databases in addition to the unprefixed production database.

cloudflare:
  tidb:
    data_service:
      prefixes:
        - dev
        - staging
@tidbDataService
@CollectionModelPath("database/main/users")
abstract class UserModel {}

The values above are normalized to dev_ and staging_, generating main.users, dev_main.users, and staging_main.users. Rules are still evaluated with the logical database name main.

TidbDataService.prefixes remains available for model-specific additions. Its values are merged with the shared katana.yaml prefixes and deduplicated after normalization.

0
likes
0
points
222
downloads

Publisher

verified publishermathru.net

Weekly Downloads

Define annotations that generate TiDB Data Service configuration from Masamune models.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

masamune_annotation

More

Packages that depend on masamune_model_tidb_annotation