@databricks/appkit 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/registry/types.ts"],"mappings":";;;;;;;;UA0DiB,kBAAA;EA+BD;EA7Bd,GAAA;EAWM;EATN,WAAA;AAAA;;;;;UAOe,mBAAA;EAoBQ;EAlBvB,IAAA,EAAM,YAAA;EAqBE;EAlBR,KAAA;EAyBe;EAtBf,WAAA;;EAGA,WAAA;EAkCmC;EA/BnC,UAAA,EAAY,kBAAA;EAgByB;;;;EAVrC,MAAA,EAAQ,MAAA,SAAe,kBAAA;EAevB;EAZA,QAAA;AAAA;;;;;UAOe,aAAA,SAAsB,mBAAA;EAqBtB;EAnBf,MAAA;;EAGA,QAAA;EAkBA;EAfA,MAAA,GAAS,MAAA;EAkBA;;;;;EAXT,iBAAA,GAAoB,MAAA,SAAe,kBAAA;AAAA;;;;UAMpB,gBAAA;EAyBc;EAvB7B,KAAA;EAyBM;EAtBN,OAAA,EAAS,aAAA;EAmCG;EAhCZ,GAAA,EAAK,aAAA;AAAA;;;;;;;KAWK,YAAA,GAAe,WAAA;;;;;UAMV,cAAA;EAkBH;EAhBZ,IAAA,EAAM,KAAA;EAuBN;EApBA,WAAA;EAqBU;EAlBV,WAAA;EA6BA;;;EAxBA,SAAA;IA4BA,kEA1BE,QAAA,EAAU,IAAA,CAAK,mBAAA,iBA0BV;IAvBL,QAAA,EAAU,IAAA,CAAK,mBAAA;EAAA;;;;;EAOjB,MAAA;IACE,MAAA,EAAQ,YAAA;EAAA;;;;EAMV,MAAA;;;;EAKA,MAAA;EACA,OAAA;EACA,UAAA;EACA,QAAA;EACA,OAAA;AAAA"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/registry/types.ts"],"mappings":";;;;;;;;UA0DiB,kBAAA;EAqBA;EAnBf,GAAA;;EAEA,WAAA;EA+BY;EA7BZ,YAAA;EAmCQ;EAjCR,QAAA;EAiCc;EA/Bd,SAAA;EAaM;EAXN,KAAA;EAiBA;EAfA,OAAA;AAAA;;;;;UAOe,mBAAA;EAuBP;EArBR,IAAA,EAAM,YAAA;EA4BS;EAzBf,KAAA;;EAGA,WAAA;EAqCmC;EAlCnC,WAAA;EAmBqC;EAhBrC,UAAA,EAAY,kBAAA;EAgB4C;;;;EAVxD,MAAA,EAAQ,MAAA,SAAe,kBAAA;EAkBd;EAfT,QAAA;AAAA;;;;AA4BF;UArBiB,aAAA,SAAsB,mBAAA;;EAErC,MAAA;EAqBA;EAlBA,QAAA;EAqBS;EAlBT,MAAA,GAAS,MAAA;EAqBJ;;;AAWP;;EAzBE,iBAAA,GAAoB,MAAA,SAAe,kBAAA;AAAA;;AA+BrC;;UAzBiB,gBAAA;EA2BT;EAzBN,KAAA;EAsCY;EAnCZ,OAAA,EAAS,aAAA;EAsCG;EAnCZ,GAAA,EAAK,aAAA;AAAA;;;;;;;KAWK,YAAA,GAAe,WAAA;;;;;UAMV,cAAA;EAyBf;EAvBA,IAAA,EAAM,KAAA;EAwBI;EArBV,WAAA;EAgCA;EA7BA,WAAA;EA+BA;;;EA1BA,SAAA;IA4BO,kEA1BL,QAAA,EAAU,IAAA,CAAK,mBAAA;IAGf,QAAA,EAAU,IAAA,CAAK,mBAAA;EAAA;;;;;EAOjB,MAAA;IACE,MAAA,EAAQ,YAAA;EAAA;;;;EAMV,MAAA;;;;EAKA,MAAA;EACA,OAAA;EACA,UAAA;EACA,QAAA;EACA,OAAA;AAAA"}
@@ -10,6 +10,7 @@ declare enum ResourceType {
10
10
  UC_FUNCTION = "uc_function",
11
11
  UC_CONNECTION = "uc_connection",
12
12
  DATABASE = "database",
13
+ POSTGRES = "postgres",
13
14
  GENIE_SPACE = "genie_space",
14
15
  EXPERIMENT = "experiment",
15
16
  APP = "app"
@@ -32,6 +33,8 @@ type UcFunctionPermission = "EXECUTE";
32
33
  type UcConnectionPermission = "USE_CONNECTION";
33
34
  /** Permissions for DATABASE resources */
34
35
  type DatabasePermission = "CAN_CONNECT_AND_CREATE";
36
+ /** Permissions for POSTGRES resources */
37
+ type PostgresPermission = "CAN_CONNECT_AND_CREATE";
35
38
  /** Permissions for GENIE_SPACE resources */
36
39
  type GenieSpacePermission = "CAN_VIEW" | "CAN_RUN" | "CAN_EDIT" | "CAN_MANAGE";
37
40
  /** Permissions for EXPERIMENT resources */
@@ -39,7 +42,7 @@ type ExperimentPermission = "CAN_READ" | "CAN_EDIT" | "CAN_MANAGE";
39
42
  /** Permissions for APP resources */
40
43
  type AppPermission = "CAN_USE";
41
44
  /** Union of all possible permission levels across all resource types. */
42
- type ResourcePermission = SecretPermission | JobPermission | SqlWarehousePermission | ServingEndpointPermission | VolumePermission | VectorSearchIndexPermission | UcFunctionPermission | UcConnectionPermission | DatabasePermission | GenieSpacePermission | ExperimentPermission | AppPermission;
45
+ type ResourcePermission = SecretPermission | JobPermission | SqlWarehousePermission | ServingEndpointPermission | VolumePermission | VectorSearchIndexPermission | UcFunctionPermission | UcConnectionPermission | DatabasePermission | PostgresPermission | GenieSpacePermission | ExperimentPermission | AppPermission;
43
46
  //#endregion
44
47
  export { AppPermission, DatabasePermission, ExperimentPermission, GenieSpacePermission, JobPermission, ResourcePermission, ResourceType, SecretPermission, ServingEndpointPermission, SqlWarehousePermission, UcConnectionPermission, UcFunctionPermission, VectorSearchIndexPermission, VolumePermission };
45
48
  //# sourceMappingURL=types.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.generated.d.ts","names":[],"sources":["../../src/registry/types.generated.ts"],"mappings":";;aAIY,YAAA;EACV,MAAA;EACA,GAAA;EACA,aAAA;EACA,gBAAA;EACA,MAAA;EACA,mBAAA;EACA,WAAA;EACA,aAAA;EACA,QAAA;EACA,WAAA;EACA,UAAA;EACA,GAAA;AAAA;;KAOU,gBAAA;;KAGA,aAAA;AAHZ;AAAA,KAMY,sBAAA;;KAGA,yBAAA;;KAGA,gBAAA;;KAGA,2BAAA;;KAGA,oBAAA;AAZZ;AAAA,KAeY,sBAAA;;KAGA,kBAAA;;KAGA,oBAAA;;KAGA,oBAAA;;KAGA,aAAA;AArBZ;AAAA,KAwBY,kBAAA,GACR,gBAAA,GACA,aAAA,GACA,sBAAA,GACA,yBAAA,GACA,gBAAA,GACA,2BAAA,GACA,oBAAA,GACA,sBAAA,GACA,kBAAA,GACA,oBAAA,GACA,oBAAA,GACA,aAAA"}
1
+ {"version":3,"file":"types.generated.d.ts","names":[],"sources":["../../src/registry/types.generated.ts"],"mappings":";;aAIY,YAAA;EACV,MAAA;EACA,GAAA;EACA,aAAA;EACA,gBAAA;EACA,MAAA;EACA,mBAAA;EACA,WAAA;EACA,aAAA;EACA,QAAA;EACA,QAAA;EACA,WAAA;EACA,UAAA;EACA,GAAA;AAAA;;KAOU,gBAAA;;KAGA,aAAA;AAHZ;AAAA,KAMY,sBAAA;;KAGA,yBAAA;;KAGA,gBAAA;;KAGA,2BAAA;;KAGA,oBAAA;AAZZ;AAAA,KAeY,sBAAA;;KAGA,kBAAA;;KAGA,kBAAA;;KAGA,oBAAA;;KAGA,oBAAA;AArBZ;AAAA,KAwBY,aAAA;;KAGA,kBAAA,GACR,gBAAA,GACA,aAAA,GACA,sBAAA,GACA,yBAAA,GACA,gBAAA,GACA,2BAAA,GACA,oBAAA,GACA,sBAAA,GACA,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,oBAAA,GACA,aAAA"}
@@ -10,6 +10,7 @@ let ResourceType = /* @__PURE__ */ function(ResourceType) {
10
10
  ResourceType["UC_FUNCTION"] = "uc_function";
11
11
  ResourceType["UC_CONNECTION"] = "uc_connection";
12
12
  ResourceType["DATABASE"] = "database";
13
+ ResourceType["POSTGRES"] = "postgres";
13
14
  ResourceType["GENIE_SPACE"] = "genie_space";
14
15
  ResourceType["EXPERIMENT"] = "experiment";
15
16
  ResourceType["APP"] = "app";
@@ -38,6 +39,7 @@ const PERMISSION_HIERARCHY_BY_TYPE = {
38
39
  [ResourceType.UC_FUNCTION]: ["EXECUTE"],
39
40
  [ResourceType.UC_CONNECTION]: ["USE_CONNECTION"],
40
41
  [ResourceType.DATABASE]: ["CAN_CONNECT_AND_CREATE"],
42
+ [ResourceType.POSTGRES]: ["CAN_CONNECT_AND_CREATE"],
41
43
  [ResourceType.GENIE_SPACE]: [
42
44
  "CAN_VIEW",
43
45
  "CAN_RUN",
@@ -1 +1 @@
1
- {"version":3,"file":"types.generated.js","names":[],"sources":["../../src/registry/types.generated.ts"],"sourcesContent":["// AUTO-GENERATED from packages/shared/src/schemas/plugin-manifest.schema.json\n// Do not edit. Run: pnpm exec tsx tools/generate-registry-types.ts\n\n/** Resource types from schema $defs.resourceType.enum */\nexport enum ResourceType {\n SECRET = \"secret\",\n JOB = \"job\",\n SQL_WAREHOUSE = \"sql_warehouse\",\n SERVING_ENDPOINT = \"serving_endpoint\",\n VOLUME = \"volume\",\n VECTOR_SEARCH_INDEX = \"vector_search_index\",\n UC_FUNCTION = \"uc_function\",\n UC_CONNECTION = \"uc_connection\",\n DATABASE = \"database\",\n GENIE_SPACE = \"genie_space\",\n EXPERIMENT = \"experiment\",\n APP = \"app\",\n}\n\n// ============================================================================\n// Permissions per resource type (from schema permission $defs)\n// ============================================================================\n/** Permissions for SECRET resources */\nexport type SecretPermission = \"READ\" | \"WRITE\" | \"MANAGE\";\n\n/** Permissions for JOB resources */\nexport type JobPermission = \"CAN_VIEW\" | \"CAN_MANAGE_RUN\" | \"CAN_MANAGE\";\n\n/** Permissions for SQL_WAREHOUSE resources */\nexport type SqlWarehousePermission = \"CAN_USE\" | \"CAN_MANAGE\";\n\n/** Permissions for SERVING_ENDPOINT resources */\nexport type ServingEndpointPermission = \"CAN_VIEW\" | \"CAN_QUERY\" | \"CAN_MANAGE\";\n\n/** Permissions for VOLUME resources */\nexport type VolumePermission = \"READ_VOLUME\" | \"WRITE_VOLUME\";\n\n/** Permissions for VECTOR_SEARCH_INDEX resources */\nexport type VectorSearchIndexPermission = \"SELECT\";\n\n/** Permissions for UC_FUNCTION resources */\nexport type UcFunctionPermission = \"EXECUTE\";\n\n/** Permissions for UC_CONNECTION resources */\nexport type UcConnectionPermission = \"USE_CONNECTION\";\n\n/** Permissions for DATABASE resources */\nexport type DatabasePermission = \"CAN_CONNECT_AND_CREATE\";\n\n/** Permissions for GENIE_SPACE resources */\nexport type GenieSpacePermission = \"CAN_VIEW\" | \"CAN_RUN\" | \"CAN_EDIT\" | \"CAN_MANAGE\";\n\n/** Permissions for EXPERIMENT resources */\nexport type ExperimentPermission = \"CAN_READ\" | \"CAN_EDIT\" | \"CAN_MANAGE\";\n\n/** Permissions for APP resources */\nexport type AppPermission = \"CAN_USE\";\n\n/** Union of all possible permission levels across all resource types. */\nexport type ResourcePermission =\n | SecretPermission\n | JobPermission\n | SqlWarehousePermission\n | ServingEndpointPermission\n | VolumePermission\n | VectorSearchIndexPermission\n | UcFunctionPermission\n | UcConnectionPermission\n | DatabasePermission\n | GenieSpacePermission\n | ExperimentPermission\n | AppPermission;\n\n/** Permission hierarchy per resource type (weakest to strongest). Schema enum order. */\nexport const PERMISSION_HIERARCHY_BY_TYPE: Record<ResourceType, readonly ResourcePermission[]> = {\n [ResourceType.SECRET]: [\"READ\", \"WRITE\", \"MANAGE\"],\n [ResourceType.JOB]: [\"CAN_VIEW\", \"CAN_MANAGE_RUN\", \"CAN_MANAGE\"],\n [ResourceType.SQL_WAREHOUSE]: [\"CAN_USE\", \"CAN_MANAGE\"],\n [ResourceType.SERVING_ENDPOINT]: [\"CAN_VIEW\", \"CAN_QUERY\", \"CAN_MANAGE\"],\n [ResourceType.VOLUME]: [\"READ_VOLUME\", \"WRITE_VOLUME\"],\n [ResourceType.VECTOR_SEARCH_INDEX]: [\"SELECT\"],\n [ResourceType.UC_FUNCTION]: [\"EXECUTE\"],\n [ResourceType.UC_CONNECTION]: [\"USE_CONNECTION\"],\n [ResourceType.DATABASE]: [\"CAN_CONNECT_AND_CREATE\"],\n [ResourceType.GENIE_SPACE]: [\"CAN_VIEW\", \"CAN_RUN\", \"CAN_EDIT\", \"CAN_MANAGE\"],\n [ResourceType.EXPERIMENT]: [\"CAN_READ\", \"CAN_EDIT\", \"CAN_MANAGE\"],\n [ResourceType.APP]: [\"CAN_USE\"],\n} as const;\n\n/** Set of valid permissions per type (for validation). */\nexport const PERMISSIONS_BY_TYPE: Record<ResourceType, readonly ResourcePermission[]> = PERMISSION_HIERARCHY_BY_TYPE;\n"],"mappings":";;AAIA,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AA0DF,MAAa,+BAAoF;EAC9F,aAAa,SAAS;EAAC;EAAQ;EAAS;EAAS;EACjD,aAAa,MAAM;EAAC;EAAY;EAAkB;EAAa;EAC/D,aAAa,gBAAgB,CAAC,WAAW,aAAa;EACtD,aAAa,mBAAmB;EAAC;EAAY;EAAa;EAAa;EACvE,aAAa,SAAS,CAAC,eAAe,eAAe;EACrD,aAAa,sBAAsB,CAAC,SAAS;EAC7C,aAAa,cAAc,CAAC,UAAU;EACtC,aAAa,gBAAgB,CAAC,iBAAiB;EAC/C,aAAa,WAAW,CAAC,yBAAyB;EAClD,aAAa,cAAc;EAAC;EAAY;EAAW;EAAY;EAAa;EAC5E,aAAa,aAAa;EAAC;EAAY;EAAY;EAAa;EAChE,aAAa,MAAM,CAAC,UAAU;CAChC;;AAGD,MAAa,sBAA2E"}
1
+ {"version":3,"file":"types.generated.js","names":[],"sources":["../../src/registry/types.generated.ts"],"sourcesContent":["// AUTO-GENERATED from packages/shared/src/schemas/plugin-manifest.schema.json\n// Do not edit. Run: pnpm exec tsx tools/generate-registry-types.ts\n\n/** Resource types from schema $defs.resourceType.enum */\nexport enum ResourceType {\n SECRET = \"secret\",\n JOB = \"job\",\n SQL_WAREHOUSE = \"sql_warehouse\",\n SERVING_ENDPOINT = \"serving_endpoint\",\n VOLUME = \"volume\",\n VECTOR_SEARCH_INDEX = \"vector_search_index\",\n UC_FUNCTION = \"uc_function\",\n UC_CONNECTION = \"uc_connection\",\n DATABASE = \"database\",\n POSTGRES = \"postgres\",\n GENIE_SPACE = \"genie_space\",\n EXPERIMENT = \"experiment\",\n APP = \"app\",\n}\n\n// ============================================================================\n// Permissions per resource type (from schema permission $defs)\n// ============================================================================\n/** Permissions for SECRET resources */\nexport type SecretPermission = \"READ\" | \"WRITE\" | \"MANAGE\";\n\n/** Permissions for JOB resources */\nexport type JobPermission = \"CAN_VIEW\" | \"CAN_MANAGE_RUN\" | \"CAN_MANAGE\";\n\n/** Permissions for SQL_WAREHOUSE resources */\nexport type SqlWarehousePermission = \"CAN_USE\" | \"CAN_MANAGE\";\n\n/** Permissions for SERVING_ENDPOINT resources */\nexport type ServingEndpointPermission = \"CAN_VIEW\" | \"CAN_QUERY\" | \"CAN_MANAGE\";\n\n/** Permissions for VOLUME resources */\nexport type VolumePermission = \"READ_VOLUME\" | \"WRITE_VOLUME\";\n\n/** Permissions for VECTOR_SEARCH_INDEX resources */\nexport type VectorSearchIndexPermission = \"SELECT\";\n\n/** Permissions for UC_FUNCTION resources */\nexport type UcFunctionPermission = \"EXECUTE\";\n\n/** Permissions for UC_CONNECTION resources */\nexport type UcConnectionPermission = \"USE_CONNECTION\";\n\n/** Permissions for DATABASE resources */\nexport type DatabasePermission = \"CAN_CONNECT_AND_CREATE\";\n\n/** Permissions for POSTGRES resources */\nexport type PostgresPermission = \"CAN_CONNECT_AND_CREATE\";\n\n/** Permissions for GENIE_SPACE resources */\nexport type GenieSpacePermission = \"CAN_VIEW\" | \"CAN_RUN\" | \"CAN_EDIT\" | \"CAN_MANAGE\";\n\n/** Permissions for EXPERIMENT resources */\nexport type ExperimentPermission = \"CAN_READ\" | \"CAN_EDIT\" | \"CAN_MANAGE\";\n\n/** Permissions for APP resources */\nexport type AppPermission = \"CAN_USE\";\n\n/** Union of all possible permission levels across all resource types. */\nexport type ResourcePermission =\n | SecretPermission\n | JobPermission\n | SqlWarehousePermission\n | ServingEndpointPermission\n | VolumePermission\n | VectorSearchIndexPermission\n | UcFunctionPermission\n | UcConnectionPermission\n | DatabasePermission\n | PostgresPermission\n | GenieSpacePermission\n | ExperimentPermission\n | AppPermission;\n\n/** Permission hierarchy per resource type (weakest to strongest). Schema enum order. */\nexport const PERMISSION_HIERARCHY_BY_TYPE: Record<ResourceType, readonly ResourcePermission[]> = {\n [ResourceType.SECRET]: [\"READ\", \"WRITE\", \"MANAGE\"],\n [ResourceType.JOB]: [\"CAN_VIEW\", \"CAN_MANAGE_RUN\", \"CAN_MANAGE\"],\n [ResourceType.SQL_WAREHOUSE]: [\"CAN_USE\", \"CAN_MANAGE\"],\n [ResourceType.SERVING_ENDPOINT]: [\"CAN_VIEW\", \"CAN_QUERY\", \"CAN_MANAGE\"],\n [ResourceType.VOLUME]: [\"READ_VOLUME\", \"WRITE_VOLUME\"],\n [ResourceType.VECTOR_SEARCH_INDEX]: [\"SELECT\"],\n [ResourceType.UC_FUNCTION]: [\"EXECUTE\"],\n [ResourceType.UC_CONNECTION]: [\"USE_CONNECTION\"],\n [ResourceType.DATABASE]: [\"CAN_CONNECT_AND_CREATE\"],\n [ResourceType.POSTGRES]: [\"CAN_CONNECT_AND_CREATE\"],\n [ResourceType.GENIE_SPACE]: [\"CAN_VIEW\", \"CAN_RUN\", \"CAN_EDIT\", \"CAN_MANAGE\"],\n [ResourceType.EXPERIMENT]: [\"CAN_READ\", \"CAN_EDIT\", \"CAN_MANAGE\"],\n [ResourceType.APP]: [\"CAN_USE\"],\n} as const;\n\n/** Set of valid permissions per type (for validation). */\nexport const PERMISSIONS_BY_TYPE: Record<ResourceType, readonly ResourcePermission[]> = PERMISSION_HIERARCHY_BY_TYPE;\n"],"mappings":";;AAIA,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AA8DF,MAAa,+BAAoF;EAC9F,aAAa,SAAS;EAAC;EAAQ;EAAS;EAAS;EACjD,aAAa,MAAM;EAAC;EAAY;EAAkB;EAAa;EAC/D,aAAa,gBAAgB,CAAC,WAAW,aAAa;EACtD,aAAa,mBAAmB;EAAC;EAAY;EAAa;EAAa;EACvE,aAAa,SAAS,CAAC,eAAe,eAAe;EACrD,aAAa,sBAAsB,CAAC,SAAS;EAC7C,aAAa,cAAc,CAAC,UAAU;EACtC,aAAa,gBAAgB,CAAC,iBAAiB;EAC/C,aAAa,WAAW,CAAC,yBAAyB;EAClD,aAAa,WAAW,CAAC,yBAAyB;EAClD,aAAa,cAAc;EAAC;EAAY;EAAW;EAAY;EAAa;EAC5E,aAAa,aAAa;EAAC;EAAY;EAAY;EAAa;EAChE,aAAa,MAAM,CAAC,UAAU;CAChC;;AAGD,MAAa,sBAA2E"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/registry/types.ts"],"sourcesContent":["/**\n * Resource Registry Type System\n *\n * This module defines the type system for the AppKit Resource Registry,\n * which enables plugins to declare their Databricks resource requirements\n * in a machine-readable format.\n *\n * Resource types and permissions are generated from plugin-manifest.schema.json\n * (see types.generated.ts). Hand-written interfaces below define the registry API.\n */\n\n// Re-export generated registry types (enum + const must be value exports for runtime)\nimport {\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n type ResourcePermission,\n ResourceType,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n} from \"./types.generated\";\n\nexport {\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n ResourceType,\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n type ResourcePermission,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n};\n\n// ============================================================================\n// Hand-written interfaces (not in JSON schema)\n// ============================================================================\n\n/**\n * Defines a single field for a resource. Each field has its own environment variable and optional description.\n * Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key).\n */\nexport interface ResourceFieldEntry {\n /** Environment variable name for this field */\n env: string;\n /** Human-readable description for this field */\n description?: string;\n}\n\n/**\n * Declares a resource requirement for a plugin.\n * Can be defined statically in a manifest or dynamically via getResourceRequirements().\n */\nexport interface ResourceRequirement {\n /** Type of Databricks resource required */\n type: ResourceType;\n\n /** Unique alias for this resource within the plugin (e.g., 'warehouse', 'secrets'). Used for UI/display. */\n alias: string;\n\n /** Stable key for machine use (env naming, composite keys, app.yaml). Required. */\n resourceKey: string;\n\n /** Human-readable description of why this resource is needed */\n description: string;\n\n /** Required permission level for the resource */\n permission: ResourcePermission;\n\n /**\n * Map of field name to env and optional description.\n * Single-value types use one key (e.g. id); multi-value (database, secret) use multiple keys.\n */\n fields: Record<string, ResourceFieldEntry>;\n\n /** Whether this resource is required (true) or optional (false) */\n required: boolean;\n}\n\n/**\n * Internal representation of a resource in the registry.\n * Extends ResourceRequirement with resolution state and plugin ownership.\n */\nexport interface ResourceEntry extends ResourceRequirement {\n /** Plugin(s) that require this resource (comma-separated if multiple) */\n plugin: string;\n\n /** Whether the resource has been resolved (all field env vars set) */\n resolved: boolean;\n\n /** Resolved value per field name. Populated by validate() when all field env vars are set. */\n values?: Record<string, string>;\n\n /**\n * Per-plugin permission tracking.\n * Maps plugin name to the permission it originally requested.\n * Populated when multiple plugins share the same resource.\n */\n permissionSources?: Record<string, ResourcePermission>;\n}\n\n/**\n * Result of validating all registered resources against the environment.\n */\nexport interface ValidationResult {\n /** Whether all required resources are available */\n valid: boolean;\n\n /** List of missing required resources */\n missing: ResourceEntry[];\n\n /** Complete list of all registered resources (required and optional) */\n all: ResourceEntry[];\n}\n\nimport type { JSONSchema7 } from \"json-schema\";\n\n/**\n * Configuration schema definition for plugin config.\n * Re-exported from the standard JSON Schema Draft 7 types.\n *\n * @see {@link https://json-schema.org/draft-07/json-schema-release-notes | JSON Schema Draft 7}\n */\nexport type ConfigSchema = JSONSchema7;\n\n/**\n * Plugin manifest that declares metadata and resource requirements.\n * Attached to plugin classes as a static property.\n */\nexport interface PluginManifest<TName extends string = string> {\n /** Plugin identifier — the single source of truth for the plugin's name */\n name: TName;\n\n /** Human-readable display name for UI/CLI */\n displayName: string;\n\n /** Brief description of what the plugin does */\n description: string;\n\n /**\n * Resource requirements declaration\n */\n resources: {\n /** Resources that must be available for the plugin to function */\n required: Omit<ResourceRequirement, \"required\">[];\n\n /** Resources that enhance functionality but are not mandatory */\n optional: Omit<ResourceRequirement, \"required\">[];\n };\n\n /**\n * Configuration schema for the plugin.\n * Defines the shape and validation rules for plugin config.\n */\n config?: {\n schema: ConfigSchema;\n };\n\n /**\n * When true, excluded from the template plugins manifest during sync.\n */\n hidden?: boolean;\n\n /**\n * Optional metadata for community plugins\n */\n author?: string;\n version?: string;\n repository?: string;\n keywords?: string[];\n license?: string;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/registry/types.ts"],"sourcesContent":["/**\n * Resource Registry Type System\n *\n * This module defines the type system for the AppKit Resource Registry,\n * which enables plugins to declare their Databricks resource requirements\n * in a machine-readable format.\n *\n * Resource types and permissions are generated from plugin-manifest.schema.json\n * (see types.generated.ts). Hand-written interfaces below define the registry API.\n */\n\n// Re-export generated registry types (enum + const must be value exports for runtime)\nimport {\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n type ResourcePermission,\n ResourceType,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n} from \"./types.generated\";\n\nexport {\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n ResourceType,\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n type ResourcePermission,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n};\n\n// ============================================================================\n// Hand-written interfaces (not in JSON schema)\n// ============================================================================\n\n/**\n * Defines a single field for a resource. Each field has its own environment variable and optional description.\n * Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key).\n */\nexport interface ResourceFieldEntry {\n /** Environment variable name for this field */\n env?: string;\n /** Human-readable description for this field */\n description?: string;\n /** When true, this field is excluded from Databricks bundle configuration (databricks.yml) generation. */\n bundleIgnore?: boolean;\n /** Example values showing the expected format for this field */\n examples?: string[];\n /** When true, this field is only generated for local .env files. The Databricks Apps platform auto-injects it at deploy time. */\n localOnly?: boolean;\n /** Static value for this field. Used when no prompted or resolved value exists. */\n value?: string;\n /** Named resolver prefixed by resource type (e.g., 'postgres:host'). The CLI resolves this value during the init prompt flow. */\n resolve?: string;\n}\n\n/**\n * Declares a resource requirement for a plugin.\n * Can be defined statically in a manifest or dynamically via getResourceRequirements().\n */\nexport interface ResourceRequirement {\n /** Type of Databricks resource required */\n type: ResourceType;\n\n /** Unique alias for this resource within the plugin (e.g., 'warehouse', 'secrets'). Used for UI/display. */\n alias: string;\n\n /** Stable key for machine use (env naming, composite keys, app.yaml). Required. */\n resourceKey: string;\n\n /** Human-readable description of why this resource is needed */\n description: string;\n\n /** Required permission level for the resource */\n permission: ResourcePermission;\n\n /**\n * Map of field name to env and optional description.\n * Single-value types use one key (e.g. id); multi-value (database, secret) use multiple keys.\n */\n fields: Record<string, ResourceFieldEntry>;\n\n /** Whether this resource is required (true) or optional (false) */\n required: boolean;\n}\n\n/**\n * Internal representation of a resource in the registry.\n * Extends ResourceRequirement with resolution state and plugin ownership.\n */\nexport interface ResourceEntry extends ResourceRequirement {\n /** Plugin(s) that require this resource (comma-separated if multiple) */\n plugin: string;\n\n /** Whether the resource has been resolved (all field env vars set) */\n resolved: boolean;\n\n /** Resolved value per field name. Populated by validate() when all field env vars are set. */\n values?: Record<string, string>;\n\n /**\n * Per-plugin permission tracking.\n * Maps plugin name to the permission it originally requested.\n * Populated when multiple plugins share the same resource.\n */\n permissionSources?: Record<string, ResourcePermission>;\n}\n\n/**\n * Result of validating all registered resources against the environment.\n */\nexport interface ValidationResult {\n /** Whether all required resources are available */\n valid: boolean;\n\n /** List of missing required resources */\n missing: ResourceEntry[];\n\n /** Complete list of all registered resources (required and optional) */\n all: ResourceEntry[];\n}\n\nimport type { JSONSchema7 } from \"json-schema\";\n\n/**\n * Configuration schema definition for plugin config.\n * Re-exported from the standard JSON Schema Draft 7 types.\n *\n * @see {@link https://json-schema.org/draft-07/json-schema-release-notes | JSON Schema Draft 7}\n */\nexport type ConfigSchema = JSONSchema7;\n\n/**\n * Plugin manifest that declares metadata and resource requirements.\n * Attached to plugin classes as a static property.\n */\nexport interface PluginManifest<TName extends string = string> {\n /** Plugin identifier — the single source of truth for the plugin's name */\n name: TName;\n\n /** Human-readable display name for UI/CLI */\n displayName: string;\n\n /** Brief description of what the plugin does */\n description: string;\n\n /**\n * Resource requirements declaration\n */\n resources: {\n /** Resources that must be available for the plugin to function */\n required: Omit<ResourceRequirement, \"required\">[];\n\n /** Resources that enhance functionality but are not mandatory */\n optional: Omit<ResourceRequirement, \"required\">[];\n };\n\n /**\n * Configuration schema for the plugin.\n * Defines the shape and validation rules for plugin config.\n */\n config?: {\n schema: ConfigSchema;\n };\n\n /**\n * When true, excluded from the template plugins manifest during sync.\n */\n hidden?: boolean;\n\n /**\n * Optional metadata for community plugins\n */\n author?: string;\n version?: string;\n repository?: string;\n keywords?: string[];\n license?: string;\n}\n"],"mappings":""}
@@ -111,6 +111,7 @@
111
111
  "uc_function",
112
112
  "uc_connection",
113
113
  "database",
114
+ "postgres",
114
115
  "genie_space",
115
116
  "experiment",
116
117
  "app"
@@ -162,6 +163,11 @@
162
163
  "enum": ["CAN_CONNECT_AND_CREATE"],
163
164
  "description": "Permission for database resources"
164
165
  },
166
+ "postgresPermission": {
167
+ "type": "string",
168
+ "enum": ["CAN_CONNECT_AND_CREATE"],
169
+ "description": "Permission for Postgres resources"
170
+ },
165
171
  "genieSpacePermission": {
166
172
  "type": "string",
167
173
  "enum": ["CAN_VIEW", "CAN_RUN", "CAN_EDIT", "CAN_MANAGE"],
@@ -179,7 +185,6 @@
179
185
  },
180
186
  "resourceFieldEntry": {
181
187
  "type": "object",
182
- "required": ["env"],
183
188
  "properties": {
184
189
  "env": {
185
190
  "type": "string",
@@ -190,20 +195,37 @@
190
195
  "description": {
191
196
  "type": "string",
192
197
  "description": "Human-readable description for this field"
198
+ },
199
+ "bundleIgnore": {
200
+ "type": "boolean",
201
+ "default": false,
202
+ "description": "When true, this field is excluded from Databricks bundle configuration (databricks.yml) generation."
203
+ },
204
+ "examples": {
205
+ "type": "array",
206
+ "items": { "type": "string" },
207
+ "description": "Example values showing the expected format for this field"
208
+ },
209
+ "localOnly": {
210
+ "type": "boolean",
211
+ "default": false,
212
+ "description": "When true, this field is only generated for local .env files. The Databricks Apps platform auto-injects it at deploy time."
213
+ },
214
+ "value": {
215
+ "type": "string",
216
+ "description": "Static value for this field. Used when no prompted or resolved value exists."
217
+ },
218
+ "resolve": {
219
+ "type": "string",
220
+ "pattern": "^[a-z_]+:[a-zA-Z]+$",
221
+ "description": "Named resolver prefixed by resource type (e.g., 'postgres:host'). The CLI resolves this value during the init prompt flow."
193
222
  }
194
223
  },
195
224
  "additionalProperties": false
196
225
  },
197
226
  "resourceRequirement": {
198
227
  "type": "object",
199
- "required": [
200
- "type",
201
- "alias",
202
- "resourceKey",
203
- "description",
204
- "permission",
205
- "fields"
206
- ],
228
+ "required": ["type", "alias", "resourceKey", "description", "permission"],
207
229
  "properties": {
208
230
  "type": {
209
231
  "$ref": "#/$defs/resourceType"
@@ -337,6 +359,17 @@
337
359
  }
338
360
  }
339
361
  },
362
+ {
363
+ "if": {
364
+ "properties": { "type": { "const": "postgres" } },
365
+ "required": ["type"]
366
+ },
367
+ "then": {
368
+ "properties": {
369
+ "permission": { "$ref": "#/$defs/postgresPermission" }
370
+ }
371
+ }
372
+ },
340
373
  {
341
374
  "if": {
342
375
  "properties": { "type": { "const": "genie_space" } },
@@ -74,9 +74,19 @@ interface PluginManifest<TName extends string = string> {
74
74
  */
75
75
  interface ResourceFieldEntry {
76
76
  /** Environment variable name for this field */
77
- env: string;
77
+ env?: string;
78
78
  /** Human-readable description for this field */
79
79
  description?: string;
80
+ /** When true, this field is excluded from Databricks bundle configuration (databricks.yml) generation. */
81
+ bundleIgnore?: boolean;
82
+ /** Example values showing the expected format for this field */
83
+ examples?: string[];
84
+ /** When true, this field is only generated for local .env files. The Databricks Apps platform auto-injects it at deploy time. */
85
+ localOnly?: boolean;
86
+ /** Static value for this field. Used when no prompted or resolved value exists. */
87
+ value?: string;
88
+ /** Named resolver prefixed by resource type (e.g., 'postgres:host'). The CLI resolves this value during the init prompt flow. */
89
+ resolve?: string;
80
90
  }
81
91
  /**
82
92
  * Resource requirement declaration (imported from registry types).
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../../shared/src/plugin.ts"],"mappings":";;;;;UAIiB,UAAA;EACf,IAAA;EAEA,qBAAA;EAEA,KAAA,IAAS,OAAA;EAET,YAAA,CAAa,MAAA,EAAQ,OAAA,CAAQ,MAAA;EAE7B,YAAA,IAAgB,iBAAA;EAEhB,uBAAA,KAA4B,WAAA;EAE5B,OAAA;AAAA;;UAIe,gBAAA;EACf,IAAA;EACA,IAAA;EAAA,CAEC,GAAA;EAMD,SAAA,GAAY,gBAAA;AAAA;AAAA,KAGF,gBAAA;EAGN,MAAA;EACA,OAAA;EACA,IAAA;AAAA;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A;EACR,IAAA;EACA,OAAA,GAAU,GAAA,EAAK,WAAA,EAAa,GAAA,EAAK,YAAA,KAAiB,OAAA,QApCb;EAsCrC,eAAA;AAAA;;KAIU,iBAAA,GAAoB,MAAA"}
@@ -49,6 +49,15 @@ JOB: "job";
49
49
 
50
50
  ***
51
51
 
52
+ ### POSTGRES[​](#postgres "Direct link to POSTGRES")
53
+
54
+ ```ts
55
+ POSTGRES: "postgres";
56
+
57
+ ```
58
+
59
+ ***
60
+
52
61
  ### SECRET[​](#secret "Direct link to SECRET")
53
62
 
54
63
  ```ts
@@ -4,6 +4,17 @@ Defines a single field for a resource. Each field has its own environment variab
4
4
 
5
5
  ## Properties[​](#properties "Direct link to Properties")
6
6
 
7
+ ### bundleIgnore?[​](#bundleignore "Direct link to bundleIgnore?")
8
+
9
+ ```ts
10
+ optional bundleIgnore: boolean;
11
+
12
+ ```
13
+
14
+ When true, this field is excluded from Databricks bundle configuration (databricks.yml) generation.
15
+
16
+ ***
17
+
7
18
  ### description?[​](#description "Direct link to description?")
8
19
 
9
20
  ```ts
@@ -15,11 +26,55 @@ Human-readable description for this field
15
26
 
16
27
  ***
17
28
 
18
- ### env[​](#env "Direct link to env")
29
+ ### env?[​](#env "Direct link to env?")
19
30
 
20
31
  ```ts
21
- env: string;
32
+ optional env: string;
22
33
 
23
34
  ```
24
35
 
25
36
  Environment variable name for this field
37
+
38
+ ***
39
+
40
+ ### examples?[​](#examples "Direct link to examples?")
41
+
42
+ ```ts
43
+ optional examples: string[];
44
+
45
+ ```
46
+
47
+ Example values showing the expected format for this field
48
+
49
+ ***
50
+
51
+ ### localOnly?[​](#localonly "Direct link to localOnly?")
52
+
53
+ ```ts
54
+ optional localOnly: boolean;
55
+
56
+ ```
57
+
58
+ When true, this field is only generated for local .env files. The Databricks Apps platform auto-injects it at deploy time.
59
+
60
+ ***
61
+
62
+ ### resolve?[​](#resolve "Direct link to resolve?")
63
+
64
+ ```ts
65
+ optional resolve: string;
66
+
67
+ ```
68
+
69
+ Named resolver prefixed by resource type (e.g., 'postgres<!-- -->:host<!-- -->'). The CLI resolves this value during the init prompt flow.
70
+
71
+ ***
72
+
73
+ ### value?[​](#value "Direct link to value?")
74
+
75
+ ```ts
76
+ optional value: string;
77
+
78
+ ```
79
+
80
+ Static value for this field. Used when no prompted or resolved value exists.
@@ -11,6 +11,7 @@ type ResourcePermission =
11
11
  | UcFunctionPermission
12
12
  | UcConnectionPermission
13
13
  | DatabasePermission
14
+ | PostgresPermission
14
15
  | GenieSpacePermission
15
16
  | ExperimentPermission
16
17
  | AppPermission;
@@ -1,9 +1,5 @@
1
1
  # Lakebase plugin
2
2
 
3
- info
4
-
5
- Currently, the Lakebase plugin currently requires a one-time manual setup to connect your Databricks App with your Lakebase database. An automated setup process is planned for an upcoming future release.
6
-
7
3
  Provides a PostgreSQL connection pool for Databricks Lakebase Autoscaling with automatic OAuth token refresh.
8
4
 
9
5
  **Key features:**
@@ -12,90 +8,24 @@ Provides a PostgreSQL connection pool for Databricks Lakebase Autoscaling with a
12
8
  * Automatic OAuth token refresh (1-hour tokens, 2-minute refresh buffer)
13
9
  * Token caching to minimize API calls
14
10
  * Built-in OpenTelemetry instrumentation (query duration, pool connections, token refresh)
11
+ * AppKit logger configured by default for query and connection events
15
12
 
16
- ## Setting up Lakebase[​](#setting-up-lakebase "Direct link to Setting up Lakebase")
17
-
18
- Before using the plugin, you need to connect your Databricks App's service principal to your Lakebase database.
19
-
20
- ### 1. Find your app's service principal[​](#1-find-your-apps-service-principal "Direct link to 1. Find your app's service principal")
21
-
22
- Create a Databricks App from the UI (`Compute > Apps > Create App > Create a custom app`). Navigate to the **Environment** tab and note the `DATABRICKS_CLIENT_ID` value — this is the service principal that will connect to your Lakebase database.
23
-
24
- ![App environment tab](/appkit/assets/images/step-1-073320f925a3961838afa0842c727307.png)
25
-
26
- ### 2. Find your Project ID and Branch ID[​](#2-find-your-project-id-and-branch-id "Direct link to 2. Find your Project ID and Branch ID")
13
+ ## Getting started with the Lakebase[​](#getting-started-with-the-lakebase "Direct link to Getting started with the Lakebase")
27
14
 
28
- Create a new Lakebase Postgres Autoscaling project. Navigate to your Lakebase project's branch details and switch to the **Compute** tab. Note the **Project ID** and **Branch ID** from the URL.
15
+ The easiest way to get started with the Lakebase plugin is to use the Databricks CLI to create a new Databricks app with AppKit installed and the Lakebase plugin.
29
16
 
30
- ![Branch details](/appkit/assets/images/step-2-25954a56aecd4dafe4966f7cecc6e8f4.png)
17
+ ### Prerequisites[](#prerequisites "Direct link to Prerequisites")
31
18
 
32
- ### 3. Find your endpoint[​](#3-find-your-endpoint "Direct link to 3. Find your endpoint")
19
+ * [Node.js](https://nodejs.org) v22+ environment with `npm`
20
+ * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
21
+ * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
33
22
 
34
- Use the Databricks CLI to list endpoints for the branch. Note the `name` field from the output — this is your `LAKEBASE_ENDPOINT` value.
23
+ ### Steps[​](#steps "Direct link to Steps")
35
24
 
36
- ```bash
37
- databricks postgres list-endpoints projects/{project-id}/branches/{branch-id}
38
-
39
- ```
40
-
41
- Example output:
42
-
43
- ```json
44
- [
45
- {
46
- "create_time": "2026-02-19T12:13:02Z",
47
- "name": "projects/{project-id}/branches/{branch-id}/endpoints/primary"
48
- }
49
- ]
50
-
51
- ```
52
-
53
- ### 4. Get connection parameters[​](#4-get-connection-parameters "Direct link to 4. Get connection parameters")
54
-
55
- Click the **Connect** button on your Lakebase branch and copy the `PGHOST` and `PGDATABASE` values for later.
56
-
57
- ![Connect dialog](/appkit/assets/images/step-4-78b906d125c2c130f6e14984a9f89a62.png)
58
-
59
- ### 5. Grant access to the service principal[​](#5-grant-access-to-the-service-principal "Direct link to 5. Grant access to the service principal")
60
-
61
- Navigate to the **SQL Editor** tab on your Lakebase branch. Run the following SQL against the `databricks_postgres` database, replacing the service principal ID in the `DECLARE` block with the `DATABRICKS_CLIENT_ID` value from step 1:
62
-
63
- ```sql
64
- CREATE EXTENSION IF NOT EXISTS databricks_auth;
65
-
66
- DO $$
67
- DECLARE
68
- sp TEXT := 'your-service-principal-id'; -- Replace with DATABRICKS_CLIENT_ID from Step 1
69
- BEGIN
70
- -- Create service principal role
71
- PERFORM databricks_create_role(sp, 'SERVICE_PRINCIPAL');
72
-
73
- -- Connection and schema access
74
- EXECUTE format('GRANT CONNECT ON DATABASE "databricks_postgres" TO %I', sp);
75
- EXECUTE format('GRANT ALL ON SCHEMA public TO %I', sp);
76
-
77
- -- Privileges on existing objects
78
- EXECUTE format('GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO %I', sp);
79
- EXECUTE format('GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO %I', sp);
80
- EXECUTE format('GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO %I', sp);
81
- EXECUTE format('GRANT ALL PRIVILEGES ON ALL PROCEDURES IN SCHEMA public TO %I', sp);
82
-
83
- -- Default privileges on future objects you create
84
- EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO %I', sp);
85
- EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO %I', sp);
86
- EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO %I', sp);
87
- EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON ROUTINES TO %I', sp);
88
- END $$;
89
-
90
- ```
91
-
92
- ![SQL Editor](/appkit/assets/images/step-5-38bdf3e3ac8aadf2c0cd57aa5f0ba090.png)
93
-
94
- ### 6. Verify the role[​](#6-verify-the-role "Direct link to 6. Verify the role")
95
-
96
- Navigate to the **Roles & Databases** tab and confirm the role is visible. You may need to fully refresh the page.
97
-
98
- ![Roles \&amp; Databases tab](/appkit/assets/images/step-6-edbb462e89a66c46d58424768c163e4e.png)
25
+ 1. Firstly, create a new Lakebase Postgres Autoscaling project according to the [Get started documentation](https://docs.databricks.com/aws/en/oltp/projects/get-started).
26
+ 2. To add the Lakebase plugin to your project, run the `databricks apps init` command and interactively select the **Lakebase** plugin. The CLI will guide you through picking a Lakebase project, branch, and database.
27
+ <!-- -->
28
+ * When asked, select **Yes** to deploy the app to Databricks Apps right after its creation.
99
29
 
100
30
  ## Basic usage[​](#basic-usage "Direct link to Basic usage")
101
31
 
@@ -108,34 +38,6 @@ await createApp({
108
38
 
109
39
  ```
110
40
 
111
- ## Environment variables[​](#environment-variables "Direct link to Environment variables")
112
-
113
- The required environment variables:
114
-
115
- | Variable | Description |
116
- | ------------------- | ----------------------------------------------------------------------- |
117
- | `PGHOST` | Lakebase host |
118
- | `PGDATABASE` | Database name |
119
- | `LAKEBASE_ENDPOINT` | Endpoint resource path (e.g. `projects/.../branches/.../endpoints/...`) |
120
- | `PGSSLMODE` | TLS mode — set to `require` |
121
-
122
- Ensure that those environment variables are set both for local development (`.env` file) and for deployment (`app.yaml` file):
123
-
124
- ```yaml
125
- env:
126
- - name: LAKEBASE_ENDPOINT
127
- value: projects/{project-id}/branches/{branch-id}/endpoints/primary
128
- - name: PGHOST
129
- value: {your-lakebase-host}
130
- - name: PGDATABASE
131
- value: databricks_postgres
132
- - name: PGSSLMODE
133
- value: require
134
-
135
- ```
136
-
137
- For the full configuration reference (SSL, pool size, timeouts, logging, ORM examples), see the [`@databricks/lakebase` README](https://github.com/databricks/appkit/blob/main/packages/lakebase/README.md).
138
-
139
41
  ## Accessing the pool[​](#accessing-the-pool "Direct link to Accessing the pool")
140
42
 
141
43
  After initialization, access Lakebase through the `AppKit.lakebase` object:
@@ -145,9 +47,17 @@ const AppKit = await createApp({
145
47
  plugins: [server(), lakebase()],
146
48
  });
147
49
 
148
- // Direct query (parameterized)
50
+ await AppKit.lakebase.query(`CREATE SCHEMA IF NOT EXISTS app`);
51
+
52
+ await AppKit.lakebase.query(`CREATE TABLE IF NOT EXISTS app.orders (
53
+ id SERIAL PRIMARY KEY,
54
+ user_id VARCHAR(255) NOT NULL,
55
+ amount DECIMAL(10, 2) NOT NULL,
56
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
57
+ )`);
58
+
149
59
  const result = await AppKit.lakebase.query(
150
- "SELECT * FROM orders WHERE user_id = $1",
60
+ "SELECT * FROM app.orders WHERE user_id = $1",
151
61
  [userId],
152
62
  );
153
63
 
@@ -160,7 +70,33 @@ const pgConfig = AppKit.lakebase.getPgConfig(); // pg.PoolConfig
160
70
 
161
71
  ```
162
72
 
163
- ## Configuration options[​](#configuration-options "Direct link to Configuration options")
73
+ ## Configuration[​](#configuration "Direct link to Configuration")
74
+
75
+ ### Environment variables[​](#environment-variables "Direct link to Environment variables")
76
+
77
+ The required environment variables are:
78
+
79
+ | Variable | Description |
80
+ | ------------------- | ---------------------------------------------------------------------------------------------------- |
81
+ | `LAKEBASE_ENDPOINT` | Endpoint resource path (e.g. `projects/.../branches/.../endpoints/...`) |
82
+ | `PGHOST` | Lakebase host (auto-injected in production by the `postgres` Databricks Apps resource) |
83
+ | `PGDATABASE` | Database name (auto-injected in production by the `postgres` Databricks Apps resource) |
84
+ | `PGSSLMODE` | TLS mode - set to `require` (auto-injected in production by the `postgres` Databricks Apps resource) |
85
+
86
+ 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:
87
+
88
+ ```yaml
89
+ env:
90
+ - name: LAKEBASE_ENDPOINT
91
+ valueFrom: postgres
92
+
93
+ ```
94
+
95
+ For local development, the `.env` file is automatically generated by `databricks apps init` with the correct values for your Lakebase project.
96
+
97
+ For the full configuration reference (SSL, pool size, timeouts, logging, ORM examples), see the [`@databricks/lakebase` README](https://github.com/databricks/appkit/blob/main/packages/lakebase/README.md).
98
+
99
+ ### Pool configuration[​](#pool-configuration "Direct link to Pool configuration")
164
100
 
165
101
  Pass a `pool` object to override any defaults:
166
102
 
@@ -178,3 +114,74 @@ await createApp({
178
114
  });
179
115
 
180
116
  ```
117
+
118
+ ## Database Permissions[​](#database-permissions "Direct link to Database Permissions")
119
+
120
+ When you create the app with the Lakebase resource using the [Getting started](#getting-started-with-the-lakebase) guide, the Service Principal is automatically granted `CONNECT_AND_CREATE` permission on the `postgres` resource. This lets the Service Principal connect to the database and create new objects, but **not access any existing schemas or tables.**
121
+
122
+ ### Local development[​](#local-development "Direct link to Local development")
123
+
124
+ To develop locally against a deployed Lakebase database:
125
+
126
+ 1. **Deploy the app first.** The Service Principal creates the database schema and tables on first deploy. Apps generated from `databricks apps init` handle this automatically - they check if tables exist on startup and skip creation if they do.
127
+
128
+ 2. **Grant `databricks_superuser` via the Lakebase UI:**
129
+
130
+ 1. Open the Lakebase Autoscaling UI and navigate to your project's **Branch Overview** page.
131
+ 2. Click **Add role** (or **Edit role** if your OAuth role already exists).
132
+ 3. Select your Databricks identity as the principal and check the **`databricks_superuser`** system role.
133
+
134
+ 3. **Run locally** - your Databricks user identity (email) is used for OAuth authentication. The `databricks_superuser` role gives full **DML access** (read/write data) but **not DDL** (creating schemas or tables) - that's why deploying first matters (see note below).
135
+
136
+ For other users, use the same **Add role** flow in the Lakebase UI to create an OAuth role with `databricks_superuser` for each user.
137
+
138
+ tip
139
+
140
+ [Postgres password authentication](https://docs.databricks.com/aws/en/oltp/projects/authentication#overview) is a simpler alternative that avoids OAuth role permission complexity. However, it requires you to set up a password for the user in the **Branch Overview** page in the Lakebase Autoscaling UI.
141
+
142
+ Why deploy first?
143
+
144
+ When the app is deployed, the Service Principal creates schemas and tables and becomes their owner. A `databricks_superuser` has full **DML access** (SELECT, INSERT, UPDATE, DELETE) to these objects, but **cannot run DDL** (CREATE SCHEMA, CREATE TABLE) on schemas owned by the Service Principal. Deploying first ensures all objects exist before local development begins.
145
+
146
+ ### Fine-grained permissions[​](#fine-grained-permissions "Direct link to Fine-grained permissions")
147
+
148
+ For most use cases, `databricks_superuser` is sufficient. If you need schema-level grants instead, refer to the official documentation:
149
+
150
+ * [Manage database permissions](https://docs.databricks.com/aws/en/oltp/projects/manage-roles-permissions)
151
+ * [Postgres roles](https://docs.databricks.com/aws/en/oltp/projects/postgres-roles)
152
+
153
+ SQL script for fine-grained grants
154
+
155
+ Deploy and run the app at least once before executing these grants so the Service Principal initializes the database schema first.
156
+
157
+ Replace `subject` with the user email and `schema` with your schema name:
158
+
159
+ ```sql
160
+ CREATE EXTENSION IF NOT EXISTS databricks_auth;
161
+
162
+ DO $$
163
+ DECLARE
164
+ subject TEXT := 'your-subject'; -- User email like name@databricks.com
165
+ schema TEXT := 'your_schema'; -- Replace 'your_schema' with your schema name
166
+ BEGIN
167
+ -- Create OAuth role for the Databricks identity
168
+ PERFORM databricks_create_role(subject, 'USER');
169
+
170
+ -- Connection and schema access
171
+ EXECUTE format('GRANT CONNECT ON DATABASE "databricks_postgres" TO %I', subject);
172
+ EXECUTE format('GRANT ALL ON SCHEMA %s TO %I', schema, subject);
173
+
174
+ -- Privileges on existing objects
175
+ EXECUTE format('GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA %s TO %I', schema, subject);
176
+ EXECUTE format('GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA %s TO %I', schema, subject);
177
+ EXECUTE format('GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA %s TO %I', schema, subject);
178
+ EXECUTE format('GRANT ALL PRIVILEGES ON ALL PROCEDURES IN SCHEMA %s TO %I', schema, subject);
179
+
180
+ -- Default privileges on future objects
181
+ EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA %s GRANT ALL ON TABLES TO %I', schema, subject);
182
+ EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA %s GRANT ALL ON SEQUENCES TO %I', schema, subject);
183
+ EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA %s GRANT ALL ON FUNCTIONS TO %I', schema, subject);
184
+ EXECUTE format('ALTER DEFAULT PRIVILEGES IN SCHEMA %s GRANT ALL ON ROUTINES TO %I', schema, subject);
185
+ END $$;
186
+
187
+ ```
package/llms.txt CHANGED
@@ -46,7 +46,7 @@ npx @databricks/appkit docs <query>
46
46
  - [Execution context](./docs/plugins/execution-context.md): AppKit manages Databricks authentication via two contexts:
47
47
  - [Files plugin](./docs/plugins/files.md): File operations against Databricks Unity Catalog Volumes. Supports listing, reading, downloading, uploading, deleting, and previewing files with built-in caching, retry, and timeout handling via the execution interceptor pipeline.
48
48
  - [Genie plugin](./docs/plugins/genie.md): Integrates Databricks AI/BI Genie spaces into your AppKit application, enabling natural language data queries via a conversational interface.
49
- - [Lakebase plugin](./docs/plugins/lakebase.md): Currently, the Lakebase plugin currently requires a one-time manual setup to connect your Databricks App with your Lakebase database. An automated setup process is planned for an upcoming future release.
49
+ - [Lakebase plugin](./docs/plugins/lakebase.md): Provides a PostgreSQL connection pool for Databricks Lakebase Autoscaling with automatic OAuth token refresh.
50
50
  - [Plugin management](./docs/plugins/plugin-management.md): AppKit includes a CLI for managing plugins. All commands are available under npx @databricks/appkit plugin.
51
51
  - [Server plugin](./docs/plugins/server.md): Provides HTTP server capabilities with development and production modes.
52
52
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@databricks/appkit",
3
3
  "type": "module",
4
- "version": "0.19.0",
4
+ "version": "0.20.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "packageManager": "pnpm@10.21.0",