How to Use an On-Prem Database With Lovable

Connect Lovable to an on-prem SQL Server database without opening a single firewall port or handing over a database password.

In this video I put DreamFactory in front of a SQL Server database on my local network, generate a REST API from it, lock that API down with a read-only role and a scoped API key, then have Lovable build a live delivery operations dashboard on top of it. Lovable calls the API from a server-side function, so the key never reaches the browser.

What's covered:

  • Why AI app builders like Lovable can't reach on-prem databases, and how DreamFactory bridges that gap over HTTPS
  • Connecting SQL Server in DreamFactory and generating a REST API with no code
  • Testing the API live in the API docs, including filters that run as SQL on the server
  • Creating a read-only role scoped to specific tables
  • Creating an API key tied to that role: the only credential Lovable ever holds
  • Writing a Lovable prompt that keeps the API call server-side, stores the key as a secret, and refuses mock data
  • A live dashboard over 2 million shipments: KPI cards, delivery center filter, late deliveries, tracking number search

Timestamps:

0:00 Intro and architecture

0:26 SQL Server connection in DreamFactory

1:39 Live API docs and filters

2:47 Read-only role

4:30 Scoped API key

5:21 The Lovable prompt, explained

7:21 Adding the secrets

7:47 Lovable builds the app (10x)

8:01 Live dashboard on on-prem data

8:33 Filtering through DreamFactory

8:44 Tracking number search

9:03 Wrap-up

All data shown is synthetic.

#DreamFactory #Lovable #SQLServer #RESTAPI #OnPrem #AIAppBuilder #VibeCoding #Dashboard #APISecurity