Skip to content

feat: give each example project a __routing__.py - #21

Draft
OmerBaddour wants to merge 1 commit into
mainfrom
worktree-example-projects-routing
Draft

feat: give each example project a __routing__.py#21
OmerBaddour wants to merge 1 commit into
mainfrom
worktree-example-projects-routing

Conversation

@OmerBaddour

Copy link
Copy Markdown
Member

PR #17 moved routing into a project __routing__.py. The example projects had none, thus they did not show the feature, and clair validate had no rules to apply.

What each project gets

Every project in example_projects/ now holds a __routing__.py with two entries:

Environment Physical write target
dev <database>_<CLAIR_USER>
prod the logical names

example_from_init holds the clair init template, byte for byte, because that project shows the output of clair init. It went stale when #17 added the routing file to the scaffold.

Stale CLI names in the READMEs

The project READMEs named ~/.clair/profiles.yml and a --profile option. Both are gone from the CLI. The READMEs now name ~/.clair/environments.yml and --env.

Each README also gets a Routing section: the two entries, the CLAIR_USER variable, and the clair validate commands.

The top-level README

The example table omitted example_4 and example_from_init, and it promised a setup.sql and a verify.sql in each project. No project holds either file — the SQL is in the README of each project. Both statements are now correct.

Behaviour changes

None. This PR adds project files and corrects documentation. It changes no code in src/.

Verification

  • clair validate passes for all five projects, in dev and in prod.
  • clair compile on example_1 with CLAIR_USER=alice writes to example_1_database_ALICE. The SOURCE Trouve keeps its logical name.
  • Without CLAIR_USER, compile stops with the routing error, as designed.
  • 592 tests pass. uvx ruff check and uvx ty check --exclude example_notebooks are clean.

🤖 Generated with Claude Code

PR #17 moved routing into a project __routing__.py. The example projects had
none, thus they did not show the feature and `clair validate` had no rules to
apply.

Each project now holds a routing table with a `dev` entry and a `prod` entry.
example_from_init holds the scaffold template, byte for byte, because that
project shows the output of `clair init`.

The READMEs also named `~/.clair/profiles.yml` and a `--profile` option. Both
are gone from the CLI. The READMEs now name `~/.clair/environments.yml` and
`--env`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant