Home / Computers/Tech / Making FoxPro Ducky – Part 1 (Intro)

Making FoxPro Ducky – Part 1 (Intro)

In the summer of 2026, while searching for something else online I ran across a reference for an interesting relational database tool called DuckDb. According to Wikipedia: DuckDB is an open-source column-oriented relational database management system (RDBMS). DuckDB was originally developed in the Netherlands as a way to address the need for an in-process OLAP database solution and the result was DuckDB which was first released in 2019. OLAP, short for online analytical processing, is an approach to quickly answer multi-dimensional analytical (MDA) queries. I had no interest in OLAP, but what I found on the DuckDb website was more intriguing.

From their website, I learned the following:

  • DuckDB is an analytical database system that you can deploy anywhere: from edge devices to servers with hundreds of cores.
  • DuckDB has a friendly and expressive PostgreSQL-inspired query language.
  • DuckDb has extensions which can introduce functions and support for new formats.
  • DuckDB offers APIs for all major programming languages.
  • DuckDb can read and write popular formats such as CSV, JSON, Parquet, and Iceberg – locally or in object storage.
  • DuckDb has the ability to query CSV, JSON and other formats directly rather than requiring you to import the files.
  • DuckDb is free & open-source.

DuckDb had me at “free”, but I was also very interested in DuckDb’s ability to read JSON files natively and the idea that you could have a large CSV file and query that CSV file without importing it first really got me fired up about DuckDb. As a Visual Foxpro programmer who has spent the better part of the last 30 years moving data between different systems and automating payroll connections between clients and third party service providers, I am usually focused on import and export formats and improving performance speeds as much as possible for users. Even micro-second improvements at the record level translate into big time savings when processing millions of records at a time.

Don’t misunderstand me here: VFP does an exceptional job at reading and writing files and I’ve build a library of high performance tools over the last 30 years to handle a variety of data content and format conversions which I then package and sell to clients as “interfaces.” However, I’m always interested in saving time where possible plus there are file formats out there that simply are not native to VFP, like as JSON, and building manual extraction tools for these structures can be very time consuming. When I saw DuckDb had the ability to read CSV, Excel, JSON and other filetypes natively and it can build databases either in memory or persistent reusable databases, it had my full attention.

So, I downloaded the DuckDb CLI and I started playing around with it and found it was pretty impressive just by itself. It’s just a single .exe file with nothing to install (although you can add extensions later on). Importing data from a CSV file into a memory based table was incredibly fast. A file that I could import into VFP in about 30 seconds, DuckDb chewed through in just over 1 second. And this was from a .exe file less than 40Mb in size. The speed of queries was amazing as well. Even without indexes, DuckDb was blazingly fast. I even tried importing a JSON file and the results were amazing. The more I played with this tiny RDBMS, the more I liked it and the more I wanted to integrate it in the work I do with VFP.

Unfortunately, there was no DuckDb embedded version you could use with VFP (not that I really expected to find one) like you can do with C, Java, go, Python, R, Rust, C# or C++, but that didn’t dampen my spirit at all because I had an idea. My idea was if I could shell out of VFP to an instance of the DuckDb CLI, issue commands to that instance to import a datafile and create a table, then maybe I could issue queries against that table inside of VFP. This is something that I do almost everyday with databases like Microsoft SQL, MySQL, SQLite, PostgreSQL, FirebirdSQL, Oracle, etc., etc. All I needed to find was an ODBC driver to connect VFP to DuckDb, issue some SQL Passthrough commands to the DuckDb instance and just like that, we’d be off to the races.

Or so I thought…

Turns out DuckDb does have an ODBC driver, but…VFP is a 32-bit application and therefore, it can only communicate to 32-bit ODBC drivers which most databases have. DuckDb’s ODBC driver is only a 64-bit driver and is therefore out of reach of my 32-bit VFP applications. I looked extensively for a third-party project where some random programmer put together an 32-bit ODBC driver, but the only one I found had a fatal flaw. A community attempt did exist to manually compile a 32-bit DuckDB ODBC driver which was built successfully and it passed unit tests, but failed at actual query time. Apparently at that point, the project was abandoned.

One alternative I thought might be to use the 64-bit version of Visual FoxPro Advanced which is a user-modified and maintained version of VFP which is not sanctioned by Microsoft. It should be noted that Microsoft has also not tried to shut the VFPA project down either at least as far as I know. This would have been the easiest solution of all. Just use VFPA 64-bit and you can then use the DuckDb ODBC Driver. But because I develop products that are distributed to clients and almost 100% of my work is done in the 32-bit standard release of VFP, I decided I wanted to try to make it work with the 32-bit version if possible. I also had no clue at this what this effort was going to take.

But being the persistent sort, I decided to take a trip down this rabbit-hole which took almost six weeks for me to come out. I had heard several programmers rave about the results they had been getting with Claude.ai and I thought maybe this is the opportunity to find out if Claude.ai was up to the hype I’ve heard from other programmers. My previous attempts to use AI for refactoring old code failed miserably, so I did not high hopes for this new working relationship with Claude, but because the benefits I saw in DuckDb were so tantalizing, I held my nose and dove into the deep end with my new best friend Claude.

[Continue Reading Part 2]

 

Check Also

Lock The Front Door To Your Email Account

Everyone knows that one of the most common sense things you can do to make …

Leave a Reply

Your email address will not be published. Required fields are marked *