PlanetScale provide a hosted MySQL database with 5GB of storage included in the free tier.
1. Sign up to PlanetScale2. Create a new database3. Create a password4. Create your first table5. Insert an item6. Query an item7. Do more than queries!
1. Sign up to PlanetScale
2. Create a new database
Select New database on the dashboard.
Create a database.
3. Create a password
Go to Settings β Passwords and click New password.
Save the
host
, username
, and password
values as Val Town secrets β use planetScaleHost
, planetScaleUsername
, and planetScalePassword
respectively.4. Create your first table
Copy and paste this val to create a table with the given schema.
5. Insert an item
Insert one or more items.
6. Query an item
Use the
rows
property to get your query results β or return the entire results
object to see what other data is available.7. Do more than queries!
Read the source of the
@vtdocs.queryPlanetScale
helper, see how it uses the @planetscale/database
SDK, refer to the driverβs documentation, and extend it!