Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of using file to populate cloud database tables and execute sql #1079

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions content/cloud/noops-sql-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ inspirational-pig (default)
$ spin cloud sqlite execute inspirational-pig "CREATE TABLE IF NOT EXISTS todos (id INTEGER PRIMARY KEY AUTOINCREMENT,description TEXT NOT NULL,due_date DATE,starred BOOLEAN DEFAULT 0,is_completed BOOLEAN DEFAULT 0)"
```

If you prefer to pass a file that contains the SQL you want to execute, you can do so by prefixing the file name with an `@` like so:

<!-- @selectiveCpy -->

```bash
$ spin cloud sqlite execute -d inspirational-pig @mysql.sql
```

> Note: The Cloud database is completely unrelated to the local database, and must be prepared separately.

### Explicitly Create A Database Via `spin cloud sqlite create`
Expand Down
Loading