tursodatabase / libsql-shell-go

7 stars 7 forks source link

`.dump` produces broken `NULL;` statement when `UNIQUE` constraint is present #119

Closed athoscouto closed 1 year ago

athoscouto commented 1 year ago

A UNIQUE constraint is returned as an index when getTableIndexes is called. Then it is passed to dumpTableIndexes, dumpIndex and getIndex. The last function does a SQL query to fetch the index data, but the query returns null, which leads to a NULL; statement being print in the dump.