> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tablepro.app/llms.txt
> Use this file to discover all available pages before exploring further.

# PGlite

> Connect to a PGlite database over its socket server using the PostgreSQL wire protocol

[PGlite](https://pglite.dev) is PostgreSQL 17 compiled to WebAssembly, and it runs inside a JavaScript process instead of listening on a socket of its own. Nothing can reach it until you start `@electric-sql/pglite-socket` yourself. After that the connection is ordinary [PostgreSQL](https://docs.tablepro.app/databases/postgresql.md), served by the same driver, with the same introspection, DDL, and EXPLAIN, and nothing extra to install.

![PGlite connection form](https://mintcdn.com/ngquct/XBbi5YSjUNYqPgdp/images/pglite-connection-form.png?fit=max\&auto=format\&n=XBbi5YSjUNYqPgdp\&q=85\&s=7246282e007542e29f90b5fb17315bc8)

The PGlite connection form pointed at a running socket server

## Start the socket server

It listens on `127.0.0.1:5432` unless `--port` says otherwise. Leave it running for as long as the connection is open.

```bash theme={null}
# In-memory database, gone when the server stops
npx @electric-sql/pglite-socket

# Persist to a data directory
npx @electric-sql/pglite-socket --db=./my-pgdata
```

## Connection settings

| Field | Default | Notes |
| - | - | - |
| **Host** | `127.0.0.1` | The socket server binds loopback IPv4, not `localhost` |
| **Port** | `5432` | Match the server's `--port` |
| **Database** | `postgres` | The single database PGlite exposes |
| **Username** | `postgres` | Trust auth; any username connects |

The socket server never checks a password, so the form has no password field, and it has no TLS, so SSL Mode is fixed to Disabled. Fill in the form and click **Save & Connect**.

## Connection URL

```text theme={null}
pglite://postgres@127.0.0.1:5432/postgres
```

See [Connection URL Reference](https://docs.tablepro.app/connections/urls.md) for all parameters.

## What you get

Real PostgreSQL 17, so `pg_catalog` and `information_schema` are complete: table and view definitions, indexes, foreign keys, structure editing, and the visual `EXPLAIN` and `EXPLAIN ANALYZE` plan tree all behave as they do on a server. The default schema is `public`, and `postgres` is the only entry in the `Cmd+K` database list.

## Limitations

* One connection at a time. A second client, or a second TablePro window on the same server, is refused: close the other one first.
* No cross-database tabs. A tab bound to a database the connection is not on refuses to run and names that database instead of guessing.
* Cancel has no effect. `Cmd+.` returns without stopping anything and the query runs to completion, so keep exploratory queries small.
* No TLS. SSL Mode is fixed to Disabled, and the editor has no **SSH & Proxies** or **SSL/TLS** pane.

## Troubleshooting

**Can't reach a PGlite socket server**: nothing is listening at that address. Start it with `npx @electric-sql/pglite-socket`, and check the host is `127.0.0.1` rather than `localhost`, which can resolve to IPv6 first.

**Too many connections**: something else is already talking to the socket server. Close that client and connect again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.