Create postgres project scaffold on local init#241
Open
sdairs wants to merge 2 commits into
Open
Conversation
`local init` now creates a `postgres/` scaffold (tables/, materialized_views/, queries/, seed/) alongside the existing `clickhouse/` scaffold, so Postgres project files have a home too. Generalized `create_project_scaffold` to take the target dir and subdirs, added unit tests covering creation and idempotency, and updated the agent help text and README. Closes #221 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Postgres scaffold now uses tables/, views/, functions/, queries/, seed/ — plain views and functions/procedures are far more central to a Postgres project than ClickHouse-style materialized views, which in PG are just manually-refreshed query snapshots. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #221.
local initpreviously only created theclickhouse/project scaffold. It now also creates apostgres/scaffold so Postgres project files have a home.The Postgres scaffold is PG-native rather than a mirror of the ClickHouse one: plain
views/andfunctions/(procedures) are far more central to a Postgres project than ClickHouse-style materialized views — in Postgres a materialized view is just a manually-refreshed query snapshot, not an insert-time pipeline.Each subdir gets a
.gitkeep.Changes
init.rs: addedpostgres_project_dir(); generalizedcreate_project_scaffoldto take an explicit target dir + subdirs and call it for both engines..gitkeep) and idempotency.local initagent help text andREADME.md.Testing
cargo test -p clickhousectlcargo clippy -p clickhousectl🤖 Generated with Claude Code
Note
Low Risk
Filesystem-only init scaffolding and docs; no runtime server, auth, or data-path behavior changes.
Overview
clickhousectl local initnow scaffolds a committedpostgres/tree alongside the existingclickhouse/layout, so Postgres SQL assets have a standard home next to ClickHouse project files.Scaffold creation is refactored:
create_project_scaffoldtakes a target directory and subdirectory list and is invoked twice—clickhouse/keepstables,materialized_views,queries,seed;postgres/getstables,views,functions,queries,seed(each with.gitkeep).postgres_project_dir()was added for the new root. Unit tests cover directory/.gitkeepcreation and idempotent re-runs. README andlocal initagent help text document both trees.Reviewed by Cursor Bugbot for commit 54d974b. Bugbot is set up for automated code reviews on this repo. Configure here.