tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

`turso db destroy` removes primaries from settings.json but not replicas #103

Closed CodingDoug closed 1 year ago

CodingDoug commented 1 year ago

settings.json is still cluttered with nameless dangling replicas after a destroy. All relevant replicas should be removed after a destroy.

CodingDoug commented 1 year ago
$ turso db create test
...

$ turso db replicate test nrt
...

$ cat settings.json
...
  "databases": {
    "634157d8-a6f5-11ed-b2ff-262ac14f8fb0": {
      "host": "test-codingdoug.turso.io",
      "name": "test",
      "password": "51c6Lko897SmA2x4",
      "username": "CodingDoug"
    },
    "6af5184a-a6f5-11ed-b2ff-262ac14f8fb0": {
      "name": "",
      "host": "test-codingdoug.turso.io",
      "hostname": null,
      "username": "CodingDoug",
      "Password": "51c6Lko897SmA2x4"
    }
  },
...

$ turso db destroy test -y
...

$ cat settings.json
...
  "databases": {
    "6af5184a-a6f5-11ed-b2ff-262ac14f8fb0": {
      "host": "test-codingdoug.turso.io",
      "name": "",
      "password": "51c6Lko897SmA2x4",
      "username": "CodingDoug"
    }
  },
...
haaawk commented 1 year ago

After switching to v2 model we shouldn't save replicas info in the settings file any more.