Skip to content

Commit

Permalink
Merge pull request #1300 from fermyon/tpmccallum-patch-10
Browse files Browse the repository at this point in the history
Fix formatting in code sections
  • Loading branch information
Timothy McCallum authored May 27, 2024
2 parents 2102e36 + b29fd39 commit 5792ef2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions content/cloud/noops-sql-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<!-- @selectiveCpy -->

```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;
Expand Down Expand Up @@ -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:

<!-- @selectiveCpy -->

```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"
Expand Down

0 comments on commit 5792ef2

Please sign in to comment.