From de46b182434783b777320186e5034c1b8d108bb1 Mon Sep 17 00:00:00 2001 From: Timothy McCallum Date: Mon, 27 May 2024 10:42:17 +1000 Subject: [PATCH 1/2] Fix formatting in code sections Signed-off-by: tpmccallum tim.mccallum@fermyon.com Signed-off-by: Timothy McCallum --- content/cloud/noops-sql-db.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/content/cloud/noops-sql-db.md b/content/cloud/noops-sql-db.md index 32eb7a538..2cf15fc18 100644 --- a/content/cloud/noops-sql-db.md +++ b/content/cloud/noops-sql-db.md @@ -47,10 +47,19 @@ See [preparing an SQLite Database](https://developer.fermyon.com/spin/sqlite-api When developing locally, you may also want to test queries, check tables were created properly, or inspect the data in your local SQLite database. [`sqlite3`](https://sqlite.org/cli.html) is a command line program that allows users to evaluate queries interactively. You can point the `sqlite3` CLI to the `.spin/sqlite_db.db` file, located in your application directory, to view or modify your database directly. _Note: `.spin/sqlite_db.db` is created on `spin up`._ +The following initializes an sqlite3 CLI that is connected to the `./spin/sqlite_db.db` database: + + + ```bash $ sqlite3 .spin/sqlite_db.db SQLite version 3.43.2 2023-10-10 13:08:14 Enter ".help" for usage hints. +``` + +After connecting you can go ahead and execute sqlite commands in the CLI: + +```bash sqlite> .tables Users sqlite> SELECT * FROM Users; @@ -124,9 +133,10 @@ $ spin cloud sqlite execute -d mydb "CREATE TABLE IF NOT EXISTS todos (id INTEGE Now you can deploy your application and select `mydb` as the resource you would like to link your application to: + + ```bash -```bash -spin deploy +$ spin deploy Uploading todo-app version 0.1.0-r234fe5a4 to Fermyon Cloud... Deploying... App "todo-app" accesses a database labeled "default" From b29fd39865ef221755d283fcfc136173f57cbf86 Mon Sep 17 00:00:00 2001 From: Timothy McCallum Date: Mon, 27 May 2024 10:57:50 +1000 Subject: [PATCH 2/2] Update content/cloud/noops-sql-db.md Signed-off-by: tpmccallum tim.mccallum@fermyon.com Co-authored-by: itowlson Signed-off-by: Timothy McCallum --- content/cloud/noops-sql-db.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cloud/noops-sql-db.md b/content/cloud/noops-sql-db.md index 2cf15fc18..073d9123f 100644 --- a/content/cloud/noops-sql-db.md +++ b/content/cloud/noops-sql-db.md @@ -57,7 +57,7 @@ SQLite version 3.43.2 2023-10-10 13:08:14 Enter ".help" for usage hints. ``` -After connecting you can go ahead and execute sqlite commands in the CLI: +After connecting you can go ahead and execute SQLite commands in the CLI: ```bash sqlite> .tables