Skip to content
Merged

#943 #944

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/docs/pglite-socket.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ For better performance in local development, you can use Unix sockets instead of

```bash
# Start server on a Unix socket
pglite-server --path=/tmp/pglite.sock --run "npm run dev" --include-database-url
pglite-server --path=/tmp/.s.PGSQL.5432 --run "npm run dev" --include-database-url

# The DATABASE_URL will be: postgresql://postgres:postgres@/postgres?host=/tmp
```
Expand All @@ -229,10 +229,10 @@ Once the server is running, you can connect to it using any PostgreSQL client:

```bash
# TCP connection
PGSSLMODE=disable psql -h localhost -p 5432 -d template1
PGSSLMODE=disable psql -h localhost -p 5432 -d postgres

# Unix socket connection (if using --path)
PGSSLMODE=disable psql -h /tmp -d template1
PGSSLMODE=disable psql -h /tmp -d postgres
```

#### Using Node.js clients
Expand All @@ -243,7 +243,7 @@ import pg from 'pg'
const client = new pg.Client({
host: 'localhost',
port: 5432,
database: 'template1',
database: 'postgres',
})
await client.connect()

Expand All @@ -252,7 +252,7 @@ import postgres from 'postgres'
const sql = postgres({
host: 'localhost',
port: 5432,
database: 'template1',
database: 'postgres',
})

// Using environment variable (when using --include-database-url)
Expand Down
8 changes: 4 additions & 4 deletions packages/pglite-socket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ For better performance in local development, you can use Unix sockets instead of

```bash
# Start server on a Unix socket
pglite-server --path=/tmp/pglite.sock --run "npm run dev" --include-database-url
pglite-server --path=/tmp/.s.PGSQL.5432 --run "npm run dev" --include-database-url

# The DATABASE_URL will be: postgresql://postgres:postgres@/postgres?host=/tmp
```
Expand All @@ -223,7 +223,7 @@ Once the server is running, you can connect to it using any PostgreSQL client:
#### Using psql

```bash
PGSSLMODE=disable psql -h localhost -p 5432 -d template1
PGSSLMODE=disable psql -h localhost -p 5432 -d postgres
```

#### Using Node.js clients
Expand All @@ -234,7 +234,7 @@ import pg from 'pg'
const client = new pg.Client({
host: 'localhost',
port: 5432,
database: 'template1'
database: 'postgres'
})
await client.connect()

Expand All @@ -243,7 +243,7 @@ import postgres from 'postgres'
const sql = postgres({
host: 'localhost',
port: 5432,
database: 'template1'
database: 'postgres'
})

// Using environment variable (when using --include-database-url)
Expand Down
Loading