How to modify Cloudflare D1 databases after creation
I have a table where there is already data, and I don't want to delete the table to change the structure of the table, so is it possible to change the structure of the table without recreating it? Apparently, it is possible to make indexed fields, even though it was not possible at creation.
Will the database support INNER JOIN statements or similar because I have data in many tables in the style of a MariaDB database? I have authors and topics in another table, and I need data from those at the same time when using the videos table.
3 Replies
you can use d1 console and alter table & more.
For more detailed docs on altering tables, see: https://www.sqlite.org/lang_altertable.html
Yes INNER JOIN is supported, for more examples, see https://www.sqlitetutorial.net/sqlite-join/
admin
SQLite Tutorial
A Visual Explanation of SQLite Joins
In this tutorial, you will learn about various kinds of SQLite joins to query data from two or more tables.
Alter table and creation of indexes (https://www.sqlitetutorial.net/sqlite-index/) can be performed after the table in initially created.
admin
SQLite Tutorial
SQLite Index: An Essential Guide to SQLite Indexes
In this tutorial, you will learn how to utilize SQLite index to query data faster, speed up sort operation, and enforce unique constraints.