You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because turso db shell http://localhost:8080/ .dump doesn't create a dump (see libsql-shell-go issue), I tried to get it via /dump http endpoint.
curl -X GET -H "Authorization: Bearer $TURSO_AUTH_TOKEN" "${TURSO_DATABASE_URL%/}/dump" -o "$OUTPUT_FILE"
This successfully fetches a dump file, but an attempt to load it using turso db shell http://localhost:8080 < dump.sql crashes with this error: Error: SQLite error: no such table: main.map_groups
I assume the crash is happening on this statement:
CREATE TABLE IF NOT EXISTS `levels` (
`id` integer PRIMARY KEY NOT NULL,
`map_group_id` integer NOT NULL,
`name` text NOT NULL,
FOREIGN KEY (`map_group_id`) REFERENCES `map_groups`(`id`) ON UPDATE no action ON DELETE cascade
);
levels table references map_groups table which appears to be created some time later. Moving map_groupsCREATE TABLE above levels fixes the crash.
PRAGMA foreign_keys = OFF; is the first line in the dump. Import into regular sqlite proceeds without errors.
Running turso inside a docker container.
Because
turso db shell http://localhost:8080/ .dump
doesn't create a dump (see libsql-shell-go issue), I tried to get it via/dump
http endpoint.curl -X GET -H "Authorization: Bearer $TURSO_AUTH_TOKEN" "${TURSO_DATABASE_URL%/}/dump" -o "$OUTPUT_FILE"
This successfully fetches a dump file, but an attempt to load it using
turso db shell http://localhost:8080 < dump.sql
crashes with this error:Error: SQLite error: no such table: main.map_groups
I assume the crash is happening on this statement:
levels
table referencesmap_groups
table which appears to be created some time later. Movingmap_groups
CREATE TABLE
abovelevels
fixes the crash.PRAGMA foreign_keys = OFF;
is the first line in the dump. Import into regular sqlite proceeds without errors.Versions
turso-cli v0.98.1
ghcr.io/tursodatabase/libsql-server:28294c9 (latest atm)
The text was updated successfully, but these errors were encountered: