2024-09-16 13:02:08 -04:00
|
|
|
import fs from 'fs'
|
|
|
|
|
import path from 'node:path'
|
|
|
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
|
|
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
|
|
|
const dirname = path.dirname(filename)
|
|
|
|
|
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
type DbAdapter = {
|
|
|
|
|
/** Connection-string env var checked before the default URL. */
|
|
|
|
|
envVar?: string
|
|
|
|
|
/** TCP host. Presence (with `port`) ⇒ assertDbReachable probes the adapter. */
|
|
|
|
|
host?: string
|
|
|
|
|
/** Display label for error messages. */
|
|
|
|
|
label?: string
|
|
|
|
|
/** TCP port. Presence (with `host`) ⇒ assertDbReachable probes the adapter. */
|
|
|
|
|
port?: number
|
|
|
|
|
/** docker-compose service profile for `pnpm docker:start <profile>`. */
|
|
|
|
|
profile?: 'mongodb' | 'mongodb-atlas' | 'postgres'
|
|
|
|
|
/** Adapter source written into databaseAdapter.js by codegen. */
|
|
|
|
|
source: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MONGO = {
|
|
|
|
|
envVar: 'MONGODB_URL',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 27018,
|
|
|
|
|
label: 'MongoDB',
|
|
|
|
|
profile: 'mongodb',
|
|
|
|
|
} as const
|
|
|
|
|
const MONGO_ATLAS = {
|
|
|
|
|
envVar: 'MONGODB_ATLAS_URL',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 27019,
|
|
|
|
|
label: 'MongoDB Atlas Local',
|
|
|
|
|
profile: 'mongodb-atlas',
|
|
|
|
|
} as const
|
|
|
|
|
const POSTGRES = {
|
|
|
|
|
envVar: 'POSTGRES_URL',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 5433,
|
|
|
|
|
label: 'PostgreSQL',
|
|
|
|
|
profile: 'postgres',
|
|
|
|
|
} as const
|
|
|
|
|
const POSTGRES_REPLICA = {
|
|
|
|
|
envVar: 'POSTGRES_REPLICA_URL',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 5434,
|
|
|
|
|
} as const
|
|
|
|
|
|
|
|
|
|
const mongoUrlBlock = (e: { envVar: string; host: string; port: number }) => `
|
2024-11-12 14:42:25 -05:00
|
|
|
ensureIndexes: true,
|
2024-08-19 17:31:36 -04:00
|
|
|
url:
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
process.env.${e.envVar} || process.env.DATABASE_URL ||
|
|
|
|
|
'mongodb://payload:payload@${e.host}:${e.port}/payload?authSource=admin&directConnection=true&replicaSet=rs0',
|
2025-10-06 16:48:02 -04:00
|
|
|
`
|
|
|
|
|
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
const postgresConnString = (e: { envVar: string; host: string; port: number }) =>
|
|
|
|
|
`process.env.${e.envVar} || process.env.DATABASE_URL || 'postgres://payload:payload@${e.host}:${e.port}/payload'`
|
2026-01-07 14:25:15 -08:00
|
|
|
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
/** Used by codegen below and by assertDbReachable.ts (presence of `port` ⇒ probe). */
|
|
|
|
|
export const dbAdapters = {
|
|
|
|
|
mongodb: {
|
|
|
|
|
...MONGO,
|
|
|
|
|
source: `
|
2025-10-06 16:48:02 -04:00
|
|
|
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = mongooseAdapter({
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
${mongoUrlBlock(MONGO)}
|
2025-10-06 16:48:02 -04:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
// mongodb-atlas uses Docker-based MongoDB Atlas Local (all-in-one with search)
|
chore: consolidate docker scripts into single docker-compose with profiles (#15974)
Replaces 18 docker scripts and 4 separate docker-compose files with 3
scripts and 1 unified compose file using Docker Compose profiles.
```
pnpm docker:start # Nuke volumes + start all services fresh
pnpm docker:stop # Stop everything
pnpm docker:test # Test database connections
```
The goal is one single command that covers 99% of cases: `pnpm
docker:start`. Running it gives you all services started clean, with no
leftover data from previous runs. No more looking through `package.json`
for the right `docker:mongodb:start` or `docker:postgres:restart:clean`
- just one command.
Docker Compose starts all services in parallel, so there's no
performance overhead compared to the old targeted commands.
<img width="1284" height="922" alt="screenshot 2026-03-16 at 17 11
44@2x"
src="https://github.com/user-attachments/assets/56c35547-5b82-496e-9200-cb43982c0dad"
/>
All services (PostgreSQL, MongoDB, mongot, MongoDB Atlas Local,
LocalStack, Azure Storage, GCS) now show grouped under a single
`payload-monorepo` project in Docker Desktop / Orbstack, as seen in the
screenshot.
All services are defined in `test/docker-compose.yml` with profiles
(`postgres`, `mongodb`, `mongodb-atlas`, `storage`, `all`). CI uses
individual profiles to start only what it needs.
2026-03-17 07:27:56 -07:00
|
|
|
// Start with: pnpm docker:start (or --profile mongodb-atlas for just this service)
|
2025-12-19 12:00:08 -08:00
|
|
|
// Runs on port 27019 to avoid conflicts with mongodb
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
'mongodb-atlas': {
|
|
|
|
|
...MONGO_ATLAS,
|
|
|
|
|
source: `
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = mongooseAdapter({
|
|
|
|
|
ensureIndexes: true,
|
|
|
|
|
url:
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
process.env.${MONGO_ATLAS.envVar} || process.env.DATABASE_URL ||
|
|
|
|
|
'mongodb://${MONGO_ATLAS.host}:${MONGO_ATLAS.port}/payload?directConnection=true&replicaSet=mongodb-atlas-local',
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
cosmosdb: {
|
|
|
|
|
...MONGO,
|
|
|
|
|
source: `
|
2025-10-06 16:48:02 -04:00
|
|
|
import { mongooseAdapter, compatibilityOptions } from '@payloadcms/db-mongodb'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = mongooseAdapter({
|
|
|
|
|
...compatibilityOptions.cosmosdb,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
${mongoUrlBlock(MONGO)}
|
2025-10-06 16:48:02 -04:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
documentdb: {
|
|
|
|
|
...MONGO,
|
|
|
|
|
source: `
|
2025-10-06 16:48:02 -04:00
|
|
|
import { mongooseAdapter, compatibilityOptions } from '@payloadcms/db-mongodb'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = mongooseAdapter({
|
|
|
|
|
...compatibilityOptions.documentdb,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
${mongoUrlBlock(MONGO)}
|
2024-08-19 17:31:36 -04:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
firestore: {
|
|
|
|
|
...MONGO,
|
|
|
|
|
source: `
|
2025-08-21 00:31:19 +08:00
|
|
|
import { mongooseAdapter, compatibilityOptions } from '@payloadcms/db-mongodb'
|
fix(db-mongodb): improve compatibility with Firestore database (#12763)
### What?
Adds four more arguments to the `mongooseAdapter`:
```typescript
useJoinAggregations?: boolean /* The big one */
useAlternativeDropDatabase?: boolean
useBigIntForNumberIDs?: boolean
usePipelineInSortLookup?: boolean
```
Also export a new `compatabilityOptions` object from
`@payloadcms/db-mongodb` where each key is a mongo-compatible database
and the value is the recommended `mongooseAdapter` settings for
compatability.
### Why?
When using firestore and visiting
`/admin/collections/media/payload-folders`, we get:
```
MongoServerError: invalid field(s) in lookup: [let, pipeline], only lookup(from, localField, foreignField, as) is supported
```
Firestore doesn't support the full MongoDB aggregation API used by
Payload which gets used when building aggregations for populating join
fields.
There are several other compatability issues with Firestore:
- The invalid `pipeline` property is used in the `$lookup` aggregation
in `buildSortParams`
- Firestore only supports number IDs of type `Long`, but Mongoose
converts custom ID fields of type number to `Double`
- Firestore does not support the `dropDatabase` command
- Firestore does not support the `createIndex` command (not addressed in
this PR)
### How?
```typescript
useJoinAggregations?: boolean /* The big one */
```
When this is `false` we skip the `buildJoinAggregation()` pipeline and resolve the join fields through multiple queries. This can potentially be used with AWS DocumentDB and Azure Cosmos DB to support join fields, but I have not tested with either of these databases.
```typescript
useAlternativeDropDatabase?: boolean
```
When `true`, monkey-patch (replace) the `dropDatabase` function so that
it calls `collection.deleteMany({})` on every collection instead of
sending a single `dropDatabase` command to the database
```typescript
useBigIntForNumberIDs?: boolean
```
When `true`, use `mongoose.Schema.Types.BigInt` for custom ID fields of type `number` which converts to a firestore `Long` behind the scenes
```typescript
usePipelineInSortLookup?: boolean
```
When `false`, modify the sortAggregation pipeline in `buildSortParams()` so that we don't use the `pipeline` property in the `$lookup` aggregation. Results in slightly worse performance when sorting by relationship properties.
### Limitations
This PR does not add support for transactions or creating indexes in firestore.
### Fixes
Fixed a bug (and added a test) where you weren't able to sort by multiple properties on a relationship field.
### Future work
1. Firestore supports simple `$lookup` aggregations but other databases might not. Could add a `useSortAggregations` property which can be used to disable aggregations in sorting.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
2025-07-17 01:02:43 +05:45
|
|
|
|
|
|
|
|
export const databaseAdapter = mongooseAdapter({
|
2025-08-21 00:31:19 +08:00
|
|
|
...compatibilityOptions.firestore,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
${mongoUrlBlock(MONGO)}
|
fix(db-mongodb): improve compatibility with Firestore database (#12763)
### What?
Adds four more arguments to the `mongooseAdapter`:
```typescript
useJoinAggregations?: boolean /* The big one */
useAlternativeDropDatabase?: boolean
useBigIntForNumberIDs?: boolean
usePipelineInSortLookup?: boolean
```
Also export a new `compatabilityOptions` object from
`@payloadcms/db-mongodb` where each key is a mongo-compatible database
and the value is the recommended `mongooseAdapter` settings for
compatability.
### Why?
When using firestore and visiting
`/admin/collections/media/payload-folders`, we get:
```
MongoServerError: invalid field(s) in lookup: [let, pipeline], only lookup(from, localField, foreignField, as) is supported
```
Firestore doesn't support the full MongoDB aggregation API used by
Payload which gets used when building aggregations for populating join
fields.
There are several other compatability issues with Firestore:
- The invalid `pipeline` property is used in the `$lookup` aggregation
in `buildSortParams`
- Firestore only supports number IDs of type `Long`, but Mongoose
converts custom ID fields of type number to `Double`
- Firestore does not support the `dropDatabase` command
- Firestore does not support the `createIndex` command (not addressed in
this PR)
### How?
```typescript
useJoinAggregations?: boolean /* The big one */
```
When this is `false` we skip the `buildJoinAggregation()` pipeline and resolve the join fields through multiple queries. This can potentially be used with AWS DocumentDB and Azure Cosmos DB to support join fields, but I have not tested with either of these databases.
```typescript
useAlternativeDropDatabase?: boolean
```
When `true`, monkey-patch (replace) the `dropDatabase` function so that
it calls `collection.deleteMany({})` on every collection instead of
sending a single `dropDatabase` command to the database
```typescript
useBigIntForNumberIDs?: boolean
```
When `true`, use `mongoose.Schema.Types.BigInt` for custom ID fields of type `number` which converts to a firestore `Long` behind the scenes
```typescript
usePipelineInSortLookup?: boolean
```
When `false`, modify the sortAggregation pipeline in `buildSortParams()` so that we don't use the `pipeline` property in the `$lookup` aggregation. Results in slightly worse performance when sorting by relationship properties.
### Limitations
This PR does not add support for transactions or creating indexes in firestore.
### Fixes
Fixed a bug (and added a test) where you weren't able to sort by multiple properties on a relationship field.
### Future work
1. Firestore supports simple `$lookup` aggregations but other databases might not. Could add a `useSortAggregations` property which can be used to disable aggregations in sorting.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
2025-07-17 01:02:43 +05:45
|
|
|
// The following options prevent some tests from failing.
|
|
|
|
|
// More work needed to get tests succeeding without these options.
|
|
|
|
|
ensureIndexes: true,
|
|
|
|
|
disableIndexHints: false,
|
|
|
|
|
useAlternativeDropDatabase: false,
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
postgres: {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2024-08-19 17:31:36 -04:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2024-08-19 17:31:36 -04:00
|
|
|
},
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'postgres-custom-schema': {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2024-08-19 17:31:36 -04:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2024-08-19 17:31:36 -04:00
|
|
|
},
|
|
|
|
|
schemaName: 'custom',
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'postgres-uuid': {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2024-08-19 17:31:36 -04:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
idType: 'uuid',
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2024-08-19 17:31:36 -04:00
|
|
|
},
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'postgres-uuidv7': {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2026-04-09 15:32:01 +02:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
idType: 'uuidv7',
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2026-04-09 15:32:01 +02:00
|
|
|
},
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'postgres-read-replica': {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2025-06-09 22:09:52 +03:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2025-06-09 22:09:52 +03:00
|
|
|
},
|
2026-03-30 18:45:24 +01:00
|
|
|
readReplicas: [
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
process.env.${POSTGRES_REPLICA.envVar} || 'postgres://payload:payload@${POSTGRES_REPLICA.host}:${POSTGRES_REPLICA.port}/payload',
|
2026-03-30 18:45:24 +01:00
|
|
|
],
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'postgres-read-replicas': {
|
|
|
|
|
...POSTGRES,
|
|
|
|
|
source: `
|
2026-03-30 18:45:24 +01:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
pool: {
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
connectionString: ${postgresConnString(POSTGRES)},
|
2026-03-30 18:45:24 +01:00
|
|
|
},
|
|
|
|
|
readReplicas: [
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
process.env.${POSTGRES_REPLICA.envVar} || 'postgres://payload:payload@${POSTGRES_REPLICA.host}:${POSTGRES_REPLICA.port}/payload',
|
2026-03-30 18:45:24 +01:00
|
|
|
],
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'content-api': {
|
|
|
|
|
envVar: 'CONTENT_API_URL',
|
|
|
|
|
source: `
|
2026-01-16 20:19:25 +00:00
|
|
|
import { contentAPIAdapter } from '@payloadcms/figma'
|
|
|
|
|
export const databaseAdapter = contentAPIAdapter({
|
|
|
|
|
auth: {
|
|
|
|
|
mode: 'devJwt',
|
|
|
|
|
},
|
|
|
|
|
url: process.env.CONTENT_API_URL || 'http://localhost:8080',
|
|
|
|
|
contentSystemId: process.env.CONTENT_SYSTEM_ID || '00000000-0000-4000-8000-000000000001',
|
|
|
|
|
})
|
2025-06-09 22:09:52 +03:00
|
|
|
`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'vercel-postgres-read-replica': {
|
|
|
|
|
envVar: 'POSTGRES_URL',
|
|
|
|
|
source: `
|
2025-06-09 22:09:52 +03:00
|
|
|
import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = vercelPostgresAdapter({
|
|
|
|
|
pool: {
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
connectionString: process.env.POSTGRES_URL || process.env.DATABASE_URL,
|
2025-06-09 22:09:52 +03:00
|
|
|
},
|
|
|
|
|
readReplicas: [process.env.POSTGRES_REPLICA_URL],
|
|
|
|
|
})
|
|
|
|
|
`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
sqlite: {
|
|
|
|
|
envVar: 'SQLITE_URL',
|
|
|
|
|
source: `
|
2024-08-19 17:31:36 -04:00
|
|
|
import { sqliteAdapter } from '@payloadcms/db-sqlite'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = sqliteAdapter({
|
|
|
|
|
client: {
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
url: process.env.SQLITE_URL || process.env.DATABASE_URL || 'file:./payload.db',
|
2024-08-19 17:31:36 -04:00
|
|
|
},
|
2024-12-20 22:13:28 +02:00
|
|
|
autoIncrement: true
|
2024-08-19 17:31:36 -04:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'sqlite-uuid': {
|
|
|
|
|
envVar: 'SQLITE_URL',
|
|
|
|
|
source: `
|
2024-12-19 05:44:04 +02:00
|
|
|
import { sqliteAdapter } from '@payloadcms/db-sqlite'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = sqliteAdapter({
|
|
|
|
|
idType: 'uuid',
|
|
|
|
|
client: {
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
url: process.env.SQLITE_URL || process.env.DATABASE_URL || 'file:./payload.db',
|
2026-01-13 13:51:47 -05:00
|
|
|
}
|
2024-12-19 05:44:04 +02:00
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
'sqlite-uuidv7': {
|
|
|
|
|
envVar: 'SQLITE_URL',
|
|
|
|
|
source: `
|
2026-04-09 15:32:01 +02:00
|
|
|
import { sqliteAdapter } from '@payloadcms/db-sqlite'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = sqliteAdapter({
|
|
|
|
|
idType: 'uuidv7',
|
|
|
|
|
client: {
|
|
|
|
|
url: process.env.SQLITE_URL || process.env.DATABASE_URL || 'file:./payload.db',
|
|
|
|
|
}
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
supabase: {
|
|
|
|
|
envVar: 'POSTGRES_URL',
|
|
|
|
|
source: `
|
2024-08-19 17:31:36 -04:00
|
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = postgresAdapter({
|
|
|
|
|
pool: {
|
|
|
|
|
connectionString:
|
test: improve database test setup (#14982)
This PR brings over most of the test suite improvements I made
[here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our
payload monorepo.
- Replaces mongodb-memory-server with an actual mongo db using the
mongodb-community-server docker image. This unblocks the vitest
migration PR (https://github.com/payloadcms/payload/pull/14337).
Currently, debugging does not work in that PR - this is due to the
global setup script that has to start the mongo memory db.
- Just like postgres, all mongodb databases now support vector search.
mongodb-atlas-local supports it natively, and for
mongodb-community-server, our docker compose script installs `mongot`,
which unlocks support for vector search. This means we could add [vector
storage/search tests similar to the ones we have for
postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts)
- Int tests now run against both mongodb adapters: mongodb
(mongodb-community-server) and mongodb-atlas (mongodb-atlas-local)
- Adds docker scripts for mongodb, mongodb-atlas, and postgres,
documented in README.md. Updates default db adapter URLs to
automatically pick up databases started by those scripts. This makes it
easier for people cloning the repo to get started with consistent
databases matching CI - no complicated manual installation steps
- Simplified db setup handling locally in CI. In CI, everything is
scoped to `.github/actions/start-database/action.yml`. Locally,
everything is scoped to `test/helpers/db`. Each database adapter now
shares the same username, password and db name
- Use consistent db connection string env variables, all ending with
_URL
- Updates the CONTRIBUTING.md with up-to-date information and adds a new
database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
|
|
|
process.env.POSTGRES_URL || process.env.DATABASE_URL || 'postgresql://postgres:postgres@127.0.0.1:54322/postgres',
|
2024-08-19 17:31:36 -04:00
|
|
|
},
|
|
|
|
|
})`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
d1: {
|
|
|
|
|
// d1 uses Cloudflare workerd's `binding` rather than a connection string,
|
|
|
|
|
// so there's no env var to override.
|
|
|
|
|
source: `
|
2025-09-29 23:58:18 +03:00
|
|
|
import { sqliteD1Adapter } from '@payloadcms/db-d1-sqlite'
|
|
|
|
|
|
|
|
|
|
export const databaseAdapter = sqliteD1Adapter({ binding: global.d1 })
|
|
|
|
|
`,
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
},
|
|
|
|
|
} as const satisfies Record<string, DbAdapter>
|
|
|
|
|
|
|
|
|
|
export type DatabaseAdapterType = keyof typeof dbAdapters
|
|
|
|
|
|
|
|
|
|
export const defaultPostgresUrl = `postgres://payload:payload@${POSTGRES.host}:${POSTGRES.port}/payload`
|
2024-08-19 17:31:36 -04:00
|
|
|
|
2024-09-16 13:02:08 -04:00
|
|
|
/**
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
* Write the chosen adapter's source to test/databaseAdapter.js.
|
2024-09-16 13:02:08 -04:00
|
|
|
*/
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
export function generateDatabaseAdapter(dbAdapter: DatabaseAdapterType) {
|
|
|
|
|
const adapter = dbAdapters[dbAdapter]
|
|
|
|
|
if (!adapter) {
|
2024-09-16 13:02:08 -04:00
|
|
|
throw new Error(`Unknown database adapter: ${dbAdapter}`)
|
|
|
|
|
}
|
|
|
|
|
fs.writeFileSync(
|
|
|
|
|
path.resolve(dirname, 'databaseAdapter.js'),
|
|
|
|
|
`
|
|
|
|
|
// DO NOT MODIFY. This file is automatically generated by the test suite.
|
|
|
|
|
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
${adapter.source}
|
2024-09-16 13:02:08 -04:00
|
|
|
`,
|
|
|
|
|
)
|
|
|
|
|
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
return adapter.source
|
2024-08-19 17:31:36 -04:00
|
|
|
}
|
2026-01-13 03:52:28 +02:00
|
|
|
|
|
|
|
|
export const getCurrentDatabaseAdapter = (): DatabaseAdapterType => {
|
|
|
|
|
const dbAdapter = process.env.PAYLOAD_DATABASE as DatabaseAdapterType | undefined
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
if (dbAdapter && Object.keys(dbAdapters).includes(dbAdapter)) {
|
2026-01-13 03:52:28 +02:00
|
|
|
return dbAdapter
|
|
|
|
|
}
|
chore: monorepo devcontainer support, refactor db adapter and docker start script (#16396)
## Devcontainers
Adds dev container configuration, so contributors can open the repo in
VS Code without setting up Node, pnpm, or Docker on their own machine.
Works for both "Reopen in Container" (your local clone bind-mounted in)
and "Clone Repository in Container Volume" (a fresh clone inside an
isolated Docker volume, useful when running multiple parallel sessions
against the same repo without them stepping on each other).
`test/generateDatabaseAdapter.ts` was renamed to `test/dbAdapters.ts`
and is the source of truth for anything db-adapter-related in one place:
the source templates the codegen writes out, and the host/port/env-var
defaults per adapter, which the new `assertDbReachable.ts` function uses
to probe services.
This should enable running multiple agents conflict-free
## DB Connection probe + docker:start script improvements
`assertDbReachable` is now run within `pnpm dev`. If the db connection
fails, you now get immediate feedback through a helpful error, instead
of having to wait for Next.js to compile and then be thrown off by a
cryptic db seed error:
<img width="852" height="488" alt="screenshot 2026-04-26 at 15 26 12@2x"
src="https://github.com/user-attachments/assets/aecfee0a-20eb-4d25-9215-256f8c8f5f8a"
/>
`pnpm docker:start` is now an interactive picker. You can still pass
profile names as args (`pnpm docker:start postgres mongodb`) to skip the
prompt:
<img width="898" height="348" alt="screenshot 2026-04-26 at 15 28 04@2x"
src="https://github.com/user-attachments/assets/7d4b8f3d-89a5-46b7-b3ca-887a793246b1"
/>
These changes encourages contributors not to start every single service
we have available (uses around 4gb of ram), and only start the database
service that you're using => much less memory usage.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1214135483864575
2026-04-28 15:19:58 -07:00
|
|
|
|
|
|
|
|
// Default to mongodb, as our e2e tests currently do
|
|
|
|
|
// not pass on sqlite/postgres
|
2026-01-13 03:52:28 +02:00
|
|
|
return 'mongodb'
|
|
|
|
|
}
|