This is the primary product demo path. It connects DreamFactory to PostgreSQL, seeds a real table, registers a service, and exposes the data through the API.
For real user data, use quickstart pgsql. It registers an existing PostgreSQL
database without creating or replacing sample tables, verifies the API path,
prints MCP client config, and emits starter prompts:
./dreamfactory quickstart pgsql \
--name app_pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456For a human-readable summary instead of JSON:
./dreamfactory quickstart pgsql \
--format text \
--name app_pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456Use pgsql connect when you only want to register the service:
./dreamfactory pgsql connect \
--name app_pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456Create a database with any PostgreSQL instance you control. The quickstart CLI can seed the sample table if the database already exists and credentials are valid:
Optional local PostgreSQL container for demos:
docker run --rm --name dreamfactory-pg-demo \
-e POSTGRES_DB=app \
-e POSTGRES_USER=app \
-e POSTGRES_PASSWORD=change-me \
-p 15432:5432 \
postgres:16-alpine./dreamfactory demo pgsql \
--db-host localhost \
--db-port 15432 \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456The command creates the widgets table if needed, replaces the sample rows,
registers the demo_pgsql service, and prints API URLs.
Manual sample table SQL:
CREATE TABLE widgets (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
status TEXT NOT NULL,
quantity INTEGER NOT NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
INSERT INTO widgets (name, status, quantity) VALUES
('starter-kit', 'ready', 42),
('field-gateway', 'testing', 12),
('analytics-feed', 'ready', 7);./dreamfactory service plan pgsql > pgsql-service.jsonEdit pgsql-service.json:
{
"resource": [
{
"name": "demo_pgsql",
"label": "Demo PostgreSQL",
"type": "pgsql",
"is_active": true,
"config": {
"host": "localhost",
"port": 5432,
"database": "app",
"username": "app",
"password": "change-me"
}
}
]
}./dreamfactory service apply \
--file pgsql-service.json \
--email you@company.example \
--password YourPassword123456./dreamfactory service inspect demo_pgsql \
--email you@company.example \
--password YourPassword123456TOKEN="$(./dreamfactory login \
--email you@company.example \
--password YourPassword123456 \
--token-only)"
curl -s http://localhost:8080/api/v2/demo_pgsql/_table/widgets \
-H "X-DreamFactory-Session-Token: $TOKEN"./dreamfactory ai quickstart-pgsql \
--name app_pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456
./dreamfactory ai pgsql-connect \
--name app_pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456
./dreamfactory ai plan-service pgsql > pgsql-service.json
./dreamfactory ai demo-pgsql \
--db-host localhost \
--db-name app \
--db-user app \
--db-password change-me \
--email you@company.example \
--password YourPassword123456
./dreamfactory ai apply-service --file pgsql-service.json \
--email you@company.example \
--password YourPassword123456
./dreamfactory ai inspect-service demo_pgsql \
--email you@company.example \
--password YourPassword123456Start an MCP-enabled archive with:
./dreamfactory serve --with-mcp \
--admin-email you@company.example \
--admin-password YourPassword123456Print client config:
TOKEN="$(./dreamfactory login \
--email you@company.example \
--password YourPassword123456 \
--token-only)"
./dreamfactory mcp config --session-token "$TOKEN"
./dreamfactory mcp config --client cursor --session-token "$TOKEN"The MCP daemon exposes tools such as demo_pgsql_get_tables,
demo_pgsql_get_table_schema, and demo_pgsql_get_table_data. Plain-language
questions are interpreted by the LLM client, which then calls those tools.