Content Deep Dive
Run SQL script files on a PlanetScale database
Blog post from PlanetScale
Post Details
Company
Date Published
Author
Brian Morrison II
Word Count
396
Language
English
Hacker News Points
-
Summary
Creating an empty database on PlanetScale allows for easy population with data from a script file, streamlining the process of managing large numbers of commands. To achieve this, users need to have a PlanetScale account and the CLI installed, as well as a script containing SQL commands. By utilizing the `pscale shell` command with the `<` operator, users can pipe in commands from their script file, creating a new database with a populated schema in a single step. Once created, users can interactively run queries on the database using the PlanetScale CLI.