# dokploy_libsql (Data Source)

Looks up a Dokploy libsql service (a distributed SQLite / `sqld` database) already registered in Dokploy, by id or by name within an environment.

~> Dokploy does not enforce name uniqueness within an environment. If more than one libsql service shares a name this data source fails rather than picking one; look the record up by `id` in that case.

## Example Usage

```terraform
data "dokploy_libsql" "example" {
  id = "your-libsql-id"
}

# By name, within an environment.
data "dokploy_libsql" "by_name" {
  environment_id = data.dokploy_environment.production.id
  name           = "db"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `environment_id` (String) Id of the environment to search when looking up by `name`. Required together with `name`.
- `id` (String) LibSQL service id. Set this to look it up by id, or leave it unset and set `name` and `environment_id`.
- `name` (String) Display name of the libsql service. Exactly one of `id` or `name` must be set. `environment_id` is required together with `name`.

### Read-Only

- `app_name` (String) Dokploy-internal app name. Always server-generated.
- `command` (String) Container command override, if any.
- `cpu_limit` (String) Hard CPU limit, Docker-style (e.g. `"0.5"`).
- `cpu_reservation` (String) Reserved CPU, Docker-style (e.g. `"0.25"`).
- `created_at` (String) Creation timestamp (server-side).
- `database_password` (String, Sensitive) LibSQL database password.
- `database_user` (String) LibSQL database user.
- `description` (String) Free-form description.
- `docker_image` (String) LibSQL docker image.
- `enable_namespaces` (Boolean) Whether sqld namespaces (multi-database mode) are enabled.
- `env` (String) Extra environment variables in Dokploy's native multiline `KEY=value` format.
- `external_admin_port` (Number) Host port the libsql admin interface is exposed on, if any.
- `external_grpc_port` (Number) Host port the libsql gRPC replication interface is exposed on, if any.
- `external_port` (Number) Host port the libsql HTTP interface is exposed on, if any.
- `memory_limit` (String) Hard memory limit, Docker-style (e.g. `"512m"`).
- `memory_reservation` (String) Reserved memory, Docker-style (e.g. `"256m"`).
- `replicas` (Number) Number of container replicas.
- `server_id` (String) Remote server the service runs on, if not the Dokploy host.
- `sqld_node` (String) Topology role: `primary` or `replica`.
- `sqld_primary_url` (String) URL of the primary sqld node. Set only when `sqld_node` is `replica`.
- `status` (String) Service status reported by Dokploy.