Skip to content

chore: add seed db script#42

Merged
viganogabriele merged 6 commits into
mainfrom
seed-db
Jul 22, 2026
Merged

chore: add seed db script#42
viganogabriele merged 6 commits into
mainfrom
seed-db

Conversation

@viganogabriele

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e5691eaf-5029-4d77-9034-b5771c9517c8

📥 Commits

Reviewing files that changed from the base of the PR and between ce07438 and 80b301c.

📒 Files selected for processing (3)
  • scripts/seed-db.ts
  • scripts/seed-user.ts
  • src/routers/tg/messages.ts
💤 Files with no reviewable changes (1)
  • scripts/seed-user.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/seed-db.ts

Walkthrough

Adds a Bun database seeding command that resets and populates Telegram tables with encrypted synthetic data, while Telegram message router procedures use an exported cipher instance.

Changes

Telegram Data Tooling

Layer / File(s) Summary
Seed command and reset control
package.json, scripts/seed-db.ts, scripts/seed-user.ts
Adds seed:db, defines seed datasets and helpers, checks existing Telegram tables, truncates them with --force, and removes the top-level server import from user seeding.
User, group, and message generation
scripts/seed-db.ts
Generates encrypted users, randomized groups, and encrypted messages with linked authors, random group assignments, per-chat IDs, timestamps, batched inserts, and completion counts.
Exported Telegram message cipher
src/routers/tg/messages.ts
Exports tgMessagesCipher and uses it for message encryption and decryption across router procedures.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a new database seeding script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/seed-db.ts`:
- Around line 12-69: Apply the repository’s Biome formatter to
scripts/seed-db.ts and commit the resulting formatting changes, ensuring the
file passes bun run biome ci . without altering its behavior.
- Around line 48-62: Protect the force reseeding branch in the seed script by
requiring an explicit development/non-production database guard before executing
the TRUNCATE through DB.execute. Update the existing force handling around argv
and the existing-data check so --force exits safely when the configured database
target is not explicitly approved, while preserving normal seeding and the
existing refusal behavior for populated databases without --force.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b52a2f7-014e-430c-bc9a-dbe27ab0139f

📥 Commits

Reviewing files that changed from the base of the PR and between fe27ead and ce07438.

📒 Files selected for processing (2)
  • package.json
  • scripts/seed-db.ts

Comment thread scripts/seed-db.ts
Comment thread scripts/seed-db.ts
@viganogabriele
viganogabriele merged commit e8fc9ad into main Jul 22, 2026
2 checks passed
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.

3 participants