Skip to content

Conversation

@karthikscale3
Copy link
Contributor

@karthikscale3 karthikscale3 commented Oct 25, 2025

Summary

The @workflow/world-postgres package currently requires users to manually copy and run SQL queries to set up the required database tables. This PR simplifies the setup process by:

  1. Exporting the database schema - Users can now import schema definitions programmatically
  2. Adding a CLI tool - One-command database setup with .env file support
  3. Including migration SQL files - SQL files are now part of the published package

Usage

pnpm exec workflow-postgres-setup

Output:

🔧 Setting up database schema...
📍 Connection: postgres://postgres:****@db.yourcloudprovider.co:5432/postgres
✅ Database schema created successfully!

Created tables:
  - workflow_runs
  - workflow_events
  - workflow_steps
  - workflow_hooks
  - workflow_stream_chunks

@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2025

🦋 Changeset detected

Latest commit: b3d05ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/world-postgres Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Oct 25, 2025

@karthikscale3 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@karthikscale3 karthikscale3 changed the title feat @workflow/world-postgres: implemented a script for setting up the required tables feat(@workflow/world-postgres): implemented a script for setting up the required tables Oct 25, 2025
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
kmk142789
kmk142789 previously approved these changes Oct 25, 2025
"type": "module",
"main": "dist/index.js",
"bin": {
"workflow-postgres-setup": "./bin/setup.js"
Copy link
Collaborator

Choose a reason for hiding this comment

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

question for @Schniz - curious if we could just keep this as the main bin? that way npx @workflow/world-postgres

i'm indifferent

Copy link
Member

Choose a reason for hiding this comment

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

Not a strong opinion, but I think since it's a one-time setup script separate from regular intended execution, it makes sense for it to be named like it's in the PR

Copy link
Collaborator

@pranaygp pranaygp left a comment

Choose a reason for hiding this comment

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

LGTM but will let @VaguelySerious or @Schniz do the final stamp! thank you so much :)

@pranaygp pranaygp linked an issue Oct 30, 2025 that may be closed by this pull request
Copy link
Member

@VaguelySerious VaguelySerious left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for polishing the setup

@@ -0,0 +1,65 @@
#!/usr/bin/env node
Copy link
Member

Choose a reason for hiding this comment

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

This seems like it's not needed given we except this to either be imported by the bin (and run), or imported in a module

@VaguelySerious VaguelySerious merged commit 3dd25de into vercel:main Oct 30, 2025
8 of 23 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.

DX improvement suggestion for @workflow/world-postgres

5 participants