Comments (3)
Thanks for filing the issue!
So, I'm not surprised that it doesn't work with Spin v2.6.0, but I am surprised that it seemed to have worked in Spin v2.5.1. I tried to reproduce the error with Spin v2.6.0 and v2.5.1, and I received the error message using both versions.
I believe the route cause is that you're missing a runtime-config-file
that specifies where these databases live.
You can see a link in the error message to the docs that describe this:
Check the spelling, or pass a runtime configuration file that defines these stores.
See https://developer.fermyon.com/spin/dynamic-configuration#sqlite-storage-runtime-configuration
You'll need to define your databases like so in a runtime-config.toml
file:
[sqlite_database.vehicle]
type = "spin"
path = "path/to/your/database.db"
[sqlite_database.update-status]
type = "spin"
path = "path/to/your/database.db"
And then you run the app with the runtime config file:
spin up --runtime-config-file runtime-config.toml
Let me know if this helps, or if you're still running into issues.
from spin.
Thank you very much, it's actually running as usual again.
But what puzzles me is that with the "runtime-config.toml", there should be a "database.db" in each target folder?
# This defines a new store named vehicle
[sqlite_database.vehicle]
type = "spin"
path = "vehicle/database.db"
# This defines a new store named update-status
[sqlite_database.update-status]
type = "spin"
path = "update_status/database.db"
When calling the command line
spin up --runtime-config-file runtime-config.toml
nothing happens at first (no db files are created).
So I called my migration scripts.
spin build --up --sqlite @migration_vehicle.sql --sqlite @migration_update_status.sql --runtime-config-file runtime-config.toml
This has the effect of creating a file “sqlite_db.db” in the “.spin” folder, in which two tables are created:
• update-status
• vehicle
I suspect that the error occurred when updating from 2.5.1 to 2.6 because I created the sqlite_db.db using the migration scripts.
- Am I using the “spin.toml” and the “runtime-config.toml” incorrectly?
- Unfortunately, the documentation does not indicate how to create a physical separation with a migration.
Best regards
from spin.
Ah yes, I see where the issue is now. Currently all migration files passed to --sqlite
are executed against the "default" database - i.e., the database that is always available under the "default" label.
You, however, would like to run migrations against other databases (which is a very reasonable thing to want to do). I've opened #2610 which would change spin up
such that the name of the migration file is used to specify which database to run the sql file against.
Once that PR lands, you would run spin up
like this:
spin build --up --sqlite @vehicle.sql --sqlite @update-status.sql --runtime-config-file runtime-config.toml
note the change to the sql files so that they match the names of the databases they're supposed to be run against
from spin.
Related Issues (20)
- Spin 2.6 release HOT 11
- Spin apps are no longer allowed to set host headers with Wasmtime 21.0.1 HOT 6
- Enable mustache-inspired string templates for `key_value_stores` and others HOT 6
- Add version control support to `spin new` or spin CLI HOT 12
- Rust and Python traces with KV store are not showing all KV spans in the same trace
- Remove HTTP trigger `base` option
- Consider deprioritizing the environment variable provider HOT 6
- Add `spin up --trigger-type` flag
- Enable pushing components with `spin registry push` HOT 3
- `spin login` keeps asking for one-time code after authorizaton HOT 6
- `spin --tree` or `spin --list` providing a tree structure of available subcommands and flags in spin cli HOT 3
- hello-python not working HOT 13
- Added flexibility to Spin allowed outbound hosts
- inconsistencies when making outbound http requests HOT 1
- Custom trigger with other WASI worlds requires trait implementation for `spin_core::Data<T>` HOT 2
- Add an S3 key/value storage provider interface HOT 3
- spin can not login docker private registry while docker login success HOT 5
- Follow OCI container image annotation standards when generating containers HOT 2
- Generate and sign SBOM through spin HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spin.