Hi,
I'm trying to understand the migration documentation, however, it is more than confusing.
The GIF at the top only shows errors. Commands are typed in, but each is followed by an error, nothing is shown. So basically this GIF is useless.
How can I configure a configuration? The documentation never shows, with an example, how to call sqlspec with the --config parameter. I have this directory layout (uv project):
with config.py like:
from sqlspec.adapters.sqlite import SqliteConfig
config = SqliteConfig(
connection_config={"database": str("test.db")},
migration_config={
"script_location": "migrations",
"version_table": "_schema_versions"
}
)
config.migrate_up()
Running uv run sqlspec init shows (same output from the GIF):
Error: No SQLSpec config found.
Specify config using one of:
1. CLI flag: sqlspec --config myapp.config:get_configs <command>
2. Environment var: export SQLSPEC_CONFIG=myapp.config:get_configs
3. pyproject.toml:
config = "myapp.config:get_configs"
Running it with uv run sqlspec --config config init yields a bunch of error messages and
AttributeError: module 'config' has no attribute 'bind_key'
Running it with uv run sqlspec --config config:config init yields:
Error loading config: Failed to import config from path 'config:config': Could not import 'config:config': config:config doesn't look like a module
path
So how do I event start with migrations?
Hi,
I'm trying to understand the migration documentation, however, it is more than confusing.
The GIF at the top only shows errors. Commands are typed in, but each is followed by an error, nothing is shown. So basically this GIF is useless.
How can I configure a configuration? The documentation never shows, with an example, how to call sqlspec with the
--configparameter. I have this directory layout (uv project):with
config.pylike:Running
uv run sqlspec initshows (same output from the GIF):Running it with
uv run sqlspec --config config inityields a bunch of error messages andRunning it with
uv run sqlspec --config config:config inityields:So how do I event start with migrations?