Skip to content

Commit 6daae12

Browse files
committed
Rename LAKEBASE_ENDPOINT to PGENDPOINT as it is automatically injected from apps
1 parent d9d9dd5 commit 6daae12

20 files changed

Lines changed: 46 additions & 59 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ AppKit provides `createLakebasePool()` - a factory function that returns a stand
260260
```typescript
261261
import { createLakebasePool } from '@databricks/appkit';
262262

263-
// Reads from PGHOST, PGDATABASE, LAKEBASE_ENDPOINT env vars
263+
// Reads from PGHOST, PGDATABASE, PGENDPOINT env vars
264264
const pool = createLakebasePool();
265265

266266
// Standard pg.Pool API

apps/dev-playground/.env.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ NODE_ENV='development'
66
OTEL_EXPORTER_OTLP_ENDPOINT='http://localhost:4318'
77
OTEL_RESOURCE_ATTRIBUTES='service.sample_attribute=dev'
88
OTEL_SERVICE_NAME='dev-playground'
9-
LAKEBASE_ENDPOINT='' # Run: databricks postgres list-endpoints projects/{project-id}/branches/{branch-id} — use the `name` field from the output
9+
PGENDPOINT='' # Run: databricks postgres list-endpoints projects/{project-id}/branches/{branch-id} — use the `name` field from the output
1010
PGHOST=
1111
PGUSER=
1212
PGDATABASE=databricks_postgres

apps/dev-playground/server/lakebase-examples-plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export class LakebaseExamplesPlugin extends Plugin {
3434

3535
async setup() {
3636
// Check if Lakebase is configured
37-
if (!process.env.PGHOST || !process.env.LAKEBASE_ENDPOINT) {
37+
if (!process.env.PGHOST || !process.env.PGENDPOINT) {
3838
console.warn(
39-
"Lakebase not configured (missing PGHOST or LAKEBASE_ENDPOINT), examples disabled",
39+
"Lakebase not configured (missing PGHOST or PGENDPOINT), examples disabled",
4040
);
4141
return;
4242
}
@@ -59,7 +59,7 @@ export class LakebaseExamplesPlugin extends Plugin {
5959

6060
injectRoutes(router: IAppRouter): void {
6161
// Skip route injection if Lakebase is not configured
62-
if (!process.env.PGHOST || !process.env.LAKEBASE_ENDPOINT) {
62+
if (!process.env.PGHOST || !process.env.PGENDPOINT) {
6363
return;
6464
}
6565

docs/docs/api/appkit/Enumeration.ResourceType.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ JOB: "job";
4444

4545
***
4646

47+
### POSTGRES
48+
49+
```ts
50+
POSTGRES: "postgres";
51+
```
52+
53+
***
54+
4755
### SECRET
4856

4957
```ts

docs/docs/api/appkit/Interface.LakebasePoolConfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ databricks postgres list-endpoints projects/{project-id}/branches/{branch-id}
3333
Use the `name` field from the output.
3434

3535
Required for OAuth authentication (unless password is provided)
36-
Can also be set via LAKEBASE_ENDPOINT environment variable
36+
Can also be set via PGENDPOINT environment variable
3737

3838
#### Example
3939

docs/docs/api/appkit/TypeAlias.ResourcePermission.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type ResourcePermission =
1111
| UcFunctionPermission
1212
| UcConnectionPermission
1313
| DatabasePermission
14+
| PostgresPermission
1415
| GenieSpacePermission
1516
| ExperimentPermission
1617
| AppPermission;

docs/docs/plugins/lakebase.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ The required environment variables:
7474

7575
| Variable | Description |
7676
|---|---|
77-
| `LAKEBASE_ENDPOINT` | Endpoint resource path (e.g. `projects/.../branches/.../endpoints/...`) |
77+
| `PGENDPOINT` | Endpoint resource path (e.g. `projects/.../branches/.../endpoints/...`) |
7878
| `PGHOST` | Lakebase host (auto-injected in production by the `postgres` Databricks Apps resource) |
7979
| `PGDATABASE` | Database name (auto-injected in production by the `postgres` Databricks Apps resource) |
8080
| `PGSSLMODE` | TLS mode — set to `require` (auto-injected in production by the `postgres` Databricks Apps resource) |
8181

82-
When deployed to Databricks Apps with a `postgres` database resource configured, `PGHOST`, `PGDATABASE`, `PGSSLMODE`, `PGUSER`, `PGPORT`, and `PGAPPNAME` are automatically injected by the platform. Only `LAKEBASE_ENDPOINT` must be set explicitly:
82+
When deployed to Databricks Apps with a `postgres` database resource configured, `PGHOST`, `PGDATABASE`, `PGSSLMODE`, `PGUSER`, `PGPORT`, and `PGAPPNAME` are automatically injected by the platform. Only `PGENDPOINT` must be set explicitly:
8383

8484
```yaml
8585
env:
86-
- name: LAKEBASE_ENDPOINT
86+
- name: PGENDPOINT
8787
valueFrom: postgres
8888
```
8989
@@ -92,7 +92,7 @@ For local development, set all variables in your `.env` file:
9292
```env
9393
PGHOST=your-lakebase-host.databricks.com
9494
PGDATABASE=databricks_postgres
95-
LAKEBASE_ENDPOINT=projects/<project-id>/branches/<branch-id>/endpoints/<endpoint-id>
95+
PGENDPOINT=projects/<project-id>/branches/<branch-id>/endpoints/<endpoint-id>
9696
PGSSLMODE=require
9797
```
9898

docs/static/schemas/plugin-manifest.schema.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,7 @@
197197
},
198198
"resourceRequirement": {
199199
"type": "object",
200-
"required": [
201-
"type",
202-
"alias",
203-
"resourceKey",
204-
"description",
205-
"permission",
206-
"fields"
207-
],
200+
"required": ["type", "alias", "resourceKey", "description", "permission"],
208201
"properties": {
209202
"type": {
210203
"$ref": "#/$defs/resourceType"

packages/appkit/src/plugins/lakebase/manifest.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
"alias": "Postgres",
1212
"resourceKey": "postgres",
1313
"description": "Lakebase Postgres database for persistent storage",
14-
"permission": "CAN_CONNECT_AND_CREATE",
15-
"fields": {
16-
"name": {
17-
"env": "LAKEBASE_ENDPOINT",
18-
"description": "Lakebase endpoint resource path"
19-
}
20-
}
14+
"permission": "CAN_CONNECT_AND_CREATE"
2115
}
2216
],
2317
"optional": []

packages/appkit/src/plugins/lakebase/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { LakebasePoolConfig } from "../../connectors/lakebase";
55
* Configuration for the Lakebase plugin.
66
*
77
* The minimum required setup is via environment variables — no `pool` config
8-
* is needed if `PGHOST`, `PGDATABASE`, and `LAKEBASE_ENDPOINT` are set.
8+
* is needed if `PGHOST`, `PGDATABASE`, and `PGENDPOINT` are set.
99
*
1010
* @see {@link https://github.com/databricks/appkit/blob/main/packages/lakebase/README.md} for the full configuration reference.
1111
*/

0 commit comments

Comments
 (0)