This example demonstrates how to define a Databricks app backed by an OLTP Postgres in a bundle.
It includes and deploys an example application that uses Python and Dash and a database instance. When application is started it provisions its own schema and demonstration data in the OLTP database.
For more information about Databricks Apps see the documentation. For more information about Databricks database instances see the documentation.
- Databricks CLI v0.267.0 or above
- Deploy the bundle:
databricks bundle deploy -t dev
Please note that after this bundle gets deployed, the database instance starts running immediately, which incurs cost.
- Run the app:
databricks bundle run my_app
- Open the app: Run the following command to navigate to the deployed app in your browser:
databricks bundle open my_app
Alternatively, run databricks bundle summary to display its URL.
- Query the app data:
Run the following command to display the data generated by the app:
databricks psql example-database-instance -- --dbname example_database -c "select * from holidays.holiday_requests"
- Explore the app data: Run the following command to navigate to the Unity Catalog in your browser:
databricks bundle open my_catalog
To remove the provisioned resources run
databricks bundle destroy