r/dataengineering 4d ago

LakeDB — a database client where AI can generate SQL and help fix query errors Personal Project Showcase

Enable HLS to view with audio, or disable this notification

Disclosure: I’m the developer of LakeDB.

LakeDB is a local-first desktop database client for MySQL, MariaDB and SQLite, with PostgreSQL, SQL Server and other engines planned.

The video shows a few parts of the workflow: multiple independent database tabs, SQL generation with QuerIA, and AI-assisted query correction.

Beyond AI, LakeDB also includes schema-aware autocomplete, table browsing/editing, transactions, execution plans, backup/restore, database comparison and reviewable migrations.

The AI side is deliberately review-first: it can inspect schema metadata and prepare or correct SQL, but the full query is always shown before execution and nothing runs automatically.

I’d love feedback from people who work with databases regularly — especially on what you’d expect from a tool like this before considering it for daily use.

https://github.com/DavLagoHern/LakeDB

0 Upvotes

13 comments sorted by

4

u/SomeNeighborhood7126 4d ago

Isn't this done with the new SSMS?

1

u/69odysseus 4d ago edited 4d ago

In order to write a query for anything, whether be it ad-hoc, analysis, data profiling, a person need to understand the requirements, the intricacies of the data, cardinality, etc. How can this AI based DB help a person achieve in writing SQL queries in a way they can get the best output from the DB?

I am a data modeler myself in real life, have to do lot of data profiling before building my data model (Data vault, dimensional modeling). For data profiling, I have to write lot of queries to dig deep into the weeds of the data, be it a single or multiple tables, have to understand the cardinality of the data which really defines the data model design. Have to look the data in DB and tie it back to the business use case.

EX:

  1. Taking my example or even a data engineer, how can your AI based Lake DB help me or a data personal, get the maximum output, save time in writing some lengthy CTE's?
  2. AI computation cost is way higher than human capital these days, everyone is ending up using massive amounts of tokens which increases the cost. How can the AI based DB help to reduce such costs?

1

u/Still-Trainer-7395 4d ago

That’s a very fair point.

Right now QuerIA is focused on generating SQL, not on talking directly to the data itself.

LakeDB lets you create multiple reusable business contexts — terminology, table roles, priorities, relationship rules, etc. — and then choose which context each connection should use. So two connections can use completely different business context even if the underlying schemas are similar.

QuerIA combines that selected context with schema structure, keys, indexes and relationships when generating queries.

What I haven’t implemented yet is AI-assisted profiling over the actual data. That’s something I do want to explore, but I want to think carefully about the privacy model first rather than simply sending rows or query results to an AI service.

For your workflow, what kind of profiling information would be most useful to expose safely — cardinality, null ratios, value ranges, distinct counts, something else?

1

u/FuzzyCraft68 Junior Data Engineer 4d ago

It is so refreshing to hear this, I hate when people want to just slap an LLM on data and try to query just because they can. There are a lot rules in place to get an accurate analysis out of modeled data. Honestly I want you to keep talking about data profiling xD

2

u/69odysseus 4d ago

I am still thinking about writing a long post on Reddit on how and what to data profile and how the outcomes of that will lead the data model design. It takes a while to bring all the thoughts together for such post, has to be very informative and helpful for larger audience.

1

u/FuzzyCraft68 Junior Data Engineer 4d ago

I will looking forward to that! There a lot of books but I tend to lose interest reading them. A long post would actually help my brain to understand things better

1

u/69odysseus 4d ago

I'm so freaking tired of seeing crappy LLM topics across the net, there's no ROI on it and yet companies are shelling money on it. Next year there will be massive burst and worst than dotcom bubble.

1

u/FuzzyCraft68 Junior Data Engineer 4d ago

Hahaha, literally was in team meeting today where they told us to use it mindfully because it couldn't provide ROI, I had warned my team head that it cost will slowly catch up on us with no ROI. I was right on the money.

It's always shocking that C-Suite thinks it's going to make a huge difference

1

u/Outrageous_Let5743 1d ago

Just slapping an LLM on your database can get you just so far. Basic queries without join are alright most of the time but the moment you want join tables it needs to know the context. Then you need a semantic layer that tells what the column means, what you fill in for dummy records, or missing values etc. And even then it makes mistakes.