-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
TemplateTemplate issueTemplate issue
Description
Given that you have you CLI authorization set up correct you can run a SQL script against your PlanetScale database like this:
pscale shell sample main --org lakruzz < createdb.sql
In the command above, sample is the name of the Planetscale database you want to connect to, main is the name of the branch you want to connect to, --org lakruzz specifies the organization (a.k.a you user handle) and < createdb.sql redirects the contents of the SQL script to the shell subcommand, which is used by pscale shell to connect to the database and open a prompt - or in this case - execute the script.
The branch is not required, if the database only have one. And you can use the same command ot open an interactive SQL prompt like this:
pscale shell sample --org lakruzz
For more details see:
- Blog: "Run SQL script files on a PlanetScale database"
- Reference manual: PlaneScale CLI
Metadata
Metadata
Assignees
Labels
TemplateTemplate issueTemplate issue