Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pscale connect to accept interactivity #951

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vinlock
Copy link

@Vinlock Vinlock commented Dec 24, 2024

View the before and after video here: https://screen.studio/share/YVe5yTeO

Updates the pscale connect command to support interactive input during execution. Previously, the command couldn’t handle user interactions. By adjusting the standard input configuration in internal/cmd/connect/connect.go, this change enables interactive sessions, enhancing the command’s usability.

Why?
I was having issues getting DrizzleORM's push command working with the new VECTOR data type in PlanetScale. It would not work with drizzle-kit by normally adding the credentials.

Though, when setting the dbCredentials in the Drizzle config to the following and using pscale connect --execute it works just fine:

export default {
	schema: './src/db/schema.ts',
	out: './drizzle/migrations',
	dialect: 'mysql',
	dbCredentials: {
		url: process.env.DATABASE_URL!,
	},
	strict: process.env.NODE_ENV !== 'production',
	verbose: true,
	casing: 'snake_case',
} satisfies Config

Reference Discord Thread: https://discord.com/channels/1134636291691126885/1321148787611402240

This change ensures that the executed commands inherit stdin from the parent process. It improves command interaction, allowing for user input when required during execution.
@Vinlock Vinlock requested a review from a team as a code owner December 24, 2024 21:17
Copy link
Member

@mscoutermarsh mscoutermarsh left a comment

Choose a reason for hiding this comment

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

Nice, thank you Dak!

@mscoutermarsh
Copy link
Member

The vector bug you're hitting: we'll need to look into that. Likely will be after holidays.

@mscoutermarsh
Copy link
Member

I'll get this merged and released later.

@Vinlock
Copy link
Author

Vinlock commented Dec 24, 2024

Thanks @mscoutermarsh! Happy Holidays!

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.

2 participants